mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Linux v4.15
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Linux Kernel Module Cheat
|
||||
|
||||
Run one command, get a QEMU Buildroot BusyBox virtual machine built from source with several minimal Linux kernel 4.14 module development example tutorials with GDB and KGDB step debugging and minimal educational hardware models. Limited GEM5 full system support. "Tested" in x86, ARM and MIPS guests, Ubuntu 17.10 host.
|
||||
Run one command, get a QEMU Buildroot BusyBox virtual machine built from source with several minimal Linux kernel 4.15 module development example tutorials with GDB and KGDB step debugging and minimal educational hardware models. Limited GEM5 full system support. "Tested" in x86, ARM and MIPS guests, Ubuntu 17.10 host.
|
||||
|
||||

|
||||
|
||||
|
||||
4
configure
vendored
4
configure
vendored
@@ -48,6 +48,10 @@ EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Without this started failing in kernel 4.15 with:
|
||||
# Makefile:932: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
|
||||
pkgs="$pkgs libelf-dev"
|
||||
|
||||
sudo apt-get update $y
|
||||
# Building SDL for QEMU in Buildroot was rejected upstream because it adds many dependencies:
|
||||
# https://patchwork.ozlabs.org/patch/770684/
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
Print the jiffies every second.
|
||||
|
||||
Timers are callbacks that run when an interrupt happens, from the interrupt context itself.
|
||||
|
||||
Therefore they produce more accurate timing than thread scheduling, which is more complex,
|
||||
@@ -15,12 +17,12 @@ See also:
|
||||
#include <linux/module.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
static void callback(unsigned long data);
|
||||
static void callback(struct timer_list *data);
|
||||
static unsigned long onesec;
|
||||
|
||||
DEFINE_TIMER(mytimer, callback, 0, 0);
|
||||
DEFINE_TIMER(mytimer, callback);
|
||||
|
||||
static void callback(unsigned long data)
|
||||
static void callback(struct timer_list *data)
|
||||
{
|
||||
pr_info("%u\n", (unsigned)jiffies);
|
||||
mod_timer(&mytimer, jiffies + onesec);
|
||||
|
||||
2
linux
2
linux
Submodule linux updated: d4160b40c5...225d02dc63
@@ -2,21 +2,22 @@
|
||||
|
||||
## How to update the Linux kernel?
|
||||
|
||||
If you don't care about educational patches:
|
||||
|
||||
cd linux
|
||||
git fetch
|
||||
git checkout master
|
||||
|
||||
If you do:
|
||||
|
||||
last_mainline_revision=v4.14
|
||||
git rebase --onto master $last_mainline_revision
|
||||
|
||||
Then rebuild the kernel:
|
||||
|
||||
next_mainline_revision=v4.15
|
||||
cd linux
|
||||
git remote add up git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
|
||||
git fetch up
|
||||
git rebase --onto "$next_mainline_revision" "$last_mainline_revision"
|
||||
./build -t linux-reconfigure
|
||||
|
||||
Create and push a tag to make things saner:
|
||||
|
||||
git checkout -b "lkmc-${next_mainline_revision}"
|
||||
git remote set-url origin git@github.com:cirosantilli/linux.git
|
||||
git push --follow-tag
|
||||
|
||||
and update the README!
|
||||
|
||||
Now, all you kernel modules may break, although they are usually trivial breaks of things moving around headers or to sub-structs.
|
||||
|
||||
The userland, however, should simply not break, as Linus enforces strict backwards compatibility of userland interfaces.
|
||||
|
||||
Reference in New Issue
Block a user