Examples
Complete kernel modules built with gokm, each with a test program.
| Example | Shows |
|---|---|
examples/hello | the basics |
examples/gcstress | the GC under pressure |
examples/gofs | a filesystem (gokm/fs) |
examples/devices | /dev/gorev with ioctls, /dev/gopipe with poll/blocking I/O, /proc/gorev |
examples/gonet | an IP device answering ping/UDP echo in atomic context, and an Ethernet one with ARP |
examples/gobrd | a RAM disk, ported from Linux’s brd (gokm/blk, module parameters); GPL-2.0, like brd |
examples/sysinfo | gokm/linux: functions, structs, inline functions, by-value structs, macros, pragmas |
Each has a test program that make qemu runs inside a VM against the loaded
module; test/fixtures cover load failures, nested and parked entries,
parallelism, goroutines, heap growth and atomic-context misuse.