Chinaunix首页 | 论坛 | 博客
  • 博客访问: 443677
  • 博文数量: 138
  • 博客积分: 4114
  • 博客等级: 上校
  • 技术积分: 1341
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-14 20:41
文章分类

全部博文(138)

文章存档

2014年(1)

2013年(2)

2012年(78)

2011年(13)

2010年(34)

2009年(10)

我的朋友

分类: LINUX

2009-11-13 08:19:43

 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.

阅读(752) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~