|
When writing a linux driver, you will call the register_chrdev() function to register your own driver (2.4, character driver). This function writes our own file_operation into a device struct structure.
When we test our own driver, we will call the system call open() to open the device file. The sys_open() function will call filep_open(). This function will call open_namei() and dentry_open() to generate a struct file structure, and The file_operation field in the structure is the file_operation field in the inode structure.
Question: How to assign the file_operation structure written by our driver to the inode structure in the kernel so that the user program can call our driver correctly? |
|