Internals.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Linux Internals (to the power of -1) Simone Demblon Sebastian Spitzner Linux Internals: (to the power of -1) by Simone Demblon and Sebastian Spitzner Published 2005-01-25 22:22:06 Copyright © 2004 The Shuttleworth Foundation Unless otherwise expressly stated, all original material of whatever nature created by the contributors of the Learn Linux community, is licensed under the Creative Commons [http://creativecommons.org/] license Attribution-ShareAlike 2.0 [http://creativecommons.org/licenses/by-sa/2.0/] [http://creativecommons.org/licenses/by-sa/2.0/]. What follows is a copy of the "human-readable summary" of this document. The Legal Code (full license) may be read here [http://creativecommons.org/licenses/by-sa/2.0/legalcode/]. You are free: • to copy, distribute, display, and perform the work • to make derivative works • to make commercial use of the work Under the following conditions: Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. • For any reuse or distribution, you must make clear to others the license terms of this work. • Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. This is a human-readable summary of the Legal Code (the full license) [http://creativecommons.org/licenses/by-sa/2.0/legalcode/]. Table of Contents 1. Introduction and History .........................................................................1 Course Objectives ..............................................................................1 Introducing the other influence in this course ...............................1 History ..............................................................................................1 1955 .........................................................................................3 1966 .........................................................................................3 1969 to 1970 .............................................................................3 Assembler/ compilers / hardware architecture ..............................4 1971 - 1973 ...............................................................................6 1973 - 1974 ...............................................................................7 1974 - 1975 ...............................................................................7 1976 - 1978 ...............................................................................8 1979 .........................................................................................8 1980 .........................................................................................8 1977 to 1983 .............................................................................8 1989 .........................................................................................9 1992 to 1998 .............................................................................9 This is the story of Linux .................................................................10 An Introduction to Linux ..................................................................13 The story of BSD .............................................................................14 1994 1.0 release .......................................................................15 The Operations of a Unix/Linux System ............................................15 In Libraries Level ....................................................................16 Kernel .....................................................................................17 Memory ..................................................................................18 2. Booting ...............................................................................................21 What the kernel does when it starts up ..............................................21 Booting ...........................................................................................21 Switch On ...............................................................................21 3. Logging in ...........................................................................................29 Reading the Man pages - A review ...................................................29 init ..................................................................................................29 RUNLEVELS .........................................................................29 BOOTING ..............................................................................30 CHANGING RUNLEVELS .....................................................30 TELINIT(Older technology look at "init q") ..............................31 BOOTFLAGS .........................................................................31 INTERFACE ..........................................................................32 SIGNALS ...............................................................................32 Run Level versus programs ......................................................33 Default run level to go to as defined in /etc/inittab .....................33 Example Debian /etc/rcS.d/ directory ........................................34 vi Linux Internals Getty and gettdefs ....................................................................35 Terminal Emulation .........................................................................39 Terminfo (Some Extracts from stated reference material) ...........40 Terminfo Compiler (tic) ...........................................................40 Save disk space .......................................................................41 TERM ....................................................................................41 Multiple Virtual Terminals .......................................................42 Some tips ................................................................................43 In Summary ............................................................................44 4. The Kernel versus Process Management ................................................45 The Kernel ......................................................................................45 Overview of kernel/process control, resources ...........................47 Executing a process .................................................................47 Process Management .......................................................................49 Shell Command line parsing .....................................................49 Command Execution and Process Creation ................................50 Process Properties ....................................................................52 Process Life Cycle ...................................................................53 The state of a process ...............................................................55 Scheduler ................................................................................56 Linux Multitasking ..........................................................................60 Task States ..............................................................................61 Time-slicing ............................................................................61 Timer ......................................................................................62 Task switching ........................................................................63 When does switching occur? ....................................................63 5. Memory Management ..........................................................................65 The Buffer Cache ............................................................................65 The Directory Cache ........................................................................67 Paging and swapping .......................................................................67 Introduction ............................................................................67 Swap Space .............................................................................68 Swapping ................................................................................68 Paging ....................................................................................68 The working sets .....................................................................68 Implementation of swapping and paging in different systems .....69 Virtual memory .......................................................................69 6. Drivers ................................................................................................71 Introduction to drivers ......................................................................71 Driver Types ...................................................................................72 Driver Implementations ...................................................................72 Driver Management .........................................................................73 Listing currently loaded modules ..............................................73 Loading Modules .....................................................................74 Unloading modules ..................................................................74 Other module management commands ......................................74 Device Drivers ................................................................................74 vii