Session 5: Character Device Drivers

Tasks

Download and unzip the tasks archive sesiune-05 on the virtual machine.

  1. Z device
    • Fill the code in 1-devz/ directory to implement a simple character device driver that is a source for reading Z characters.
      • The module will use major 42 and minor 0. Make use of this information when creating device node file
      • mknod /dev/z c 42 0
      • cat /dev/z should read ZZZZZ
      • Follow the comments inside the source file and add printks for relevant operations
      • Have a look at raw_init and raw_exit functions.
  2. nasty device
    • Follow the code in 2-nasty/ and take notice how a simple character device read/write operations are implemented.
    • Compile the driver and explain what its actions.
sesiuni/kernel/char.txt · Last modified: 2012/07/06 09:02 by dbaluta