update for rename of docs/newhandbook/Security/index.mdwn to docs/handbook/Security...
[ikiwiki.git] / docs / howtos / HowTo_Develop_Kernel_Modules.mdwn
1 ## How to code kernel modules for DF 
2
3
4 * Main kernel directory: /usr/src/sys/kern
5
6
7 * General coding guidelines: man style
8
9 ### Example: Loading a module 
10     
11     cd /usr/src/sys/vfs/portal
12     # build module
13     make
14     
15     # load module
16     kldload portal
17     # look at module footprint
18     kldstat
19     
20     # alter source code
21     make clean
22     make
23     lsvfs
24     
25     # unload module
26     kldunload portal
27     # look at module footprint
28     kldstat
29     lsvfs
30
31
32
33 ### Important functions 
34
35 * kprintf("Message, displayed in dmesg");
36
37 ### TODO 
38 How can you see the debug output of a module?
39
40 How can you redirect the debug output to dmesg?
41
42 Which debug output facility you should use (not dmesg?) to look at messages from a module?