mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
0
This commit is contained in:
34
host/README.md
Normal file
34
host/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Host
|
||||
|
||||
Simple things that can be demonstrated by inserting a module into the currently running host. Tested on Ubuntu 16.04.
|
||||
|
||||
1. [hello](hello.c)
|
||||
1. [ins_rm_mod.c](ins_rm_mod.c)
|
||||
|
||||
## Rationale
|
||||
|
||||
This method easier to setup, but it is not recommended for development, as:
|
||||
|
||||
- it may break your system.
|
||||
- you can't control which kernel version to use
|
||||
|
||||
Use VMs instead.
|
||||
|
||||
## Usage
|
||||
|
||||
We only use it for super simple examples.
|
||||
|
||||
Build, insert and remove a hello world module:
|
||||
|
||||
make ins
|
||||
make rm
|
||||
make log
|
||||
|
||||
The last lines of the log should contain:
|
||||
|
||||
init_module
|
||||
cleanup_module
|
||||
|
||||
Insert and remove a module from a C program:
|
||||
|
||||
make ins_rm_run
|
||||
Reference in New Issue
Block a user