- Lab 2: Kernel Module and Makefile
[Back]
Preliminaries
Tasks for today:
- Write a kernel module
- Write a Makefile to automate the building process
Kernel Module
- Take a snapshot before we begin.
- A basic kernel module that interacts with user level program
- After create_proc_entry(), a new file created. Where is it? Is it a real file?
- Add a new file operation: read()
- How do we know what parameters ioctl()/read() takes?
-
Linux cross reference
You can select a kernel version and look for definitions and references
to a symbol
e.g.: You might wanna check the symbols file_operations, _IOW, task_struct
- Add a new file operation: write()
- Operate on the file from shell
- Find the solution here
Makefile
- Why do we need a Makefile
- Basic Syntax:
Courtesy of Zhuoqun (Tom) Cheng.