did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780201331431

Linux Kernel Programming

by ; ; ; ; ;
  • ISBN13:

    9780201331431

  • ISBN10:

    0201331438

  • Edition: 2nd
  • Format: Paperback w/CD
  • Copyright: 2002-01-01
  • Publisher: Addison-Wesley Professional
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $54.99

Summary

Since the introduction of Linux version 1.2 in March 1995, a whole community has evolved of programmers from all over the world who were attracted by the reliability and flexibility of this completely free operating system. Now at version 2.0, Linux is no longer only the operating system of choice for hackers, but is being successfully employed in commercial software development, by Internet providers and in research and teaching. This book is written for anybody who wants to learn more about Linux. It explains the inner mechanisms of Linux from process scheduling to memory management and file systems, and will tell you all you need to know about the structure of the kernel, the heart of the Linux operating system. The accompanying CD-ROM contains the Slackware distribution 3.1 together with its complete source code, the Linux kernel sources up to version 2.1.21, the PC speaker driver, and a wealth of documentation, as well as the program for generating the source-oriented index. This second edition of Linux Kernel Internals: has been thoroughly updated throughout to cover Linux 2. shows you how the Linux operating system actually works so that you can start to program the Linux kernel for yoursel introduces the kernel sources and describes basic algorithms and data structures, such as scheduling and task structur helps you to understand file systems, networking and how systems boot

Table of Contents

Foreword vii(2)
Preface ix
1 LINUX -- the operating system
1(5)
1.1 Main characteristics
3(2)
1.2 Linux distributions
5(1)
2 Compiling the kernel
6(9)
2.1 Where is everything?
6(3)
2.2 Compiling
9(2)
2.3 Additional configuration facilities
11(4)
3 Introduction to the kernel
15(55)
3.1 Important data structures
20(17)
3.1.1 The task structure
20(9)
3.1.2 The process table
29(2)
3.1.3 Files and inodes
31(2)
3.1.4 Dynamics memory management
33(1)
3.1.5 Queues and semaphores
34(2)
3.1.6 System time and timers
36(1)
3.2 Main algorithms
37(14)
3.2.1 Signals
37(2)
3.2.2 Interrupts
39(2)
3.2.3 Booting the system
41(3)
3.2.4 Timer interrupt
44(3)
3.2.5 The scheduler
47(4)
3.3 Implementing system calls
51(19)
3.3.1 How do system calls actually work?
51(2)
3.3.2 Examples of simple system calls
53(2)
3.3.3 Examples of more complex system calls
55(10)
3.3.4 Implementing a new system call
65(5)
4 Memory management
70(38)
4.1 The architecture-independent memory model in LINUX
72(7)
4.1.1 Pages of memory
72(1)
4.1.2 Virtual address space
72(1)
4.1.3 Converting the linear address
73(1)
4.1.4 The page directory
74(1)
4.1.5 The page middle directory
75(1)
4.1.6 The page table
76(3)
4.2 The virtual address space for a process
79(13)
4.2.1 The user segment
79(2)
4.2.2 Virtual memory areas
81(4)
4.2.3 The system call brk
85(1)
4.2.4 Mapping functions
86(1)
4.2.5 The kernel segment
86(2)
4.2.6 Static memory allocation in the kernel segment
88(1)
4.2.7 Dynamic memory allocation in the kernel segment
88(4)
4.3 Block device caching
92(6)
4.3.1 Block buffering
92(2)
4.3.2 The update and bdflush processes
94(1)
4.3.3 List structures for the buffer cache
95(1)
4.3.4 Using the buffer cache
96(2)
4.4 Paging under LINUX
98(10)
4.4.1 Page cache and management
100(1)
4.4.2 Finding a free page
101(5)
4.4.3 Page errors and reloading a page
106(2)
5 Inter-process communication
108(40)
5.1 Synchronization in the kernel
110(4)
5.2 Communication via files
114(5)
5.2.1 Locking entire files
115(1)
5.2.2 Locking file areas
116(3)
5.3 Pipes
119(2)
5.4 Debugging using ptrace
121(4)
5.5 System V IPC
125(13)
5.5.1 Access permissions, numbers and keys
125(1)
5.5.2 Semaphores
126(4)
5.5.3 Message queues
130(3)
5.5.4 Shared memory
133(4)
5.5.5 The ipcs and ipcrm commands
137(1)
5.6 IPC with sockets
138(10)
5.6.1 A simple example
139(4)
5.6.2 The implementation of UNIX domain sockets
143(5)
6 The LINUX file system
148(38)
6.1 Basic principles
149(3)
6.2 The representation of file systems in the kernel
152(21)
6.2.1 Mounting
153(2)
6.2.2 Superblock operations
155(3)
6.2.3 The inode
158(3)
6.2.4 Inode operations
161(4)
6.2.5 The file structure
165(1)
6.2.6 File operations
165(4)
6.2.7 Opening a file
169(3)
6.2.8 The directory cache
172(1)
6.3 The Proc file system
173(6)
6.4 The Ext2 file system
179(7)
6.4.1 The structure of the Ext2 file system
180(2)
6.4.2 Directories in the Ext2 file system
182(1)
6.4.3 Block allocation in the Ext2 file system
183(1)
6.4.4 Extensions of the Ext2 file system
184(2)
7 Device drivers under LINUX
186(41)
7.1 Character and block devices
188(2)
7.2 Polling and interrupts
190(10)
7.2.1 Polling mode
190(1)
7.2.2 Interrupt mode
191(2)
7.2.3 Interrupt sharing
193(1)
7.2.4 Bottom halves
194(2)
7.2.5 Task queues
196(2)
7.2.6 DMA mode
198(2)
7.3 The hardware
200(7)
7.3.1 Hardware detection
203(2)
7.3.2 Automatic interrupt detection
205(2)
7.4 Implementing a driver
207(14)
7.4.1 The setup function
209(1)
7.4.2 init
210(2)
7.4.3 open and release
212(2)
7.4.4 read and write
214(3)
7.4.5 IOCTL
217(2)
7.4.6 select
219(1)
7.4.7 lseek
220(1)
7.4.8 mmap
220(1)
7.4.9 readdir, fsync and fasync
221(1)
7.4.10 check_media_change and revalidate
221(1)
7.5 An example of DMA operation
221(6)
8 Network implementation
227(52)
8.1 Introductory summary
228(6)
8.1.1 The layer model of the network implementation
229(1)
8.1.2 Getting the data from A to B
230(4)
8.2 Important structures
234(13)
8.2.1 The socket structure
234(1)
8.2.2 The sk_buff structure -- buffer management in the network
235(4)
8.2.3 The INET socket -- a special part of a socket
239(4)
8.2.4 Protocol operations in the proto structure
243(3)
8.2.5 The general structure of a socket address
246(1)
8.3 Network devices under LINUX
247(9)
8.3.1 Ethernet
254(1)
8.3.2 SLIP and PLIP
255(1)
8.3.3 The loopback device
255(1)
8.3.4 The dummy device
255(1)
8.4 ARP -- the Address Resolution Protocol
256(3)
8.5 IP
259(10)
8.5.1 IP -- general introduction
259(1)
8.5.2 IP functions
260(3)
8.5.3 Routing
263(2)
8.5.4 IP multicasting and IGPM
265(2)
8.5.5 IP packet filters
267(1)
8.5.6 IP accounting and IP firewalling
268(1)
8.6 UDP
269(2)
8.6.1 Functions of UDP
269(2)
8.6.2 Other functions
271(1)
8.7 TCP
271(6)
8.7.1 General notes on TCP
271(1)
8.7.2 The TCP communication end-point -- a finite state machine
272(1)
8.7.3 Functions of TCP
273(4)
8.8 The packet interface -- an alternative?
277(2)
9 Modules and debugging
279(14)
9.1 What are modules?
279(1)
9.2 Implementation in the kernel
280(3)
9.2.1 Signatures of symbols
283(1)
9.3 What can be implemented as a module?
283(2)
9.4 Parameter passing
285(1)
9.5 The kernel daemon
285(2)
9.6 An example module
287(2)
9.7 Debugging
289(4)
9.7.1 Changes are the beginning of the end
289(1)
9.7.2 The best debugger -- printk()
290(1)
9.7.3 Debugging with gdb
291(2)
10 Multi-processing
293(8)
10.1 The Intel multi-processor specification
293(2)
10.2 Problems with multi-processor systems
295(1)
10.3 Changes to the kernel
296(4)
10.3.1 Kernel initialization
296(1)
10.3.2 Scheduling
297(1)
10.3.3 Message exchange between processors
298(1)
10.3.4 Entering kernel mode
298(1)
10.3.5 Interrupt handling
299(1)
10.4 Compiling LINUX SMP
300(1)
APPENDIX A -- System calls
301(79)
A.1 Process management
302(37)
A.2 The file system
339(31)
A.3 Communication
370(3)
A.4 Memory management
373(5)
A.5 Initialization
378(1)
A.6 All that remains
379(1)
APPENDIX B -- Kernel-related commands
380(35)
B.1 free -- synopsis of the system memory
380(1)
B.2 ps -- display of process statistics
381(5)
B.3 Additional kernel configuration
386(1)
B.4 top -- the CPU charts
387(2)
B.5 init -- primus inter pares
389(6)
B.6 shutdown -- shutting down the system
395(1)
B.7 strace -- monitoring a process
396(4)
B.8 Configuring the network interface
400(1)
B.9 traceroute -- Ariadne's thread in the Internet
400(3)
B.10 Configuring a serial interface
403(2)
B.11 Configuring a parallel interface
405(2)
B.12 mount
407(8)
APPENDIX C -- The Proc file system
415(13)
C.1 The /proc/ directory
415(6)
C.2 The net/ directory
421(1)
C.3 The self/ directory
422(4)
C.4 The sys/ directory
426(2)
APPENDIX D -- The boot process
428(13)
D.1 Carrying out the boot process
428(3)
D.2 LILO -- the Linux loader
431(10)
D.2.1 LILO started by MS-DOS MBR
431(1)
D.2.2 LILO started by a boot manager
431(1)
D.2.3 LILO in the master boot record
432(1)
D.2.4 LILO files
432(5)
D.2.5 LILO boot parameters
437(2)
D.2.6 LILO start-up messages
439(1)
D.2.7 Error messages
439(2)
APPENDIX E -- Useful kernel functions
441(16)
References 457(4)
Index 461

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program