Foreword |
|
vii | (2) |
Preface |
|
ix | |
|
1 LINUX -- the operating system |
|
|
1 | (5) |
|
|
3 | (2) |
|
|
5 | (1) |
|
|
6 | (9) |
|
|
6 | (3) |
|
|
9 | (2) |
|
2.3 Additional configuration facilities |
|
|
11 | (4) |
|
3 Introduction to the kernel |
|
|
15 | (55) |
|
3.1 Important data structures |
|
|
20 | (17) |
|
|
20 | (9) |
|
|
29 | (2) |
|
|
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) |
|
|
37 | (14) |
|
|
37 | (2) |
|
|
39 | (2) |
|
|
41 | (3) |
|
|
44 | (3) |
|
|
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) |
|
|
70 | (38) |
|
4.1 The architecture-independent memory model in LINUX |
|
|
72 | (7) |
|
|
72 | (1) |
|
4.1.2 Virtual address space |
|
|
72 | (1) |
|
4.1.3 Converting the linear address |
|
|
73 | (1) |
|
|
74 | (1) |
|
4.1.5 The page middle directory |
|
|
75 | (1) |
|
|
76 | (3) |
|
4.2 The virtual address space for a process |
|
|
79 | (13) |
|
|
79 | (2) |
|
4.2.2 Virtual memory areas |
|
|
81 | (4) |
|
4.2.3 The system call brk |
|
|
85 | (1) |
|
|
86 | (1) |
|
|
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) |
|
|
92 | (6) |
|
|
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) |
|
|
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) |
|
|
116 | (3) |
|
|
119 | (2) |
|
5.4 Debugging using ptrace |
|
|
121 | (4) |
|
|
125 | (13) |
|
5.5.1 Access permissions, numbers and keys |
|
|
125 | (1) |
|
|
126 | (4) |
|
|
130 | (3) |
|
|
133 | (4) |
|
5.5.5 The ipcs and ipcrm commands |
|
|
137 | (1) |
|
|
138 | (10) |
|
|
139 | (4) |
|
5.6.2 The implementation of UNIX domain sockets |
|
|
143 | (5) |
|
|
148 | (38) |
|
|
149 | (3) |
|
6.2 The representation of file systems in the kernel |
|
|
152 | (21) |
|
|
153 | (2) |
|
6.2.2 Superblock operations |
|
|
155 | (3) |
|
|
158 | (3) |
|
|
161 | (4) |
|
|
165 | (1) |
|
|
165 | (4) |
|
|
169 | (3) |
|
6.2.8 The directory cache |
|
|
172 | (1) |
|
|
173 | (6) |
|
|
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) |
|
|
190 | (1) |
|
|
191 | (2) |
|
|
193 | (1) |
|
|
194 | (2) |
|
|
196 | (2) |
|
|
198 | (2) |
|
|
200 | (7) |
|
|
203 | (2) |
|
7.3.2 Automatic interrupt detection |
|
|
205 | (2) |
|
7.4 Implementing a driver |
|
|
207 | (14) |
|
|
209 | (1) |
|
|
210 | (2) |
|
|
212 | (2) |
|
|
214 | (3) |
|
|
217 | (2) |
|
|
219 | (1) |
|
|
220 | (1) |
|
|
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) |
|
|
227 | (52) |
|
|
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) |
|
|
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) |
|
|
254 | (1) |
|
|
255 | (1) |
|
8.3.3 The loopback device |
|
|
255 | (1) |
|
|
255 | (1) |
|
8.4 ARP -- the Address Resolution Protocol |
|
|
256 | (3) |
|
|
259 | (10) |
|
8.5.1 IP -- general introduction |
|
|
259 | (1) |
|
|
260 | (3) |
|
|
263 | (2) |
|
8.5.4 IP multicasting and IGPM |
|
|
265 | (2) |
|
|
267 | (1) |
|
8.5.6 IP accounting and IP firewalling |
|
|
268 | (1) |
|
|
269 | (2) |
|
|
269 | (2) |
|
|
271 | (1) |
|
|
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) |
|
|
273 | (4) |
|
8.8 The packet interface -- an alternative? |
|
|
277 | (2) |
|
|
279 | (14) |
|
|
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) |
|
|
285 | (1) |
|
|
285 | (2) |
|
|
287 | (2) |
|
|
289 | (4) |
|
9.7.1 Changes are the beginning of the end |
|
|
289 | (1) |
|
9.7.2 The best debugger -- printk() |
|
|
290 | (1) |
|
|
291 | (2) |
|
|
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) |
|
|
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) |
|
|
300 | (1) |
|
APPENDIX A -- System calls |
|
|
301 | (79) |
|
|
302 | (37) |
|
|
339 | (31) |
|
|
370 | (3) |
|
|
373 | (5) |
|
|
378 | (1) |
|
|
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) |
|
|
407 | (8) |
|
APPENDIX C -- The Proc file system |
|
|
415 | (13) |
|
|
415 | (6) |
|
|
421 | (1) |
|
|
422 | (4) |
|
|
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) |
|
|
432 | (5) |
|
D.2.5 LILO boot parameters |
|
|
437 | (2) |
|
D.2.6 LILO start-up messages |
|
|
439 | (1) |
|
|
439 | (2) |
|
APPENDIX E -- Useful kernel functions |
|
|
441 | (16) |
References |
|
457 | (4) |
Index |
|
461 | |