Packages

The Go packages kernel modules are written against.

PackageWhat it’s for
gokm/kernellogging, module lifecycle, errors, handles, memory, SpinLock
gokm/fsfilesystems (mmap and xattrs included): fs.Register
gokm/chardevcharacter devices (/dev/<name>), ioctl, poll: chardev.Register
gokm/procfs/proc files: procfs.Create
gokm/netdevnetwork interfaces (IP like TUN, or Ethernet like TAP): netdev.Register
gokm/blkblock devices (/dev/<name>, partitions included): blk.Register
gokm/linuxgenerated bindings to any kernel function, struct or constant

Importing a framework package is all it takes: gokm build detects it and compiles in its kernel glue. One module can use several (see examples/devices: a char device and a /proc file sharing state).