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

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.
主站蜘蛛池模板: 万载县| 嘉祥县| 南华县| 石渠县| 金塔县| 齐齐哈尔市| 都安| 莱阳市| 曲水县| 阿鲁科尔沁旗| 丁青县| 关岭| 全椒县| 中山市| 皋兰县| 盖州市| 山丹县| 丰原市| 阜南县| 鄂伦春自治旗| 枣阳市| 黄浦区| 呼伦贝尔市| 宁乡县| 三亚市| 博罗县| 肇源县| 金山区| 台北县| 方城县| 获嘉县| 武宁县| 建宁县| 永宁县| 锦屏县| 南昌市| 翁源县| 新民市| 宜州市| 明水县| 永靖县|