linux_kernel_hacking / 0.1_device_file /
@Harvey Phillips Harvey Phillips authored on 2 Jun 2020
..
Makefile device file example 4 years ago
README.md update title 4 years ago
example.c device file example 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.