include and arch

In a quick overview of the kernel source code, there’s little to say about headers and architecture-specific code. Header files have been introduced all over the book, so their role (and the separation between include/linux and include/asm) should already be clear.

Architecture-specific code, on the other hand, has never been introduced in detail, but it doesn’t easily lend itself to discussion. Inside each architecture’s directory you usually find a file hierarchy similar to the top-level one (i.e., there are mm and kernel subdirectories), but also boot-related code and assembly source files. The most important assembly file within each supported architecture is called kernel/entry.S; it’s the back end of the system call mechanism (i.e., the place where user processes enter kernel mode). Besides that, however, there’s little in common across the various architectures, and describing them all would make no sense.

Get Linux Device Drivers, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.