官术网_书友最值得收藏!

Creating the simplest char driver

In the Linux kernel, three major device types exist—char device, block device, and net device. And of course, we have three major device driver types; that is, char, block, and net drivers. In this chapter, we're taking a look at a char (or character) device, which is a kind of peripheral that can be accessed as a stream of bytes, such as a serial port, audio device, and so on. However, in this recipe, we're going to present a really basic char driver, which simply registers itself and does nothing more than this. Even if it may seem useless, we will discover that this step really introduces plenty of new concepts!

Actually, it could be possible to exchange data between peripherals and user space without a char, block, or net driver but by simply using some mechanism offered by the  sysfs , but this is a special case and it is generally used only for very simple devices that have to exchange simple data types.
主站蜘蛛池模板: 赤城县| 元江| 河曲县| 岑巩县| 清水县| 永丰县| 旬邑县| 灌阳县| 开阳县| 如皋市| 定结县| 怀远县| 边坝县| 正蓝旗| 金门县| 鹤峰县| 永昌县| 铜山县| 黄石市| 乌什县| 承德市| 东乌| 乐平市| 海兴县| 屏东县| 化德县| 通辽市| 阿拉善右旗| 胶州市| 临桂县| 射阳县| 扎鲁特旗| 普洱| 湖南省| 遂昌县| 海阳市| 厦门市| 锡林郭勒盟| 永顺县| 尤溪县| 定州市|