Professional Linux Kernel Architecture
Format: PDF / Kindle (mobi) / ePub
Find an introduction to the architecture, concepts and algorithms of the Linux kernel in Professional Linux Kernel Architecture, a guide to the kernel sources and large number of connections among subsystems. Find an introduction to the relevant structures and functions exported by the kernel to userland, understand the theoretical and conceptual aspects of the Linux kernel and Unix derivatives, and gain a deeper understanding of the kernel. Learn how to reduce the vast amount of information contained in the kernel sources and obtain the skills necessary to understand the kernel sources.
process in the system. If processes want to communicate to exchange data, for example, then special kernel mechanisms must be used. Because Linux is a multitasking system, it supports what appears to be concurrent execution of several processes. Since only as many processes as there are CPUs in the system can really run at the same time, the kernel switches (unnoticed by users) between the processes at short intervals to give them the impression of simultaneous processing. Here, there are two
mechanisms. Threads make this situation easier to handle. The browser defines a routine to load images, and the routine is started as a thread with multiple strands (each with different arguments). Because the threads and the main program share the same address space, data received automatically reside in the main program. There is therefore no need for any communication effort whatsoever, except to prevent the threads from stepping onto their feet mutually by accessing identical memory
chapters. Instead, I use them without further explanation — after all, they are simply non-compound standard data types under a different name. typedef’d variables must not be accessed directly, but only via auxiliary functions that I introduce when we encounter the type. This ensures that they are properly manipulated, although the type definition is transparent to the user. At certain points, the kernel must make use of variables with an exact, clearly defined number of bits — for example,
fork. The link between the memory pages of the parent and child process needed to do this is visible to the kernel only and is transparent to the applications. 47 Page 47 Mauerer runc02.tex V3 - 09/04/2008 Chapter 2: Process Management and Scheduling Global identifiers allow the kernel to selectively grant or deny certain privileges. While the root user with UID 0 is essentially allowed to do anything, higher user IDs are more confined. A user with PID n may, for instance, not kill
mation is important when the swapping subsystem has to select which page to swap out. The interaction of the two flags is explained in Chapter 18. ❑ PG_uptodate indicates that the data of a page have been read without error from a block device. ❑ PG_dirty is set when the contents of the page have changed as compared to the data on hard disk. For reasons of performance, pages are not written back immediately after each change. The kernel therefore uses this flag to note which pages have been