Homework_Lesson_3/README.md
2022-10-28 16:04:51 +09:00

905 B

Homework_Lesson_3

Assignment

Modify the kernel module you created in the #2 Homework to accommodate the functionality of a character device that puts the number of time the device file has been read from into the file. Compile and run the program. Try reading the device file through “cat /proc/devices”. Submit the source code and the screen shot of the result of execution displayed by the dmesg command. Deadline of homework: Oct 30, 2022 (in case that you cannot finish in the class)

Prerequisits

  • requires the correct linux headers to be installed
  • root access is needed
  • the Code file is NOT named module.c

how to run the kernel module

  • make to build the module
  • sudo insmod <module_name> to run the module
  • sudo rmmod <module_name> to stop the module

viewing the log

on systems that run systemd: journalctl -f -k you can also use dmesg