login
Header Space

 
 

Re: file I/O and block I/O

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Sushil Patil <sushilpa@...>
Cc: Shreyansh Jain <shrey.linux@...>, Sandeep K Sinha <sandeepksinha@...>, <kernelnewbies@...>
Date: Thursday, May 15, 2008 - 11:30 am

2008/5/15 Sushil Patil <sushilpa@gmail.com>:

Un*x systems has two main abstractions (the upper level ones): files
and prcesses. By this way, devices are represented as files (remember
/dev?), and then, there are two kinds (flavors) of devices: char
devices, and block devices.

Char devices are the simpler ones, since that char devices I/O is
based on a stream of bytes received and sent by the device driver. On
the other side, block devices relies on specialized structures (the
page cache, the inodes and dentries), and operates via blocks
(mappings of disk sectors indeed), being able to seek over the mapped
region for instance (as opposed to char devices, constrained to
streamed bytes). The block operations are designed and implemented in
order to surpass the brutal difference among timings regarding memory
operations and disk operations, buffering data to optimize writes and
seeks on the slower disk I/O.

Then, file I/O can be block I/O or not, depending on the nature of the
file. Think on a disk file (manifestly block, since it lives inside a
hard drive or something similar), and a network socket. Beautiful
architecture that one used by U*ix :)


Best regards
Mauad

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
file I/O and block I/O, Vijay Chauhan, (Wed May 14, 7:42 am)
Re: file I/O and block I/O, Rene Herman, (Wed May 14, 8:06 am)
Re: file I/O and block I/O, Rene Herman, (Thu May 15, 4:42 am)
Re: file I/O and block I/O, Sandeep K Sinha, (Wed May 14, 8:30 am)
Re: file I/O and block I/O, Shreyansh Jain, (Wed May 14, 8:38 am)
Re: file I/O and block I/O, Sushil Patil, (Thu May 15, 12:49 am)
Re: file I/O and block I/O, Mauricio Mauad Menegaz Filho..., (Thu May 15, 11:30 am)
Re: file I/O and block I/O, Scott Lovenberg, (Thu May 15, 6:42 am)
Re: file I/O and block I/O, Rene Herman, (Wed May 14, 11:47 am)
speck-geostationary