Lab - module parameters
in this lab you'll create a module with the following parameters:
# insmod mymodule.ko irq=10 name=mydev debug=1 channels=0x100,0x200,0x300
- Create a new kernel module (can be based on mod1 source)
- Create the parameters:
- irq - integer , default value = 6
- name - char pointer
- debug - integer, default value = 0 (no debug)
- channels - integer array, size = 8
- Add module init function
- if debug=1 write to the kernel log all parameters
- if debug=0 write to kernel log "module init"
- Add module exit function
- Create files on /sys/module/ to access all parameters
- Test your work
No comments:
Post a Comment