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