Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suyashsingh/lkm
Linux Kernel Module / Linux Device Drivers
https://github.com/suyashsingh/lkm
Last synced: about 2 months ago
JSON representation
Linux Kernel Module / Linux Device Drivers
- Host: GitHub
- URL: https://github.com/suyashsingh/lkm
- Owner: suyashsingh
- Created: 2021-05-30T04:44:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T12:10:12.000Z (over 3 years ago)
- Last Synced: 2023-10-29T17:24:48.806Z (about 1 year ago)
- Language: C
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Linux Kernel Module / Linux Device Drivers
## 1. [hello-world](/hello-world)
+ Simple hello world loadable kernel module(lkm).
+ linux/module.h includes linux init.h. Don't include it explicitly.
+ module.h contains module_init(), module_exit(), MODULE_AUTHOR and other
meta macros.
+ check dmesg, lsmod for checking the module functionality.
+ Build using `make` and clean up using `make clean`
+ Load module using `sudo insmod hello_world.ko` and remove using
`sudo rmmod hello_world`## 2. Hello World Character Driver
+ Simple character driver.
+ Device file: `/dev/hello_char_0`, sysfs class dir: `/sys/class/hello_char`
+ Change ownership of the device file `chown username /dev/dev/hello_char_0`
+ Reading `cat /dev/hello_char_0` or `strace cat /dev/hello_char_0`
+ Writing `echo "hello" > /dev/hello_char_0` or `strace echo "hello" > /dev/hello_char_0`
+ Use `demsg` for logs.