CS680 Linux Kernel Programming Homework

Homework 2 on
Kernel Module Programming

Submission:Prepare a tgz (tar gzip) file containing the source code file(s) you created/modified and screen shots that show that your program executed properly. Upload the file to the class homework submission site found on the homework page.

Write three simple and small module programs. The Linux Kernel Module Programming Guide has all the details. However, you should do the homework yourself.

Here are the three modules you will implement in this homework:
  1. hello1.c: Use module_init() and module_exit() macros. The /var/log/message file will show
    "My Name: Loading Hello1 module - Hello World 1"
    "My Name: Exiting Hello1 module - Goodbye World 1"
  2. hello2.c: Use module_init(), module_exit(), __init, __exit macros, and __initdata. The /var/log/message file will show
    "My Name: Loading Hello2 module - Hello World 2"
    "My Name: Exiting Hello2 module - Goodbye World 2"
    Print the number "2" using "__initdata."
  3. hello3.c: passing command line arguments using MODULE_PARM() macro.
    Try to print some numbers and strings such as
      [/var/log/messages]
      ...
      #kernel: Loading Hello 3: Hello World 3
      #kernel: ==============================
      #kernel: Name : My Name
      #kernel: Street : 123 My Way 
      #kernel: City : North Newark
      #kernel: ZIP code : 98765
    
Again, the web page is for your reference. Do the homework yourself.