Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Linux History
Design Principles
Kernel Modules
Process Management
Scheduling
Memory Management
File Systems
Input and Output
Interprocess Communication
Network Structure
Security
Operating System Concepts – 7th Edition, Feb 6, 2005 21.2 Silberschatz, Galvin and Gagne ©2005
Objectives
Operating System Concepts – 7th Edition, Feb 6, 2005 21.3 Silberschatz, Galvin and Gagne ©2005
History
Operating System Concepts – 7th Edition, Feb 6, 2005 21.4 Silberschatz, Galvin and Gagne ©2005
The Linux Kernel
Operating System Concepts – 7th Edition, Feb 6, 2005 21.5 Silberschatz, Galvin and Gagne ©2005
Linux 2.0
Operating System Concepts – 7th Edition, Feb 6, 2005 21.6 Silberschatz, Galvin and Gagne ©2005
The Linux System
Operating System Concepts – 7th Edition, Feb 6, 2005 21.7 Silberschatz, Galvin and Gagne ©2005
Linux Distributions
Operating System Concepts – 7th Edition, Feb 6, 2005 21.8 Silberschatz, Galvin and Gagne ©2005
Linux Licensing
Operating System Concepts – 7th Edition, Feb 6, 2005 21.9 Silberschatz, Galvin and Gagne ©2005
Design Principles
Operating System Concepts – 7th Edition, Feb 6, 2005 21.10 Silberschatz, Galvin and Gagne ©2005
Components of a Linux System
Operating System Concepts – 7th Edition, Feb 6, 2005 21.11 Silberschatz, Galvin and Gagne ©2005
Components of a Linux System (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.12 Silberschatz, Galvin and Gagne ©2005
Components of a Linux System (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.13 Silberschatz, Galvin and Gagne ©2005
Kernel Modules
Operating System Concepts – 7th Edition, Feb 6, 2005 21.14 Silberschatz, Galvin and Gagne ©2005
Module Management
Supports loading modules into memory and letting them talk to the
rest of the kernel
Module loading is split into two separate sections:
z Managing sections of module code in kernel memory
z Handling symbols that modules are allowed to reference
The module requestor manages loading requested, but currently
unloaded, modules; it also regularly queries the kernel to see
whether a dynamically loaded module is still in use, and will unload
it when it is no longer actively needed
Operating System Concepts – 7th Edition, Feb 6, 2005 21.15 Silberschatz, Galvin and Gagne ©2005
Driver Registration
Allows modules to tell the rest of the kernel that a new driver has
become available
The kernel maintains dynamic tables of all known drivers, and
provides a set of routines to allow drivers to be added to or
removed from these tables at any time
Registration tables include the following items:
z Device drivers
z File systems
z Network protocols
z Binary format
Operating System Concepts – 7th Edition, Feb 6, 2005 21.16 Silberschatz, Galvin and Gagne ©2005
Conflict Resolution
Operating System Concepts – 7th Edition, Feb 6, 2005 21.17 Silberschatz, Galvin and Gagne ©2005
Process Management
Operating System Concepts – 7th Edition, Feb 6, 2005 21.18 Silberschatz, Galvin and Gagne ©2005
Process Identity
Operating System Concepts – 7th Edition, Feb 6, 2005 21.19 Silberschatz, Galvin and Gagne ©2005
Process Environment
Operating System Concepts – 7th Edition, Feb 6, 2005 21.20 Silberschatz, Galvin and Gagne ©2005
Process Context
Operating System Concepts – 7th Edition, Feb 6, 2005 21.21 Silberschatz, Galvin and Gagne ©2005
Process Context (Cont.)
Whereas the file table lists the existing open files, the
file-system context applies to requests to open new files
z The current root and default directories to be used for new file
searches are stored here
The signal-handler table defines the routine in the process’s
address space to be called when specific signals arrive
The virtual-memory context of a process describes the full
contents of the its private address space
Operating System Concepts – 7th Edition, Feb 6, 2005 21.22 Silberschatz, Galvin and Gagne ©2005
Processes and Threads
Operating System Concepts – 7th Edition, Feb 6, 2005 21.23 Silberschatz, Galvin and Gagne ©2005
Scheduling
Operating System Concepts – 7th Edition, Feb 6, 2005 21.24 Silberschatz, Galvin and Gagne ©2005
Relationship Between Priorities and Time-
slice Length
Operating System Concepts – 7th Edition, Feb 6, 2005 21.25 Silberschatz, Galvin and Gagne ©2005
List of Tasks Indexed by Priority
Operating System Concepts – 7th Edition, Feb 6, 2005 21.26 Silberschatz, Galvin and Gagne ©2005
Kernel Synchronization
Operating System Concepts – 7th Edition, Feb 6, 2005 21.27 Silberschatz, Galvin and Gagne ©2005
Kernel Synchronization (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.28 Silberschatz, Galvin and Gagne ©2005
Kernel Synchronization (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.29 Silberschatz, Galvin and Gagne ©2005
Interrupt Protection Levels
Operating System Concepts – 7th Edition, Feb 6, 2005 21.30 Silberschatz, Galvin and Gagne ©2005
Process Scheduling
Operating System Concepts – 7th Edition, Feb 6, 2005 21.31 Silberschatz, Galvin and Gagne ©2005
Process Scheduling (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.32 Silberschatz, Galvin and Gagne ©2005
Symmetric Multiprocessing
Linux 2.0 was the first Linux kernel to support SMP hardware;
separate processes or threads can execute in parallel on separate
processors
Operating System Concepts – 7th Edition, Feb 6, 2005 21.33 Silberschatz, Galvin and Gagne ©2005
Memory Management
Operating System Concepts – 7th Edition, Feb 6, 2005 21.34 Silberschatz, Galvin and Gagne ©2005
Relationship of Zones and Physical
Addresses on 80x86
Operating System Concepts – 7th Edition, Feb 6, 2005 21.35 Silberschatz, Galvin and Gagne ©2005
Splitting of Memory in a Buddy Heap
Operating System Concepts – 7th Edition, Feb 6, 2005 21.36 Silberschatz, Galvin and Gagne ©2005
Managing Physical Memory
The page allocator allocates and frees all physical pages; it can
allocate ranges of physically-contiguous pages on request
The allocator uses a buddy-heap algorithm to keep track of available
physical pages
z Each allocatable memory region is paired with an adjacent
partner
z Whenever two allocated partner regions are both freed up they
are combined to form a larger region
z If a small memory request cannot be satisfied by allocating an
existing small free region, then a larger free region will be
subdivided into two partners to satisfy the request
Memory allocations in the Linux kernel occur either statically (drivers
reserve a contiguous area of memory during system boot time) or
dynamically (via the page allocator)
Also uses slab allocator for kernel memory
Operating System Concepts – 7th Edition, Feb 6, 2005 21.37 Silberschatz, Galvin and Gagne ©2005
21.07
Operating System Concepts – 7th Edition, Feb 6, 2005 21.38 Silberschatz, Galvin and Gagne ©2005
Virtual Memory
Operating System Concepts – 7th Edition, Feb 6, 2005 21.39 Silberschatz, Galvin and Gagne ©2005
Virtual Memory (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.40 Silberschatz, Galvin and Gagne ©2005
Virtual Memory (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.41 Silberschatz, Galvin and Gagne ©2005
Virtual Memory (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.42 Silberschatz, Galvin and Gagne ©2005
Virtual Memory (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.43 Silberschatz, Galvin and Gagne ©2005
Executing and Loading User Programs
Operating System Concepts – 7th Edition, Feb 6, 2005 21.44 Silberschatz, Galvin and Gagne ©2005
Memory Layout for ELF Programs
Operating System Concepts – 7th Edition, Feb 6, 2005 21.45 Silberschatz, Galvin and Gagne ©2005
Static and Dynamic Linking
Operating System Concepts – 7th Edition, Feb 6, 2005 21.46 Silberschatz, Galvin and Gagne ©2005
File Systems
Operating System Concepts – 7th Edition, Feb 6, 2005 21.47 Silberschatz, Galvin and Gagne ©2005
The Linux Ext2fs File System
Ext2fs uses a mechanism similar to that of BSD Fast File System (ffs)
for locating data blocks belonging to a specific file
The main differences between ext2fs and ffs concern their disk
allocation policies
z In ffs, the disk is allocated to files in blocks of 8Kb, with blocks
being subdivided into fragments of 1Kb to store small files or
partially filled blocks at the end of a file
z Ext2fs does not use fragments; it performs its allocations in
smaller units
The default block size on ext2fs is 1Kb, although 2Kb and 4Kb
blocks are also supported
z Ext2fs uses allocation policies designed to place logically
adjacent blocks of a file into physically adjacent blocks on disk, so
that it can submit an I/O request for several disk blocks as a
single operation
Operating System Concepts – 7th Edition, Feb 6, 2005 21.48 Silberschatz, Galvin and Gagne ©2005
Ext2fs Block-Allocation Policies
Operating System Concepts – 7th Edition, Feb 6, 2005 21.49 Silberschatz, Galvin and Gagne ©2005
The Linux Proc File System
The proc file system does not store data, rather, its contents are
computed on demand according to user file I/O requests
proc must implement a directory structure, and the file contents
within; it must then define a unique and persistent inode number for
each directory and files it contains
z It uses this inode number to identify just what operation is
required when a user tries to read from a particular file inode or
perform a lookup in a particular directory inode
z When data is read from one of these files, proc collects the
appropriate information, formats it into text form and places it
into the requesting process’s read buffer
Operating System Concepts – 7th Edition, Feb 6, 2005 21.50 Silberschatz, Galvin and Gagne ©2005
Input and Output
Operating System Concepts – 7th Edition, Feb 6, 2005 21.51 Silberschatz, Galvin and Gagne ©2005
Device-Driver Block Structure
Operating System Concepts – 7th Edition, Feb 6, 2005 21.52 Silberschatz, Galvin and Gagne ©2005
Block Devices
Operating System Concepts – 7th Edition, Feb 6, 2005 21.53 Silberschatz, Galvin and Gagne ©2005
Character Devices
A device driver which does not offer random access to fixed blocks
of data
A character device driver must register a set of functions which
implement the driver’s various file I/O operations
The kernel performs almost no preprocessing of a file read or write
request to a character device, but simply passes on the request to
the device
The main exception to this rule is the special subset of character
device drivers which implement terminal devices, for which the
kernel maintains a standard interface
Operating System Concepts – 7th Edition, Feb 6, 2005 21.54 Silberschatz, Galvin and Gagne ©2005
Interprocess Communication
Like UNIX, Linux informs processes that an event has occurred via
signals
There is a limited number of signals, and they cannot carry
information: Only the fact that a signal occurred is available to a
process
The Linux kernel does not use signals to communicate with
processes with are running in kernel mode, rather, communication
within the kernel is accomplished via scheduling states and
wait.queue structures
Operating System Concepts – 7th Edition, Feb 6, 2005 21.55 Silberschatz, Galvin and Gagne ©2005
Passing Data Between Processes
Operating System Concepts – 7th Edition, Feb 6, 2005 21.56 Silberschatz, Galvin and Gagne ©2005
Shared Memory Object
Operating System Concepts – 7th Edition, Feb 6, 2005 21.57 Silberschatz, Galvin and Gagne ©2005
Network Structure
Operating System Concepts – 7th Edition, Feb 6, 2005 21.58 Silberschatz, Galvin and Gagne ©2005
Network Structure (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.59 Silberschatz, Galvin and Gagne ©2005
Security
Operating System Concepts – 7th Edition, Feb 6, 2005 21.60 Silberschatz, Galvin and Gagne ©2005
Security (Cont.)
Operating System Concepts – 7th Edition, Feb 6, 2005 21.61 Silberschatz, Galvin and Gagne ©2005
End of Chapter 21