this article mainly illustrate the difference between character device and block device.
some of the are digested on the net.
a friend named theNbomr on the net said those:
A block device would read/write bytes in fixed size blocks, as in disk sectors. Character devices read/write 0 or more bytes, in a stream, such as a TTY or a keyboard. The nature of the device generally dictates how the device driver is written for it, and you access the device accordingly. Mostly, when accessing devices, you treat then as if they are files:
open-read-write-seek-flush-stat-close. You also have ioctl calls to access the device itself(as opposed to the data that it conveys).
And Kevin Smith Wrote:
the real important difference is what routines get called - a block open gets a buffer allocated by the kernel and that's where the data is, while a raw read or write is reading or writing user space. That is an important point.
阅读(762) | 评论(0) | 转发(0) |