## How to code kernel modules for DF * Main kernel directory: /usr/src/sys/kern * General coding guidelines: man style ### Example: Loading a module cd /usr/src/sys/vfs/portal # build module make # load module kldload portal # look at module footprint kldstat # alter source code make clean make lsvfs # unload module kldunload # look at module footprint kldstat lsvfs ### Important functions * kprintf("Message, displayed in dmesg"); ### TODO How can you see the debug output of a module? How can you redirect the debug output to dmesg? Which debug output facility you should use (not dmesg?) to look at messages from a module?