In order to thoroughly understand what makes Linux tick and why it works so well on a wide variety of systems, you need to delve deep into the heart of the kernel. The kernel handles all interactions between the CPU and the external world, and determines which programs will share processor time, in what order. It manages limited memory so well that hundreds of processes can share the system efficiently, and expertly organizes data transfers so that the CPU isn't kept waiting any longer than necessary for the relatively slow disks.

The third edition of Understanding the Linux Kernel takes you on a guided tour of the most significant data structures, algorithms, and programming tricks used in the kernel. Probing beyond superficial features, the authors offer valuable insights to people who want to know how things really work inside their machine. Important Intel-specific features are discussed. Relevant segments of code are dissected line by line. But the book covers more than just the functioning of the code; it explains the theoretical underpinnings of why Linux does things the way it does.

This edition of the book covers Version 2.6, which has seen significant changes to nearly every kernel subsystem, particularly in the areas of memory management and block devices. The book focuses on the following topics:

The Virtual Filesystem layer and the Second and Third Extended Filesystems

Process creation and scheduling

Signals, interrupts, and the essential interfaces to device drivers

Timing

Synchronization within the kernel

Interprocess Communication (IPC)

Program execution

Understanding the Linux Kernel will acquaint you with all the inner workings of Linux, but it's more than just an academic exercise. You'll learn what conditions bring out Linux's best performance, and you'll see how it meets the challenge of providing good system response during process scheduling, file access, and memory management in a wide variety of environments. This book will help you make the most of your Linux system.

Chapter 1 Introduction

Linux Versus Other Unix-Like Kernels

Hardware Dependency

Linux Versions

Basic Operating System Concepts

An Overview of the Unix Filesystem

An Overview of Unix Kernels

Chapter 2 Memory Addressing

Memory Addresses

Segmentation in Hardware

Segmentation in Linux

Paging in Hardware

Paging in Linux

Chapter 3 Processes

Processes, Lightweight Processes, and Threads

Process Descriptor

Process Switch

Creating Processes

Destroying Processes

Chapter 4 Interrupts and Exceptions

The Role of Interrupt Signals

Interrupts and Exceptions

Nested Execution of Exception and Interrupt Handlers

Initializing the Interrupt Descriptor Table

Exception Handling

Interrupt Handling

Softirqs and Tasklets

Work Queues

Returning from Interrupts and Exceptions

Chapter 5 Kernel Synchronization

How the Kernel Services Requests

Synchronization Primitives

Synchronizing Accesses to Kernel Data Structures

Examples of Race Condition Prevention

Chapter 6 Timing Measurements

Clock and Timer Circuits

The Linux Timekeeping Architecture

Updating the Time and Date

Updating System Statistics

Software Timers and Delay Functions

System Calls Related to Timing Measurements

Chapter 7 Process Scheduling

Scheduling Policy

The Scheduling Algorithm

Data Structures Used by the Scheduler

Functions Used by the Scheduler

Runqueue Balancing in Multiprocessor Systems

System Calls Related to Scheduling

Chapter 8 Memory Management

Page Frame Management

Memory Area Management

Noncontiguous Memory Area Management

Chapter 9 Process Address Space

The Process's Address Space

The Memory Descriptor

Memory Regions

Page Fault Exception Handler

Creating and Deleting a Process Address Space

Managing the Heap

Chapter 10 System Calls

POSIX APIs and System Calls

System Call Handler and Service Routines

Entering and Exiting a System Call

Parameter Passing

Kernel Wrapper Routines

Chapter 11 Signals

The Role of Signals

Generating a Signal

Delivering a Signal

System Calls Related to Signal Handling

Chapter 12 The Virtual Filesystem

The Role of the Virtual Filesystem (VFS)

VFS Data Structures

Filesystem Types

Filesystem Handling

Pathname Lookup

Implementations of VFS System Calls

File Locking

Chapter 13 I/O Architecture and Device Drivers

I/O Architecture

The Device Driver Model

Device Files

Device Drivers

Character Device Drivers

Chapter 14 Block Device Drivers

Block Devices Handling

The Generic Block Layer

The I/O Scheduler

Block Device Drivers

Opening a Block Device File

Chapter 15 The Page Cache

The Page Cache

Storing Blocks in the Page Cache

Writing Dirty Pages to Disk

The sync( ), fsync( ), and fdatasync( ) System Calls

Chapter 16 Accessing Files

Reading and Writing a File

Memory Mapping

Direct I/O Transfers

Asynchronous I/O

Chapter 17 Page Frame Reclaiming

The Page Frame Reclaiming Algorithm

Reverse Mapping

Implementing the PFRA

Swapping

Chapter 18 The Ext2 and Ext3 Filesystems

General Characteristics of Ext2

Ext2 Disk Data Structures

Ext2 Memory Data Structures

Creating the Ext2 Filesystem

Ext2 Methods

Managing Ext2 Disk Space

The Ext3 Filesystem

Chapter 19 Process Communication

Pipes

FIFOs

System V IPC

POSIX Message Queues

Chapter 20 Program ExZecution

Executable Files

Executable Formats

Execution Domains

The exec Functions

Appendix A System Startup

Prehistoric Age: the BIOS

Ancient Age: the Boot Loader

Middle Ages: the setup( ) Function

Renaissance: the startup_32( ) Functions

Modern Age: the start_kernel( ) Function

Appendix B Modules

To Be (a Module) or Not to Be?

Module Implementation

Linking and Unlinking Modules

Linking Modules on Demand

Appendix Bibliography

Books on Unix Kernels

Books on the Linux Kernel

Books on PC Architecture and Technical Manuals on Intel Microprocessors

Daniel P. Bovet

Daniel P. Bovet got a Ph.D. in computer science at UCLA in 1968 and is now full Professor at the University of Rome, "Tor Vergata," Italy. He had to wait over 25 years before being able to teach an operating system course in a proper manner because of the lack of source code for modern, well-designed systems. Now, thanks to cheap PCs and to Linux, Marco and Dan are able to cover all the facets of an operating system from booting to tuning and are able to hand out tough, satisfying homework to their students. (These young guys working at home on their PCs are really spoiled; they never had to fight with punched cards.) In fact, Dan was so fascinated by the accomplishments of Linus Torvalds and his followers that he spent the last few years trying to unravel some of Linux's mysteries. It seemed natural, after all that work, to write a book about what he found.

Marco Cesati

received a degree in mathematics in 1992 and a Ph.D. in computer science (University of Rome, "La Sapienza") in 1995. He is now a research assistant in the computer science department of the School of Engineering (University of Rome, "Tor Vergata"). In the past, he served as system administrator and Unix programmer for the university (as a Ph.D. student) and for several institutions (as a consultant).

The book went into detail about the Linux Kernel. It is a good book for the novice user to understand what and how the kernel works. I do wish it went more into how to write code to produce your own Linux kernel.

This book does a great job of explaining the data structures and mechanisms Linux uses. It is also written as plainly as possible considering the subject at hand and the editor did a nice job making sure the text is not overly complicated. The book does not include many code examples compared to other books on the subject such as Linux Kernel Internals. The best use is as a reference or as a guide while actually viewing the kernel code. It should be more resistant to kernel changes over time as a result of focusing on the theories and interfaces behind the kernel but will have to be updated if the internal structures are changed.

Delving into the Linux code left me with many unanswered questions. This book answered a lot of them and proved very useful. Linux Device Drivers, also by O'Reilly was a good accompaniment. Very recommended.

to master linux- learn C,logic-mathmatics and pick this book up after you know C with x86 instruction set experience!!!!-----JUMP into this book without prior knowledge to subjects i suggest learning, will be very difficult. Word of advice start with windows

and learn the subjects first. Read the book its comprehensive you will master linux quickly, 3 years.(GET A Enterprise Distro of linux) Reading man pages and toying with linux will take a lifetime!!!!!!!!!! TRUST ME!!!!!!!!