xuxinyi 41cc4ae244 自动添加设备号 il y a 1 an
..
charDevice.c 41cc4ae244 自动添加设备号 il y a 1 an
img.png 41cc4ae244 自动添加设备号 il y a 1 an
readme.md 41cc4ae244 自动添加设备号 il y a 1 an

readme.md

注册字符驱动。但是不自动挂载。 lsmod charDevice.ko mknod /dev/charDevice3 c 200 0 cat /dev/charDevice img.png Linux has always enforced device file identification by a unique identifier, composed of two parts, a major and a minor.

enforce 强制 identification 标识 a unique identifier 一种唯一标识符 composed of two parts 由两个部分组成 a major and a minor 主设备号和次设备号~~~~ 这个是个整形数,由主次设备号组成 the preceding excerpt 前面的摘录 excerpt 摘录 英 / ˈeksɜːpt

Character device data structure introduction 字符设备数据结构体介绍 struct cdev {

struct kobject kobj;
struct module *owner;
const struct file_operations *ops;
dev_t dev;
[...]

};

include/linux/kdev_t.h img.png