vserver 1.9.5.x5
[linux-2.6.git] / Documentation / DocBook / kernel-api.tmpl
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
2 <book id="LinuxKernelAPI">
3  <bookinfo>
4   <title>The Linux Kernel API</title>
5   
6   <legalnotice>
7    <para>
8      This documentation is free software; you can redistribute
9      it and/or modify it under the terms of the GNU General Public
10      License as published by the Free Software Foundation; either
11      version 2 of the License, or (at your option) any later
12      version.
13    </para>
14       
15    <para>
16      This program is distributed in the hope that it will be
17      useful, but WITHOUT ANY WARRANTY; without even the implied
18      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19      See the GNU General Public License for more details.
20    </para>
21       
22    <para>
23      You should have received a copy of the GNU General Public
24      License along with this program; if not, write to the Free
25      Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26      MA 02111-1307 USA
27    </para>
28       
29    <para>
30      For more details see the file COPYING in the source
31      distribution of Linux.
32    </para>
33   </legalnotice>
34  </bookinfo>
35
36 <toc></toc>
37
38   <chapter id="Basics">
39      <title>Driver Basics</title>
40      <sect1><title>Driver Entry and Exit points</title>
41 !Iinclude/linux/init.h
42      </sect1>
43
44      <sect1><title>Atomic and pointer manipulation</title>
45 !Iinclude/asm-i386/atomic.h
46 !Iinclude/asm-i386/unaligned.h
47      </sect1>
48
49 <!-- FIXME:
50   kernel/sched.c has no docs, which stuffs up the sgml.  Comment
51   out until somebody adds docs.  KAO
52      <sect1><title>Delaying, scheduling, and timer routines</title>
53 X!Ekernel/sched.c
54      </sect1>
55 KAO -->
56   </chapter>
57
58   <chapter id="adt">
59      <title>Data Types</title>
60      <sect1><title>Doubly Linked Lists</title>
61 !Iinclude/linux/list.h
62      </sect1>
63   </chapter>
64
65   <chapter id="libc">
66      <title>Basic C Library Functions</title>
67
68      <para>
69        When writing drivers, you cannot in general use routines which are
70        from the C Library.  Some of the functions have been found generally
71        useful and they are listed below.  The behaviour of these functions
72        may vary slightly from those defined by ANSI, and these deviations
73        are noted in the text.
74      </para>
75
76      <sect1><title>String Conversions</title>
77 !Ilib/vsprintf.c
78 !Elib/vsprintf.c
79      </sect1>
80      <sect1><title>String Manipulation</title>
81 !Ilib/string.c
82 !Elib/string.c
83      </sect1>
84      <sect1><title>Bit Operations</title>
85 !Iinclude/asm-i386/bitops.h
86      </sect1>
87   </chapter>
88
89   <chapter id="mm">
90      <title>Memory Management in Linux</title>
91      <sect1><title>The Slab Cache</title>
92 !Emm/slab.c
93      </sect1>
94      <sect1><title>User Space Memory Access</title>
95 !Iinclude/asm-i386/uaccess.h
96 !Iarch/i386/lib/usercopy.c
97      </sect1>
98   </chapter>
99
100   <chapter id="proc">
101      <title>The proc filesystem</title>
102  
103      <sect1><title>sysctl interface</title>
104 !Ekernel/sysctl.c
105      </sect1>
106   </chapter>
107
108   <chapter id="debugfs">
109      <title>The debugfs filesystem</title>
110  
111      <sect1><title>debugfs interface</title>
112 !Efs/debugfs/inode.c
113 !Efs/debugfs/file.c
114      </sect1>
115   </chapter>
116
117   <chapter id="vfs">
118      <title>The Linux VFS</title>
119      <sect1><title>The Directory Cache</title>
120 !Efs/dcache.c
121 !Iinclude/linux/dcache.h
122      </sect1>
123      <sect1><title>Inode Handling</title>
124 !Efs/inode.c
125 !Efs/bad_inode.c
126      </sect1>
127      <sect1><title>Registration and Superblocks</title>
128 !Efs/super.c
129      </sect1>
130      <sect1><title>File Locks</title>
131 !Efs/locks.c
132 !Ifs/locks.c
133      </sect1>
134   </chapter>
135
136   <chapter id="netcore">
137      <title>Linux Networking</title>
138      <sect1><title>Socket Buffer Functions</title>
139 !Iinclude/linux/skbuff.h
140 !Enet/core/skbuff.c
141      </sect1>
142      <sect1><title>Socket Filter</title>
143 !Enet/core/filter.c
144      </sect1>
145      <sect1><title>Generic Network Statistics</title>
146 !Iinclude/linux/gen_stats.h
147 !Enet/core/gen_stats.c
148 !Enet/core/gen_estimator.c
149      </sect1>
150   </chapter>
151
152   <chapter id="netdev">
153      <title>Network device support</title>
154      <sect1><title>Driver Support</title>
155 !Enet/core/dev.c
156      </sect1>
157      <sect1><title>8390 Based Network Cards</title>
158 !Edrivers/net/8390.c
159      </sect1>
160      <sect1><title>Synchronous PPP</title>
161 !Edrivers/net/wan/syncppp.c
162      </sect1>
163   </chapter>
164
165   <chapter id="modload">
166      <title>Module Support</title>
167      <sect1><title>Module Loading</title>
168 !Ekernel/kmod.c
169      </sect1>
170      <sect1><title>Inter Module support</title>
171         <para>
172            Refer to the file kernel/module.c for more information.
173         </para>
174 <!-- FIXME: Removed for now since no structured comments in source
175 X!Ekernel/module.c
176 -->
177      </sect1>
178   </chapter>
179
180   <chapter id="hardware">
181      <title>Hardware Interfaces</title>
182      <sect1><title>Interrupt Handling</title>
183 !Iarch/i386/kernel/irq.c
184      </sect1>
185
186      <sect1><title>MTRR Handling</title>
187 !Earch/i386/kernel/cpu/mtrr/main.c
188      </sect1>
189      <sect1><title>PCI Support Library</title>
190 !Edrivers/pci/pci.c
191      </sect1>
192      <sect1><title>PCI Hotplug Support Library</title>
193 !Edrivers/pci/hotplug/pci_hotplug_core.c
194      </sect1>
195      <sect1><title>MCA Architecture</title>
196         <sect2><title>MCA Device Functions</title>
197            <para>
198               Refer to the file arch/i386/kernel/mca.c for more information.
199            </para>
200 <!-- FIXME: Removed for now since no structured comments in source
201 X!Earch/i386/kernel/mca.c
202 -->
203         </sect2>
204         <sect2><title>MCA Bus DMA</title>
205 !Iinclude/asm-i386/mca_dma.h
206         </sect2>
207      </sect1>
208   </chapter>
209
210   <chapter id="devfs">
211      <title>The Device File System</title>
212 !Efs/devfs/base.c
213   </chapter>
214
215   <chapter id="security">
216      <title>Security Framework</title>
217 !Esecurity/security.c
218   </chapter>
219
220   <chapter id="pmfuncs">
221      <title>Power Management</title>
222 !Ekernel/power/pm.c
223   </chapter>
224
225   <chapter id="blkdev">
226      <title>Block Devices</title>
227 !Edrivers/block/ll_rw_blk.c
228   </chapter>
229
230   <chapter id="miscdev">
231      <title>Miscellaneous Devices</title>
232 !Edrivers/char/misc.c
233   </chapter>
234
235   <chapter id="viddev">
236      <title>Video4Linux</title>
237 !Edrivers/media/video/videodev.c
238   </chapter>
239
240   <chapter id="snddev">
241      <title>Sound Devices</title>
242 !Esound/sound_core.c
243 <!-- FIXME: Removed for now since no structured comments in source
244 X!Isound/sound_firmware.c
245 -->
246   </chapter>
247
248   <chapter id="uart16x50">
249      <title>16x50 UART Driver</title>
250 !Edrivers/serial/serial_core.c
251 !Edrivers/serial/8250.c
252   </chapter>
253
254   <chapter id="z85230">
255      <title>Z85230 Support Library</title>
256 !Edrivers/net/wan/z85230.c
257   </chapter>
258
259   <chapter id="fbdev">
260      <title>Frame Buffer Library</title>
261
262      <para>
263        The frame buffer drivers depend heavily on four data structures.  
264        These structures are declared in include/linux/fb.h.  They are 
265        fb_info, fb_var_screeninfo, fb_fix_screeninfo and fb_monospecs. 
266        The last three can be made available to and from userland. 
267      </para>
268
269      <para>
270        fb_info defines the current state of a particular video card. 
271        Inside fb_info, there exists a fb_ops structure which is a 
272        collection of needed functions to make fbdev and fbcon work.
273        fb_info is only visible to the kernel.
274      </para>
275
276      <para>
277        fb_var_screeninfo is used to describe the features of a video card 
278        that are user defined.  With fb_var_screeninfo, things such as
279        depth and the resolution may be defined.
280      </para>
281
282      <para>
283        The next structure is fb_fix_screeninfo. This defines the 
284        properties of a card that are created when a mode is set and can't 
285        be changed otherwise.  A good example of this is the start of the 
286        frame buffer memory.  This "locks" the address of the frame buffer
287        memory, so that it cannot be changed or moved.
288      </para>
289
290      <para>
291        The last structure is fb_monospecs. In the old API, there was 
292        little importance for fb_monospecs. This allowed for forbidden things 
293        such as setting a mode of 800x600 on a fix frequency monitor. With 
294        the new API, fb_monospecs prevents such things, and if used 
295        correctly, can prevent a monitor from being cooked.  fb_monospecs
296        will not be useful until kernels 2.5.x.
297      </para>
298
299      <sect1><title>Frame Buffer Memory</title>
300 !Edrivers/video/fbmem.c
301      </sect1>
302      <sect1><title>Frame Buffer Console</title>
303 !Edrivers/video/console/fbcon.c
304      </sect1>
305      <sect1><title>Frame Buffer Colormap</title>
306 !Edrivers/video/fbcmap.c
307      </sect1>
308 <!-- FIXME:
309   drivers/video/fbgen.c has no docs, which stuffs up the sgml.  Comment
310   out until somebody adds docs.  KAO
311      <sect1><title>Frame Buffer Generic Functions</title>
312 X!Idrivers/video/fbgen.c
313      </sect1>
314 KAO -->
315      <sect1><title>Frame Buffer Video Mode Database</title>
316 !Idrivers/video/modedb.c
317 !Edrivers/video/modedb.c
318      </sect1>
319      <sect1><title>Frame Buffer Macintosh Video Mode Database</title>
320 !Idrivers/video/macmodes.c
321      </sect1>
322      <sect1><title>Frame Buffer Fonts</title>
323         <para>
324            Refer to the file drivers/video/console/fonts.c for more information.
325         </para>
326 <!-- FIXME: Removed for now since no structured comments in source
327 X!Idrivers/video/console/fonts.c
328 -->
329      </sect1>
330   </chapter>
331 </book>