|
8 tahun lalu | |
---|---|---|
buildroot @ 083c0735e9 | 8 tahun lalu | |
host | 8 tahun lalu | |
kernel_module | 8 tahun lalu | |
rootfs_overlay | 8 tahun lalu | |
.gitignore | 8 tahun lalu | |
.gitmodules | 8 tahun lalu | |
README.md | 8 tahun lalu | |
bibliography.md | 8 tahun lalu | |
build.md | 8 tahun lalu | |
busybox_config_fragment | 8 tahun lalu | |
introduction.md | 8 tahun lalu | |
kernel_config_fragment | 8 tahun lalu | |
kmod.md | 8 tahun lalu | |
run | 8 tahun lalu |
Run one command, get into QEMU Buildroot BusyBox with several minimal Linux kernel 4.9 module example tutorials. Tested in Ubuntu 14.04.
Usage:
./run
First build will take a while (GCC, Linux kernel).
QEMU opens up, and you can run:
insmod /hello.ko
insmod /hello2.ko
rmmod hello
rmmod hello2
Each module comes from a C file under kernel_module/
. For module usage do:
head *. use Buildroot's default kernel version, you can confirm it after build with:
grep BR2_LINUX_KERNEL_VERSION buildroot/.config
We use printk
a lot, and it shows on the QEMU terminal by default. If that annoys you (e.g. you want to see stdout separately), do:
dmesg -n 1
See also: https://superuser.com/questions/351387/how-to-stop-kernel-messages-from-flooding-my-console
When your kernel starts crashing, get the full trace with:
./run -n
See also: https://unix.stackexchange.com/questions/208260/how-to-scroll-up-after-a-kernel-panic
Then if you want your terminal back, hit Ctrl + C, A
and type quit
. See also: http://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses