1. 创建字符设备之前,需要先申请字符设备id int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count, const char *name) 功能:向内核申请设备号 参数: dev:保存内核给你分配的设备号,注意: Read More
posted @ 2025-06-01 09:33 靖意风 Views(12) Comments(0) Diggs(0)
1. 内核编程框架 1.1 代码 $cat hello.c #include <linux/init.h> #include <linux/module.h> static int hello_init(void) { printk("%s\n", __func__); return 0; } st Read More
posted @ 2025-06-01 09:19 靖意风 Views(13) Comments(0) Diggs(0)