- Understanding the Linux kernel – Anatomy of the Linux kernel
- Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel¶
- Docs at the Linux Kernel tree¶
- Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel¶
- Docs at the Linux Kernel tree¶
- On-line docs¶
- Published books¶
Understanding the Linux kernel – Anatomy of the Linux kernel
This article offers the history and architectural decomposition of the Linux kernel. This article just scratched the surface of the Linux kernel architecture and its features and capabilities to get overall idea about the Linux kernel. From the article:
The Linux kernel is the core of a large and complex operating system, and while it’s huge, it is well organized in terms of subsystems and layers. In this article, you explore the general structure of the Linux kernel and get to know its major subsystems and core interfaces. Where possible, you get links to other IBM articles to help you dig deeper.
Given that the goal of this article is to introduce you to the Linux kernel and explore its architecture and major components, let’s start with a short tour of Linux kernel history, then look at the Linux kernel architecture from 30,000 feet, and, finally, examine its major subsystems. The Linux kernel is over six million lines of code, so this introduction is not exhaustive. Use the pointers to more content to dig in further.
While Linux is arguably the most popular open source operating system, its history is actually quite short considering the timeline of operating systems. In the early days of computing, programmers developed on the bare hardware in the hardware’s language. The lack of an operating system meant that only one application (and one user) could use the large and expensive device at a time. Early operating systems were developed in the 1950s to provide a simpler development experience. Examples include the General Motors Operating System (GMOS) developed for the IBM 701 and the FORTRAN Monitor System (FMS) developed by North American Aviation for the IBM 709.
Источник
Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel¶
The need for a document like this one became apparent in the linux-kernel mailing list as the same questions, asking for pointers to information, appeared again and again.
Fortunately, as more and more people get to GNU/Linux, more and more get interested in the Kernel. But reading the sources is not always enough. It is easy to understand the code, but miss the concepts, the philosophy and design decisions behind this code.
Unfortunately, not many documents are available for beginners to start. And, even if they exist, there was no “well-known” place which kept track of them. These lines try to cover this lack. All documents available on line known by the author are listed, while some reference books are also mentioned.
PLEASE, if you know any paper not listed here or write a new document, send me an e-mail, and I’ll include a reference to it here. Any corrections, ideas or comments are also welcomed.
The papers that follow are listed in no particular order. All are cataloged with the following fields: the document’s “Title”, the “Author”/s, the “URL” where they can be found, some “Keywords” helpful when searching for specific topics, and a brief “Description” of the Document.
The documents on each section of this document are ordered by its published date, from the newest to the oldest.
Docs at the Linux Kernel tree¶
The Sphinx books should be built with make
Источник
Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel¶
The need for a document like this one became apparent in the linux-kernel mailing list as the same questions, asking for pointers to information, appeared again and again.
Fortunately, as more and more people get to GNU/Linux, more and more get interested in the Kernel. But reading the sources is not always enough. It is easy to understand the code, but miss the concepts, the philosophy and design decisions behind this code.
Unfortunately, not many documents are available for beginners to start. And, even if they exist, there was no “well-known” place which kept track of them. These lines try to cover this lack. All documents available on line known by the author are listed, while some reference books are also mentioned.
PLEASE, if you know any paper not listed here or write a new document, send me an e-mail, and I’ll include a reference to it here. Any corrections, ideas or comments are also welcomed.
The papers that follow are listed in no particular order. All are cataloged with the following fields: the document’s “Title”, the “Author”/s, the “URL” where they can be found, some “Keywords” helpful when searching for specific topics, and a brief “Description” of the Document.
The documents on each section of this document are ordered by its published date, from the newest to the oldest.
Docs at the Linux Kernel tree¶
The Sphinx books should be built with make
Name: linux/Documentation
text files, Sphinx.
Documentation that comes with the kernel sources, inside the Documentation directory. Some pages from this document (including this document itself) have been moved there, and might be more up to date than the web version.
On-line docs¶
Title: Linux Kernel Mailing List Glossary
glossary, terms, linux-kernel.
From the introduction: “This glossary is intended as a brief description of some of the acronyms and terms you may hear during discussion of the Linux kernel”.
Title: Tracing the Way of Data in a TCP Connection through the Linux Kernel
Linux Kernel Networking, TCP, tracing, ftrace
A seminar paper explaining ftrace and how to use it for understanding linux kernel internals, illustrated at tracing the way of a TCP packet through the kernel.
This short paper outlines the usage of ftrace a tracing framework as a tool to understand a running Linux system. Having obtained a trace-log a kernel hacker can read and understand source code more determined and with context. In a detailed example this approach is demonstrated in tracing and the way of data in a TCP Connection through the kernel. Finally this trace-log is used as base for more a exact conceptual exploration and description of the Linux TCP/IP implementation.
Title: On submitting kernel Patches
patches, review process, types of submissions, basic rules, case studies
This paper gives several experience values on what types of patches there are and how likely they get merged.
[…]. This paper examines some common problems for submitting larger changes and some strategies to avoid problems.
Title: Linux Device Drivers, Third Edition
Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman
A 600-page book covering the (2.6.10) driver programming API and kernel hacking in general. Available under the Creative Commons Attribution-ShareAlike 2.0 license.
Title: Writing an ALSA Driver
ALSA, sound, soundcard, driver, lowlevel, hardware.
Advanced Linux Sound Architecture for developers, both at kernel and user-level sides. ALSA is the Linux kernel sound architecture in the 2.6 kernel version.
Title: Linux PCMCIA Programmer’s Guide
“This document describes how to write kernel device drivers for the Linux PCMCIA Card Services interface. It also describes how to write user-mode utilities for communicating with Card Services.
Title: The Linux Kernel Module Programming Guide
Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang.
modules, GPL book, /proc, ioctls, system calls, interrupt handlers .
A very nice GPL book on the topic of modules programming. Lots of examples. Currently the new version is being actively maintained at https://github.com/sysprog21/lkmpg.
Title: Global spinlock list and usage
This is an attempt to document both the existence and usage of the spinlocks in the Linux 2.4.5 kernel. Comprehensive list of spinlocks showing when they are used, which functions access them, how each lock is acquired, under what conditions it is held, whether interrupts can occur or not while it is held…
Title: A Linux vm README
virtual memory, mm, pgd, vma, page, page flags, page cache, swap cache, kswapd.
Telegraphic, short descriptions and definitions relating the Linux virtual memory implementation.
Title: Video4linux Drivers, Part 1: Video-Capture Device
video4linux, driver, video capture, capture devices, camera driver.
The title says it all.
Title: Video4linux Drivers, Part 2: Video-capture Devices
video4linux, driver, video capture, capture devices, camera driver, control, query capabilities, capability, facility.
The title says it all.
Title: Linux IP Networking. A Guide to the Implementation and Modification of the Linux Protocol Stack.
network, networking, protocol, IP, UDP, TCP, connection, socket, receiving, transmitting, forwarding, routing, packets, modules, /proc, sk_buff, FIB, tags.
Excellent paper devoted to the Linux IP Networking, explaining anything from the kernel’s to the user space configuration tools’ code. Very good to get a general overview of the kernel networking implementation and understand all steps packets follow from the time they are received at the network device till they are delivered to applications. The studied kernel code is from 2.2.14 version. Provides code for a working packet dropper example.
Title: How To Make Sure Your Driver Will Work On The Power Macintosh
Mac, Power Macintosh, porting, drivers, compatibility.
The title says it all.
Title: An Introduction to SCSI Drivers
SCSI, device, driver.
The title says it all.
Title: Advanced SCSI Drivers And Other Tales
SCSI, device, driver, advanced.
The title says it all.
Title: Writing Linux Mouse Drivers
mouse, driver, gpm.
The title says it all.
Title: More on Mouse Drivers
mouse, driver, gpm, races, asynchronous I/O.
The title still says it all.
Title: Writing Video4linux Radio Driver
video4linux, driver, radio, radio devices.
The title says it all.
Title: I/O Event Handling Under Linux
IO, I/O, select(2), poll(2), FDs, aio_read(2), readiness event queues.
From the Introduction: “I/O Event handling is about how your Operating System allows you to manage a large number of open files (file descriptors in UNIX/POSIX, or FDs) in your application. You want the OS to notify you when FDs become active (have data ready to be read or are ready for writing). Ideally you want a mechanism that is scalable. This means a large number of inactive FDs cost very little in memory and CPU time to manage”.
Title: (nearly) Complete Linux Loadable Kernel Modules. The definitive guide for hackers, virus coders and system administrators.
syscalls, intercept, hide, abuse, symbol table.
Interesting paper on how to abuse the Linux kernel in order to intercept and modify syscalls, make files/directories/processes invisible, become root, hijack ttys, write kernel modules based virus… and solutions for admins to avoid all those abuses.
For 2.0.x kernels. Gives guidances to port it to 2.2.x kernels.
Name: Linux Virtual File System
slides, VFS, inode, superblock, dentry, dcache.
Set of slides, presumably from a presentation on the Linux VFS layer. Covers version 2.1.x, with dentries and the dcache.
Title: The Venus kernel interface
coda, filesystem, venus, cache manager.
“This document describes the communication between Venus and kernel level file system code needed for the operation of the Coda filesystem. This version document is meant to describe the current interface (version 1.0) as well as improvements we envisage”.
Title: Design and Implementation of the Second Extended Filesystem
Rémy Card, Theodore Ts’o, Stephen Tweedie.
ext2, linux fs history, inode, directory, link, devices, VFS, physical structure, performance, benchmarks, ext2fs library, ext2fs tools, e2fsck.
Paper written by three of the top ext2 hackers. Covers Linux filesystems history, ext2 motivation, ext2 features, design, physical structure on disk, performance, benchmarks, e2fsck’s passes description… A must read!
This paper was first published in the Proceedings of the First Dutch International Symposium on Linux, ISBN 90-367-0385-9.
Title: The Linux RAID-1, 4, 5 Code
Ingo Molnar, Gadi Oxman and Miguel de Icaza.
Linux Journal Kernel Korner article.
A description of the implementation of the RAID-1, RAID-4 and RAID-5 personalities of the MD device driver in the Linux kernel, providing users with high performance and reliable, secondary-storage capability using software.
Title: Linux Kernel Hackers’ Guide
Michael K. Johnson.
device drivers, files, VFS, kernel interface, character vs block devices, hardware interrupts, scsi, DMA, access to user memory, memory allocation, timers.
A guide designed to help you get up to speed on the concepts that are not intuitively obvious, and to document the internal structures of Linux.
Title: Dynamic Kernels: Modularized Device Drivers
device driver, module, loading/unloading modules, allocating resources.
Linux Journal Kernel Korner article.
This is the first of a series of four articles co-authored by Alessandro Rubini and Georg Zezchwitz which present a practical approach to writing Linux device drivers as kernel loadable modules. This installment presents an introduction to the topic, preparing the reader to understand next month’s installment.
Title: Dynamic Kernels: Discovery
character driver, init_module, clean_up module, autodetection, mayor number, minor number, file operations, open(), close().
Linux Journal Kernel Korner article.
This article, the second of four, introduces part of the actual code to create custom module implementing a character device driver. It describes the code for module initialization and cleanup, as well as the open() and close() system calls.
Title: The Devil’s in the Details
Georg v. Zezschwitz and Alessandro Rubini.
read(), write(), select(), ioctl(), blocking/non blocking mode, interrupt handler.
Linux Journal Kernel Korner article.
This article, the third of four on writing character device drivers, introduces concepts of reading, writing, and using ioctl-calls.
Title: Dissecting Interrupts and Browsing DMA
Alessandro Rubini and Georg v. Zezschwitz.
interrupts, irqs, DMA, bottom halves, task queues.
Linux Journal Kernel Korner article.
This is the fourth in a series of articles about writing character device drivers as loadable kernel modules. This month, we further investigate the field of interrupt handling. Though it is conceptually simple, practical limitations and constraints make this an вЂвЂ™interesting’’ part of device driver writing, and several different facilities have been provided for different situations. We also investigate the complex topic of DMA.
Title: Device Drivers Concluded
Georg v. Zezschwitz.
address spaces, pages, pagination, page management, demand loading, swapping, memory protection, memory mapping, mmap, virtual memory areas (VMAs), vremap, PCI.
Finally, the above turned out into a five articles series. This latest one’s introduction reads: “This is the last of five articles about character device drivers. In this final section, Georg deals with memory mapping devices, beginning with an overall description of the Linux memory management concepts”.
Title: Network Buffers And Memory Management
sk_buffs, network devices, protocol/link layer variables, network devices flags, transmit, receive, configuration, multicast.
Linux Journal Kernel Korner.
Writing a network device driver for Linux is fundamentally simple—most of the complexity (other than talking to the hardware) involves managing network packets in memory.
Title: Analysis of the Ext2fs structure
ext2, filesystem, ext2fs.
Description of ext2’s blocks, directories, inodes, bitmaps, invariants…
Published books¶
Title: Linux Treiber entwickeln
JГјrgen Quade, Eva-Katharina Kunst
Oct 2015 (4th edition)
German. The third edition from 2011 is much cheaper and still quite up-to-date.
Title: Linux Kernel Networking: Implementation and Theory
December 22, 2013
Title: Embedded Linux Primer: A practical Real-World Approach, 2nd Edition
Title: Linux Kernel Development, 3rd Edition
Title: Essential Linux Device Drivers
Источник