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

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.
主站蜘蛛池模板: 汶上县| 靖西县| 瑞昌市| 罗源县| 潢川县| 井研县| 大石桥市| 龙海市| 济宁市| 阳泉市| 石楼县| 东海县| 廉江市| 尼勒克县| 呼玛县| 勃利县| 中江县| 双流县| 黑河市| 浠水县| 德昌县| 营山县| 宁阳县| 郎溪县| 定州市| 鄄城县| 邵阳县| 元氏县| 通榆县| 肇州县| 贡嘎县| 桐梓县| 乐山市| 嘉善县| 沈丘县| 安多县| 依兰县| 昌平区| 前郭尔| 马鞍山市| 理塘县|