주 번호
-
디바이스 드라이버 / 주 번호에 의한 파일 처리Linux/Linux Device Driver 2020. 9. 1. 12:41
주 번호에 의한 파일 처리는 register_chrdev()와 register_chrdev_region() 두 가지 함수를 사용할 수 있습니다. pi@raspberrypi:~/Documents/major $ nano major_driver.c #include #include #include #include // file_operations #include // copy_to_user() #include // kmalloc() #define MAJOR_DEV_NAME"major_dev" #define MAJOR_DEV_NUM200 static int major_open(struct inode *inode, struct file *file) { printk("major_open\n"); return 0; }..