1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
2 <book id="LinuxKernelAPI">
4 <title>The Linux Kernel API</title>
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
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.
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,
30 For more details see the file COPYING in the source
31 distribution of Linux.
39 <title>Driver Basics</title>
40 <sect1><title>Driver Entry and Exit points</title>
41 !Iinclude/linux/init.h
44 <sect1><title>Atomic and pointer manipulation</title>
45 !Iinclude/asm-i386/atomic.h
46 !Iinclude/asm-i386/unaligned.h
49 <sect1><title>Delaying, scheduling, and timer routines</title>
55 <title>Data Types</title>
56 <sect1><title>Doubly Linked Lists</title>
57 !Iinclude/linux/list.h
62 <title>Basic C Library Functions</title>
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.
72 <sect1><title>String Conversions</title>
76 <sect1><title>String Manipulation</title>
79 <sect1><title>Bit Operations</title>
80 !Iinclude/asm-i386/bitops.h
85 <title>Memory Management in Linux</title>
86 <sect1><title>The Slab Cache</title>
89 <sect1><title>User Space Memory Access</title>
90 !Iinclude/asm-i386/uaccess.h
91 !Iarch/i386/lib/usercopy.c
96 <title>The proc filesystem</title>
98 <sect1><title>sysctl interface</title>
104 <title>The Linux VFS</title>
105 <sect1><title>The Directory Cache</title>
107 !Iinclude/linux/dcache.h
109 <sect1><title>Inode Handling</title>
113 <sect1><title>Registration and Superblocks</title>
116 <sect1><title>File Locks</title>
122 <chapter id="netcore">
123 <title>Linux Networking</title>
124 <sect1><title>Socket Buffer Functions</title>
125 !Iinclude/linux/skbuff.h
128 <sect1><title>Socket Filter</title>
133 <chapter id="netdev">
134 <title>Network device support</title>
135 <sect1><title>Driver Support</title>
136 !Edrivers/net/net_init.c
139 <sect1><title>8390 Based Network Cards</title>
142 <sect1><title>Synchronous PPP</title>
143 !Edrivers/net/wan/syncppp.c
147 <chapter id="modload">
148 <title>Module Support</title>
149 <sect1><title>Module Loading</title>
152 <sect1><title>Inter Module support</title>
157 <chapter id="hardware">
158 <title>Hardware Interfaces</title>
159 <sect1><title>Interrupt Handling</title>
160 !Iarch/i386/kernel/irq.c
163 <sect1><title>MTRR Handling</title>
164 !Earch/i386/kernel/mtrr.c
166 <sect1><title>PCI Support Library</title>
169 <sect1><title>PCI Hotplug Support Library</title>
170 !Edrivers/hotplug/pci_hotplug_core.c
171 !Edrivers/hotplug/pci_hotplug_util.c
173 <sect1><title>MCA Architecture</title>
174 <sect2><title>MCA Device Functions</title>
175 !Earch/i386/kernel/mca.c
177 <sect2><title>MCA Bus DMA</title>
178 !Iinclude/asm-i386/mca_dma.h
184 <title>The Device File System</title>
188 <chapter id="pmfuncs">
189 <title>Power Management</title>
193 <chapter id="blkdev">
194 <title>Block Devices</title>
195 !Edrivers/block/ll_rw_blk.c
198 <chapter id="miscdev">
199 <title>Miscellaneous Devices</title>
200 !Edrivers/char/misc.c
203 <chapter id="viddev">
204 <title>Video4Linux</title>
205 !Edrivers/media/video/videodev.c
208 <chapter id="snddev">
209 <title>Sound Devices</title>
210 !Edrivers/sound/sound_core.c
211 !Idrivers/sound/sound_firmware.c
215 <title>USB Devices</title>
219 <chapter id="uart16x50">
220 <title>16x50 UART Driver</title>
221 !Edrivers/char/serial.c
224 <chapter id="z85230">
225 <title>Z85230 Support Library</title>
226 !Edrivers/net/wan/z85230.c
230 <title>Frame Buffer Library</title>
233 The frame buffer drivers depend heavily on four data structures.
234 These structures are declared in include/linux/fb.h. They are
235 fb_info, fb_var_screeninfo, fb_fix_screeninfo and fb_monospecs.
236 The last three can be made available to and from userland.
240 fb_info defines the current state of a particular video card.
241 Inside fb_info, there exists a fb_ops structure which is a
242 collection of needed functions to make fbdev and fbcon work.
243 fb_info is only visible to the kernel.
247 fb_var_screeninfo is used to describe the features of a video card
248 that are user defined. With fb_var_screeninfo, things such as
249 depth and the resolution may be defined.
253 The next structure is fb_fix_screeninfo. This defines the
254 properties of a card that are created when a mode is set and can't
255 be changed otherwise. A good example of this is the start of the
256 frame buffer memory. This "locks" the address of the frame buffer
257 memory, so that it cannot be changed or moved.
261 The last structure is fb_monospecs. In the old API, there was
262 little importance for fb_monospecs. This allowed for forbidden things
263 such as setting a mode of 800x600 on a fix frequency monitor. With
264 the new API, fb_monospecs prevents such things, and if used
265 correctly, can prevent a monitor from being cooked. fb_monospecs
266 will not be useful until kernels 2.5.x.
269 <sect1><title>Frame Buffer Memory</title>
270 !Edrivers/video/fbmem.c
272 <sect1><title>Frame Buffer Console</title>
273 !Edrivers/video/fbcon.c
275 <sect1><title>Frame Buffer Colormap</title>
276 !Edrivers/video/fbcmap.c
278 <sect1><title>Frame Buffer Generic Functions</title>
279 !Edrivers/video/fbgen.c
281 <sect1><title>Frame Buffer Video Mode Database</title>
282 !Idrivers/video/modedb.c
283 !Edrivers/video/modedb.c
285 <sect1><title>Frame Buffer Macintosh Video Mode Database</title>
286 !Idrivers/video/macmodes.c
288 <sect1><title>Frame Buffer Fonts</title>
289 !Idrivers/video/fonts.c