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

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.
主站蜘蛛池模板: 隆子县| 龙口市| 丽江市| 华池县| 乳山市| 滦南县| 尼木县| 松原市| 沙坪坝区| 敦化市| 渝中区| 绥德县| 金湖县| 伊吾县| 四子王旗| 祁东县| 临颍县| 乌什县| 洮南市| 绥芬河市| 永州市| 五莲县| 巩义市| 万宁市| 平远县| 应城市| 郁南县| 吉首市| 金门县| 乐清市| 通许县| 巩留县| 简阳市| 高要市| 九台市| 长治县| 九龙坡区| 邹城市| 大同县| 从化市| 灵璧县|