linux_kernel_hacking / 0_Basic_LKMs / 0.1_device_file /
@Harvey Phillips Harvey Phillips authored on 4 Jun 2020
..
Makefile restructure 4 years ago
README.md restructure 4 years ago
example.c restructure 4 years ago
README.md

Linux Kernel Hacking

0.1: Character Devices

Simple character device file.

To use:

  • Build with make and load with make test
  • Create a device file with mknod /dev/example c <MAJOR> 0, replacing <MAJOR> with major number returned in the kernel buffer.
  • Take a look at the device with cat /dev/example
  • Delete the device file with rm /dev/example and unload the module with rmmod example

Followed along from here.