1.. _kernel_docs:
2
3Index of Further Kernel Documentation
4=====================================
5
6The need for a document like this one became apparent in the
7linux-kernel mailing list as the same questions, asking for pointers
8to information, appeared again and again.
9
10Fortunately, as more and more people get to GNU/Linux, more and more
11get interested in the Kernel. But reading the sources is not always
12enough. It is easy to understand the code, but miss the concepts, the
13philosophy and design decisions behind this code.
14
15Unfortunately, not many documents are available for beginners to
16start. And, even if they exist, there was no "well-known" place which
17kept track of them. These lines try to cover this lack.
18
19PLEASE, if you know any paper not listed here or write a new document,
20include a reference to it here, following the kernel's patch submission
21process. Any corrections, ideas or comments are also welcome.
22
23All documents are cataloged with the following fields: the document's
24"Title", the "Author"/s, the "URL" where they can be found, some
25"Keywords" helpful when searching for specific topics, and a brief
26"Description" of the Document.
27
28.. note::
29
30   The documents on each section of this document are ordered by its
31   published date, from the newest to the oldest.
32
33Docs at the Linux Kernel tree
34-----------------------------
35
36The Sphinx books should be built with ``make {htmldocs | pdfdocs | epubdocs}``.
37
38    * Name: **linux/Documentation**
39
40      :Author: Many.
41      :Location: Documentation/
42      :Keywords: text files, Sphinx.
43      :Description: Documentation that comes with the kernel sources,
44        inside the Documentation directory. Some pages from this document
45        (including this document itself) have been moved there, and might
46        be more up to date than the web version.
47
48On-line docs
49------------
50
51    * Title: **Linux Kernel Mailing List Glossary**
52
53      :Author: various
54      :URL: https://kernelnewbies.org/KernelGlossary
55      :Date: rolling version
56      :Keywords: glossary, terms, linux-kernel.
57      :Description: From the introduction: "This glossary is intended as
58        a brief description of some of the acronyms and terms you may hear
59        during discussion of the Linux kernel".
60
61    * Title: **Tracing the Way of Data in a TCP Connection through the Linux Kernel**
62
63      :Author: Richard Sailer
64      :URL: https://archive.org/details/linux_kernel_data_flow_short_paper
65      :Date: 2016
66      :Keywords: Linux Kernel Networking, TCP, tracing, ftrace
67      :Description: A seminar paper explaining ftrace and how to use it for
68        understanding linux kernel internals,
69        illustrated at tracing the way of a TCP packet through the kernel.
70      :Abstract: *This short paper outlines the usage of ftrace a tracing framework
71        as a tool to understand a running Linux system.
72        Having obtained a trace-log a kernel hacker can read and understand
73        source code more determined and with context.
74        In a detailed example this approach is demonstrated in tracing
75        and the way of data in a TCP Connection through the kernel.
76        Finally this trace-log is used as base for more a exact conceptual
77        exploration and description of the Linux TCP/IP implementation.*
78
79    * Title: **The Linux Kernel Module Programming Guide**
80
81      :Author: Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram,
82        Jim Huang.
83      :URL: https://sysprog21.github.io/lkmpg/
84      :Date: 2021
85      :Keywords: modules, GPL book, /proc, ioctls, system calls,
86        interrupt handlers .
87      :Description: A very nice GPL book on the topic of modules
88        programming. Lots of examples. Currently the new version is being
89        actively maintained at https://github.com/sysprog21/lkmpg.
90
91    * Title: **On submitting kernel Patches**
92
93      :Author: Andi Kleen
94      :URL: http://halobates.de/on-submitting-kernel-patches.pdf
95      :Date: 2008
96      :Keywords: patches, review process, types of submissions, basic rules, case studies
97      :Description: This paper gives several experience values on what types of patches
98        there are and how likely they get merged.
99      :Abstract:
100        [...]. This paper examines some common problems for
101        submitting larger changes and some strategies to avoid problems.
102
103    * Title: **Linux Device Drivers, Third Edition**
104
105      :Author: Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman
106      :URL: https://lwn.net/Kernel/LDD3/
107      :Date: 2005
108      :Description: A 600-page book covering the (2.6.10) driver
109        programming API and kernel hacking in general.  Available under the
110        Creative Commons Attribution-ShareAlike 2.0 license.
111      :note: You can also :ref:`purchase a copy from O'Reilly or elsewhere  <ldd3_published>`.
112
113    * Title: **Writing an ALSA Driver**
114
115      :Author: Takashi Iwai <[email protected]>
116      :URL: https://www.kernel.org/doc/html/latest/sound/kernel-api/writing-an-alsa-driver.html
117      :Date: 2005
118      :Keywords: ALSA, sound, soundcard, driver, lowlevel, hardware.
119      :Description: Advanced Linux Sound Architecture for developers,
120        both at kernel and user-level sides. ALSA is the Linux kernel
121        sound architecture in the 2.6 kernel version.
122
123    * Title: **Linux PCMCIA Programmer's Guide**
124
125      :Author: David Hinds.
126      :URL: http://pcmcia-cs.sourceforge.net/ftp/doc/PCMCIA-PROG.html
127      :Date: 2003
128      :Keywords: PCMCIA.
129      :Description: "This document describes how to write kernel device
130        drivers for the Linux PCMCIA Card Services interface. It also
131        describes how to write user-mode utilities for communicating with
132        Card Services.
133
134    * Title: **How NOT to write kernel drivers**
135
136      :Author: Arjan van de Ven.
137      :URL: https://landley.net/kdocs/ols/2002/ols2002-pages-545-555.pdf
138      :Date: 2002
139      :Keywords: driver.
140      :Description: Programming bugs and Do-nots in kernel driver development
141      :Abstract: *Quit a few tutorials, articles and books give an introduction
142        on how to write Linux kernel drivers. Unfortunately the things one
143        should NOT do in Linux kernel code is either only a minor appendix
144        or, more commonly, completely absent. This paper tries to briefly touch
145        the areas in which the most common and serious bugs and do-nots are
146        encountered.*
147
148    * Title: **Global spinlock list and usage**
149
150      :Author: Rick Lindsley.
151      :URL: http://lse.sourceforge.net/lockhier/global-spin-lock
152      :Date: 2001
153      :Keywords: spinlock.
154      :Description: This is an attempt to document both the existence and
155        usage of the spinlocks in the Linux 2.4.5 kernel. Comprehensive
156        list of spinlocks showing when they are used, which functions
157        access them, how each lock is acquired, under what conditions it
158        is held, whether interrupts can occur or not while it is held...
159
160    * Title: **A Linux vm README**
161
162      :Author: Kanoj Sarcar.
163      :URL: http://kos.enix.org/pub/linux-vmm.html
164      :Date: 2001
165      :Keywords: virtual memory, mm, pgd, vma, page, page flags, page
166        cache, swap cache, kswapd.
167      :Description: Telegraphic, short descriptions and definitions
168        relating the Linux virtual memory implementation.
169
170    * Title: **Video4linux Drivers, Part 1: Video-Capture Device**
171
172      :Author: Alan Cox.
173      :URL: http://www.linux-mag.com/id/406
174      :Date: 2000
175      :Keywords: video4linux, driver, video capture, capture devices,
176        camera driver.
177      :Description: The title says it all.
178
179    * Title: **Video4linux Drivers, Part 2: Video-capture Devices**
180
181      :Author: Alan Cox.
182      :URL: http://www.linux-mag.com/id/429
183      :Date: 2000
184      :Keywords: video4linux, driver, video capture, capture devices,
185        camera driver, control, query capabilities, capability, facility.
186      :Description: The title says it all.
187
188    * Title: **Linux IP Networking. A Guide to the Implementation and Modification of the Linux Protocol Stack.**
189
190      :Author: Glenn Herrin.
191      :URL: http://www.cs.unh.edu/cnrg/gherrin
192      :Date: 2000
193      :Keywords: network, networking, protocol, IP, UDP, TCP, connection,
194        socket, receiving, transmitting, forwarding, routing, packets,
195        modules, /proc, sk_buff, FIB, tags.
196      :Description: Excellent paper devoted to the Linux IP Networking,
197        explaining anything from the kernel's to the user space
198        configuration tools' code. Very good to get a general overview of
199        the kernel networking implementation and understand all steps
200        packets follow from the time they are received at the network
201        device till they are delivered to applications. The studied kernel
202        code is from 2.2.14 version. Provides code for a working packet
203        dropper example.
204
205    * Title: **How To Make Sure Your Driver Will Work On The Power Macintosh**
206
207      :Author: Paul Mackerras.
208      :URL: http://www.linux-mag.com/id/261
209      :Date: 1999
210      :Keywords: Mac, Power Macintosh, porting, drivers, compatibility.
211      :Description: The title says it all.
212
213    * Title: **An Introduction to SCSI Drivers**
214
215      :Author: Alan Cox.
216      :URL: http://www.linux-mag.com/id/284
217      :Date: 1999
218      :Keywords: SCSI, device, driver.
219      :Description: The title says it all.
220
221    * Title: **Advanced SCSI Drivers And Other Tales**
222
223      :Author: Alan Cox.
224      :URL: http://www.linux-mag.com/id/307
225      :Date: 1999
226      :Keywords: SCSI, device, driver, advanced.
227      :Description: The title says it all.
228
229    * Title: **Writing Linux Mouse Drivers**
230
231      :Author: Alan Cox.
232      :URL: http://www.linux-mag.com/id/330
233      :Date: 1999
234      :Keywords: mouse, driver, gpm.
235      :Description: The title says it all.
236
237    * Title: **More on Mouse Drivers**
238
239      :Author: Alan Cox.
240      :URL: http://www.linux-mag.com/id/356
241      :Date: 1999
242      :Keywords: mouse, driver, gpm, races, asynchronous I/O.
243      :Description: The title still says it all.
244
245    * Title: **Writing Video4linux Radio Driver**
246
247      :Author: Alan Cox.
248      :URL: http://www.linux-mag.com/id/381
249      :Date: 1999
250      :Keywords: video4linux, driver, radio, radio devices.
251      :Description: The title says it all.
252
253    * Title: **I/O Event Handling Under Linux**
254
255      :Author: Richard Gooch.
256      :URL: https://web.mit.edu/~yandros/doc/io-events.html
257      :Date: 1999
258      :Keywords: IO, I/O, select(2), poll(2), FDs, aio_read(2), readiness
259        event queues.
260      :Description: From the Introduction: "I/O Event handling is about
261        how your Operating System allows you to manage a large number of
262        open files (file descriptors in UNIX/POSIX, or FDs) in your
263        application. You want the OS to notify you when FDs become active
264        (have data ready to be read or are ready for writing). Ideally you
265        want a mechanism that is scalable. This means a large number of
266        inactive FDs cost very little in memory and CPU time to manage".
267
268    * Title: **(nearly) Complete Linux Loadable Kernel Modules. The definitive guide for hackers, virus coders and system administrators.**
269
270      :Author: pragmatic/THC.
271      :URL: http://packetstormsecurity.org/docs/hack/LKM_HACKING.html
272      :Date: 1999
273      :Keywords: syscalls, intercept, hide, abuse, symbol table.
274      :Description: Interesting paper on how to abuse the Linux kernel in
275        order to intercept and modify syscalls, make
276        files/directories/processes invisible, become root, hijack ttys,
277        write kernel modules based virus... and solutions for admins to
278        avoid all those abuses.
279      :Notes: For 2.0.x kernels. Gives guidances to port it to 2.2.x
280        kernels.
281
282    * Name: **Linux Virtual File System**
283
284      :Author: Peter J. Braam.
285      :URL: http://www.coda.cs.cmu.edu/doc/talks/linuxvfs/
286      :Date: 1998
287      :Keywords: slides, VFS, inode, superblock, dentry, dcache.
288      :Description: Set of slides, presumably from a presentation on the
289        Linux VFS layer. Covers version 2.1.x, with dentries and the
290        dcache.
291
292    * Title: **The Venus kernel interface**
293
294      :Author: Peter J. Braam.
295      :URL: http://www.coda.cs.cmu.edu/doc/html/kernel-venus-protocol.html
296      :Date: 1998
297      :Keywords: coda, filesystem, venus, cache manager.
298      :Description: "This document describes the communication between
299        Venus and kernel level file system code needed for the operation
300        of the Coda filesystem. This version document is meant to describe
301        the current interface (version 1.0) as well as improvements we
302        envisage".
303
304    * Title: **Design and Implementation of the Second Extended Filesystem**
305
306      :Author: Rémy Card, Theodore Ts'o, Stephen Tweedie.
307      :URL: https://web.mit.edu/tytso/www/linux/ext2intro.html
308      :Date: 1998
309      :Keywords: ext2, linux fs history, inode, directory, link, devices,
310        VFS, physical structure, performance, benchmarks, ext2fs library,
311        ext2fs tools, e2fsck.
312      :Description: Paper written by three of the top ext2 hackers.
313        Covers Linux filesystems history, ext2 motivation, ext2 features,
314        design, physical structure on disk, performance, benchmarks,
315        e2fsck's passes description... A must read!
316      :Notes: This paper was first published in the Proceedings of the
317        First Dutch International Symposium on Linux, ISBN 90-367-0385-9.
318
319    * Title: **The Linux RAID-1, 4, 5 Code**
320
321      :Author: Ingo Molnar, Gadi Oxman and Miguel de Icaza.
322      :URL: http://www.linuxjournal.com/article.php?sid=2391
323      :Date: 1997
324      :Keywords: RAID, MD driver.
325      :Description: Linux Journal Kernel Korner article.
326      :Abstract: *A description of the implementation of the RAID-1,
327        RAID-4 and RAID-5 personalities of the MD device driver in the
328        Linux kernel, providing users with high performance and reliable,
329        secondary-storage capability using software*.
330
331    * Title: **Linux Kernel Hackers' Guide**
332
333      :Author: Michael K. Johnson.
334      :URL: https://www.tldp.org/LDP/khg/HyperNews/get/khg.html
335      :Date: 1997
336      :Keywords: device drivers, files, VFS, kernel interface, character vs
337        block devices, hardware interrupts, scsi, DMA, access to user memory,
338        memory allocation, timers.
339      :Description: A guide designed to help you get up to speed on the
340        concepts that are not intuitively obvious, and to document the internal
341        structures of Linux.
342
343    * Title: **Dynamic Kernels: Modularized Device Drivers**
344
345      :Author: Alessandro Rubini.
346      :URL: http://www.linuxjournal.com/article.php?sid=1219
347      :Date: 1996
348      :Keywords: device driver, module, loading/unloading modules,
349        allocating resources.
350      :Description: Linux Journal Kernel Korner article.
351      :Abstract: *This is the first of a series of four articles
352        co-authored by Alessandro Rubini and Georg Zezchwitz which present
353        a practical approach to writing Linux device drivers as kernel
354        loadable modules. This installment presents an introduction to the
355        topic, preparing the reader to understand next month's
356        installment*.
357
358    * Title: **Dynamic Kernels: Discovery**
359
360      :Author: Alessandro Rubini.
361      :URL: http://www.linuxjournal.com/article.php?sid=1220
362      :Date: 1996
363      :Keywords: character driver, init_module, clean_up module,
364        autodetection, mayor number, minor number, file operations,
365        open(), close().
366      :Description: Linux Journal Kernel Korner article.
367      :Abstract: *This article, the second of four, introduces part of
368        the actual code to create custom module implementing a character
369        device driver. It describes the code for module initialization and
370        cleanup, as well as the open() and close() system calls*.
371
372    * Title: **The Devil's in the Details**
373
374      :Author: Georg v. Zezschwitz and Alessandro Rubini.
375      :URL: http://www.linuxjournal.com/article.php?sid=1221
376      :Date: 1996
377      :Keywords: read(), write(), select(), ioctl(), blocking/non
378        blocking mode, interrupt handler.
379      :Description: Linux Journal Kernel Korner article.
380      :Abstract: *This article, the third of four on writing character
381        device drivers, introduces concepts of reading, writing, and using
382        ioctl-calls*.
383
384    * Title: **Dissecting Interrupts and Browsing DMA**
385
386      :Author: Alessandro Rubini and Georg v. Zezschwitz.
387      :URL: https://www.linuxjournal.com/article.php?sid=1222
388      :Date: 1996
389      :Keywords: interrupts, irqs, DMA, bottom halves, task queues.
390      :Description: Linux Journal Kernel Korner article.
391      :Abstract: *This is the fourth in a series of articles about
392        writing character device drivers as loadable kernel modules. This
393        month, we further investigate the field of interrupt handling.
394        Though it is conceptually simple, practical limitations and
395        constraints make this an ''interesting'' part of device driver
396        writing, and several different facilities have been provided for
397        different situations. We also investigate the complex topic of
398        DMA*.
399
400    * Title: **Device Drivers Concluded**
401
402      :Author: Georg v. Zezschwitz.
403      :URL: https://www.linuxjournal.com/article.php?sid=1287
404      :Date: 1996
405      :Keywords: address spaces, pages, pagination, page management,
406        demand loading, swapping, memory protection, memory mapping, mmap,
407        virtual memory areas (VMAs), vremap, PCI.
408      :Description: Finally, the above turned out into a five articles
409        series. This latest one's introduction reads: "This is the last of
410        five articles about character device drivers. In this final
411        section, Georg deals with memory mapping devices, beginning with
412        an overall description of the Linux memory management concepts".
413
414    * Title: **Network Buffers And Memory Management**
415
416      :Author: Alan Cox.
417      :URL: https://www.linuxjournal.com/article.php?sid=1312
418      :Date: 1996
419      :Keywords: sk_buffs, network devices, protocol/link layer
420        variables, network devices flags, transmit, receive,
421        configuration, multicast.
422      :Description: Linux Journal Kernel Korner.
423      :Abstract: *Writing a network device driver for Linux is fundamentally
424        simple---most of the complexity (other than talking to the
425        hardware) involves managing network packets in memory*.
426
427    * Title: **Analysis of the Ext2fs structure**
428
429      :Author: Louis-Dominique Dubeau.
430      :URL: https://teaching.csse.uwa.edu.au/units/CITS2002/fs-ext2/
431      :Date: 1994
432      :Keywords: ext2, filesystem, ext2fs.
433      :Description: Description of ext2's blocks, directories, inodes,
434        bitmaps, invariants...
435
436Published books
437---------------
438
439    * Title: **Linux Treiber entwickeln**
440
441      :Author: Jürgen Quade, Eva-Katharina Kunst
442      :Publisher: dpunkt.verlag
443      :Date: Oct 2015 (4th edition)
444      :Pages: 688
445      :ISBN: 978-3-86490-288-8
446      :Note: German. The third edition from 2011 is
447         much cheaper and still quite up-to-date.
448
449    * Title: **Linux Kernel Networking: Implementation and Theory**
450
451      :Author: Rami Rosen
452      :Publisher: Apress
453      :Date: December 22, 2013
454      :Pages: 648
455      :ISBN: 978-1430261964
456
457    * Title: **Embedded Linux Primer: A practical Real-World Approach, 2nd Edition**
458
459      :Author: Christopher Hallinan
460      :Publisher: Pearson
461      :Date: November, 2010
462      :Pages: 656
463      :ISBN: 978-0137017836
464
465    * Title: **Linux Kernel Development, 3rd Edition**
466
467      :Author: Robert Love
468      :Publisher: Addison-Wesley
469      :Date: July, 2010
470      :Pages: 440
471      :ISBN: 978-0672329463
472
473    * Title: **Essential Linux Device Drivers**
474
475      :Author: Sreekrishnan Venkateswaran
476      :Published: Prentice Hall
477      :Date: April, 2008
478      :Pages: 744
479      :ISBN: 978-0132396554
480
481.. _ldd3_published:
482
483    * Title: **Linux Device Drivers, 3rd Edition**
484
485      :Authors: Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman
486      :Publisher: O'Reilly & Associates
487      :Date: 2005
488      :Pages: 636
489      :ISBN: 0-596-00590-3
490      :Notes: Further information in
491        http://www.oreilly.com/catalog/linuxdrive3/
492        PDF format, URL: https://lwn.net/Kernel/LDD3/
493
494    * Title: **Linux Kernel Internals**
495
496      :Author: Michael Beck
497      :Publisher: Addison-Wesley
498      :Date: 1997
499      :ISBN: 0-201-33143-8 (second edition)
500
501    * Title: **Programmation Linux 2.0 API systeme et fonctionnement du noyau**
502
503      :Author: Remy Card, Eric Dumas, Franck Mevel
504      :Publisher: Eyrolles
505      :Date: 1997
506      :Pages: 520
507      :ISBN: 2-212-08932-5
508      :Notes: French
509
510    * Title: **The Design and Implementation of the 4.4 BSD UNIX Operating System**
511
512      :Author: Marshall Kirk McKusick, Keith Bostic, Michael J. Karels,
513        John S. Quarterman
514      :Publisher: Addison-Wesley
515      :Date: 1996
516      :ISBN: 0-201-54979-4
517
518    * Title: **Unix internals -- the new frontiers**
519
520      :Author: Uresh Vahalia
521      :Publisher: Prentice Hall
522      :Date: 1996
523      :Pages: 600
524      :ISBN: 0-13-101908-2
525
526    * Title: **Programming for the real world - POSIX.4**
527
528      :Author: Bill O. Gallmeister
529      :Publisher: O'Reilly & Associates, Inc
530      :Date: 1995
531      :Pages: 552
532      :ISBN: I-56592-074-0
533      :Notes: Though not being directly about Linux, Linux aims to be
534        POSIX. Good reference.
535
536    * Title:  **UNIX  Systems  for  Modern Architectures: Symmetric Multiprocessing and Caching for Kernel Programmers**
537
538      :Author: Curt Schimmel
539      :Publisher: Addison Wesley
540      :Date: June, 1994
541      :Pages: 432
542      :ISBN: 0-201-63338-8
543
544    * Title: **The Design and Implementation of the 4.3 BSD UNIX Operating System**
545
546      :Author: Samuel J. Leffler, Marshall Kirk McKusick, Michael J
547        Karels, John S. Quarterman
548      :Publisher: Addison-Wesley
549      :Date: 1989 (reprinted with corrections on October, 1990)
550      :ISBN: 0-201-06196-1
551
552    * Title: **The Design of the UNIX Operating System**
553
554      :Author: Maurice J. Bach
555      :Publisher: Prentice Hall
556      :Date: 1986
557      :Pages: 471
558      :ISBN: 0-13-201757-1
559
560Miscellaneous
561-------------
562
563    * Name: **Cross-Referencing Linux**
564
565      :URL: https://elixir.bootlin.com/
566      :Keywords: Browsing source code.
567      :Description: Another web-based Linux kernel source code browser.
568        Lots of cross references to variables and functions. You can see
569        where they are defined and where they are used.
570
571    * Name: **Linux Weekly News**
572
573      :URL: https://lwn.net
574      :Keywords: latest kernel news.
575      :Description: The title says it all. There's a fixed kernel section
576        summarizing developers' work, bug fixes, new features and versions
577        produced during the week. Published every Thursday.
578
579    * Name: **The home page of Linux-MM**
580
581      :Author: The Linux-MM team.
582      :URL: https://linux-mm.org/
583      :Keywords: memory management, Linux-MM, mm patches, TODO, docs,
584        mailing list.
585      :Description: Site devoted to Linux Memory Management development.
586        Memory related patches, HOWTOs, links, mm developers... Don't miss
587        it if you are interested in memory management development!
588
589    * Name: **Kernel Newbies IRC Channel and Website**
590
591      :URL: https://www.kernelnewbies.org
592      :Keywords: IRC, newbies, channel, asking doubts.
593      :Description: #kernelnewbies on irc.oftc.net.
594        #kernelnewbies is an IRC network dedicated to the 'newbie'
595        kernel hacker. The audience mostly consists of people who are
596        learning about the kernel, working on kernel projects or
597        professional kernel hackers that want to help less seasoned kernel
598        people.
599        #kernelnewbies is on the OFTC IRC Network.
600        Try irc.oftc.net as your server and then /join #kernelnewbies.
601        The kernelnewbies website also hosts articles, documents, FAQs...
602
603    * Name: **linux-kernel mailing list archives and search engines**
604
605      :URL: http://vger.kernel.org/vger-lists.html
606      :URL: http://www.uwsg.indiana.edu/hypermail/linux/kernel/index.html
607      :URL: http://groups.google.com/group/mlist.linux.kernel
608      :Keywords: linux-kernel, archives, search.
609      :Description: Some of the linux-kernel mailing list archivers. If
610        you have a better/another one, please let me know.
611
612-------
613
614This document was originally based on:
615
616 https://www.dit.upm.es/~jmseyas/linux/kernel/hackers-docs.html
617
618and written by Juan-Mariano de Goyeneche
619