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     <sect1><title>Delaying, scheduling, and timer routines</title>
50!Ekernel/sched.c
51     </sect1>
52  </chapter>
53
54  <chapter id="adt">
55     <title>Data Types</title>
56     <sect1><title>Doubly Linked Lists</title>
57!Iinclude/linux/list.h
58     </sect1>
59  </chapter>
60
61  <chapter id="libc">
62     <title>Basic C Library Functions</title>
63
64     <para>
65       When writing drivers, you cannot in general use routines which are
66       from the C Library.  Some of the functions have been found generally
67       useful and they are listed below.  The behaviour of these functions
68       may vary slightly from those defined by ANSI, and these deviations
69       are noted in the text.
70     </para>
71
72     <sect1><title>String Conversions</title>
73!Ilib/vsprintf.c
74!Elib/vsprintf.c
75     </sect1>
76     <sect1><title>String Manipulation</title>
77!Ilib/string.c
78     </sect1>
79     <sect1><title>Bit Operations</title>
80!Iinclude/asm-i386/bitops.h
81     </sect1>
82  </chapter>
83
84  <chapter id="mm">
85     <title>Memory Management in Linux</title>
86     <sect1><title>The Slab Cache</title>
87!Emm/slab.c
88      </sect1>
89  </chapter>
90
91  <chapter id="proc">
92     <title>The proc filesystem</title>
93 
94     <sect1><title>sysctl interface</title>
95!Ekernel/sysctl.c
96     </sect1>
97  </chapter>
98
99  <chapter id="vfs">
100     <title>The Linux VFS</title>
101     <sect1><title>The Directory Cache</title>
102!Efs/dcache.c
103!Iinclude/linux/dcache.h
104     </sect1>
105     <sect1><title>Inode Handling</title>
106!Efs/inode.c
107!Efs/bad_inode.c
108     </sect1>
109     <sect1><title>Registration and Superblocks</title>
110!Efs/super.c
111     </sect1>
112     <sect1><title>File Locks</title>
113!Efs/locks.c
114!Ifs/locks.c
115     </sect1>
116  </chapter>
117
118  <chapter id="netcore">
119     <title>Linux Networking</title>
120     <sect1><title>Socket Buffer Functions</title>
121!Iinclude/linux/skbuff.h
122!Enet/core/skbuff.c
123     </sect1>
124     <sect1><title>Socket Filter</title>
125!Enet/core/filter.c
126     </sect1>
127  </chapter>
128
129  <chapter id="netdev">
130     <title>Network device support</title>
131     <sect1><title>Driver Support</title>
132!Edrivers/net/net_init.c
133!Enet/core/dev.c
134     </sect1>
135     <sect1><title>8390 Based Network Cards</title>
136!Edrivers/net/8390.c
137     </sect1>
138     <sect1><title>Synchronous PPP</title>
139!Edrivers/net/wan/syncppp.c
140     </sect1>
141  </chapter>
142
143  <chapter id="modload">
144     <title>Module Support</title>
145     <sect1><title>Module Loading</title>
146!Ekernel/kmod.c
147     </sect1>
148     <sect1><title>Inter Module support</title>
149!Ekernel/module.c
150     </sect1>
151  </chapter>
152
153  <chapter id="hardware">
154     <title>Hardware Interfaces</title>
155     <sect1><title>Interrupt Handling</title>
156!Iarch/i386/kernel/irq.c
157     </sect1>
158
159     <sect1><title>MTRR Handling</title>
160!Earch/i386/kernel/mtrr.c
161     </sect1>
162     <sect1><title>PCI Support Library</title>
163!Edrivers/pci/pci.c
164     </sect1>
165     <sect1><title>PCI Hotplug Support Library</title>
166!Edrivers/hotplug/pci_hotplug_core.c
167!Edrivers/hotplug/pci_hotplug_util.c
168     </sect1>
169     <sect1><title>MCA Architecture</title>
170	<sect2><title>MCA Device Functions</title>
171!Earch/i386/kernel/mca.c
172	</sect2>
173	<sect2><title>MCA Bus DMA</title>
174!Iinclude/asm-i386/mca_dma.h
175	</sect2>
176     </sect1>
177  </chapter>
178
179  <chapter id="devfs">
180     <title>The Device File System</title>
181!Efs/devfs/base.c
182  </chapter>
183
184  <chapter id="pmfuncs">
185     <title>Power Management</title>
186!Ekernel/pm.c
187  </chapter>
188
189  <chapter id="blkdev">
190     <title>Block Devices</title>
191!Edrivers/block/ll_rw_blk.c
192  </chapter>
193
194  <chapter id="miscdev">
195     <title>Miscellaneous Devices</title>
196!Edrivers/char/misc.c
197  </chapter>
198
199  <chapter id="viddev">
200     <title>Video4Linux</title>
201!Edrivers/media/video/videodev.c
202  </chapter>
203
204  <chapter id="snddev">
205     <title>Sound Devices</title>
206!Edrivers/sound/sound_core.c
207!Idrivers/sound/sound_firmware.c
208  </chapter>
209
210  <chapter id="usb">
211     <title>USB Devices</title>
212!Edrivers/usb/usb.c
213  </chapter>
214
215  <chapter id="uart16x50">
216     <title>16x50 UART Driver</title>
217!Edrivers/char/serial.c
218  </chapter>
219
220  <chapter id="z85230">
221     <title>Z85230 Support Library</title>
222!Edrivers/net/wan/z85230.c
223  </chapter>
224
225  <chapter id="fbdev">
226     <title>Frame Buffer Library</title>
227
228     <para>
229       The frame buffer drivers depend heavily on four data structures.  
230       These structures are declared in include/linux/fb.h.  They are 
231       fb_info, fb_var_screeninfo, fb_fix_screeninfo and fb_monospecs. 
232       The last three can be made available to and from userland. 
233     </para>
234
235     <para>
236       fb_info defines the current state of a particular video card. 
237       Inside fb_info, there exists a fb_ops structure which is a 
238       collection of needed functions to make fbdev and fbcon work.
239       fb_info is only visible to the kernel.
240     </para>
241
242     <para>
243       fb_var_screeninfo is used to describe the features of a video card 
244       that are user defined.  With fb_var_screeninfo, things such as
245       depth and the resolution may be defined.
246     </para>
247
248     <para>
249       The next structure is fb_fix_screeninfo. This defines the 
250       properties of a card that are created when a mode is set and can't 
251       be changed otherwise.  A good example of this is the start of the 
252       frame buffer memory.  This "locks" the address of the frame buffer
253       memory, so that it cannot be changed or moved.
254     </para>
255
256     <para>
257       The last structure is fb_monospecs. In the old API, there was 
258       little importance for fb_monospecs. This allowed for forbidden things 
259       such as setting a mode of 800x600 on a fix frequency monitor. With 
260       the new API, fb_monospecs prevents such things, and if used 
261       correctly, can prevent a monitor from being cooked.  fb_monospecs
262       will not be useful until kernels 2.5.x.
263     </para>
264
265     <sect1><title>Frame Buffer Memory</title>
266!Edrivers/video/fbmem.c
267     </sect1>
268     <sect1><title>Frame Buffer Console</title>
269!Edrivers/video/fbcon.c
270     </sect1>
271     <sect1><title>Frame Buffer Colormap</title>
272!Edrivers/video/fbcmap.c
273     </sect1>
274     <sect1><title>Frame Buffer Generic Functions</title>
275!Edrivers/video/fbgen.c
276     </sect1>
277     <sect1><title>Frame Buffer Video Mode Database</title>
278!Idrivers/video/modedb.c
279!Edrivers/video/modedb.c
280     </sect1>
281     <sect1><title>Frame Buffer Macintosh Video Mode Database</title>
282!Idrivers/video/macmodes.c
283     </sect1>
284     <sect1><title>Frame Buffer Fonts</title>
285!Idrivers/video/fonts.c
286     </sect1>
287  </chapter>
288
289</book>
290