Chapter 20: the Linux System
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 20: The Linux System Operating System Concepts – 10th dition Silberschatz, Galvin and Gagne ©2018 Chapter 20: The Linux System Linux History Design Principles Kernel Modules Process Management Scheduling Memory Management File Systems Input and Output Interprocess Communication Network Structure Security Operating System Concepts – 10th dition 20!2 Silberschatz, Galvin and Gagne ©2018 Objectives To explore the history o# the UNIX operating system from hich Linux is derived and the principles upon which Linux’s design is based To examine the Linux process model and illustrate how Linux schedules processes and provides interprocess communication To look at memory management in Linux To explore how Linux implements file systems and manages I/O devices Operating System Concepts – 10th dition 20!" Silberschatz, Galvin and Gagne ©2018 History Linux is a modern, free operating system (ased on $NIX standards First developed as a small (ut sel#-contained kernel in -.91 by Linus Torvalds, with the major design goal o# UNIX compatibility, released as open source Its history has (een one o# collaboration by many users from all around the orld, corresponding almost exclusively over the Internet It has been designed to run efficiently and reliably on common PC hardware, but also runs on a variety of other platforms The core Linux operating system kernel is entirely original, but it can run much existing free UNIX soft are, resulting in an entire UNIX-compatible operating system free from proprietary code Linux system has many, varying %inux distributions including the !ernel, applications, and management tools Operating System Concepts – 10th dition 20!# Silberschatz, Galvin and Gagne ©2018 The Linux Kernel Version 0.01 (May 19.-5 had no networ!ing+ ran only on 80368, compatible Intel processors and on PC hardware, had extremely limited device-drive support, and supported only the Minix file system Linux 1.0 (March 19.9) included these new features: Support for UNI%'s standard TCP/IP networking protocols BSD-compatible socket interface for net orking programming Device-driver support for running IP over an Ethernet Enhanced file system Support for a range of SCSI controllers for high-performance disk access Extra hardware support Version 1.2 (March 19.>) as the final PC-only Linux kernel Kernels ith odd version numbers are development kernels+ those with e&en numbers are production $ernels Operating System Concepts – 10th dition 20!( Silberschatz, Galvin and Gagne ©2018 Linux 2.0 ?eleased in June 1996, =32 added t o major new capabilities: Support #or multiple architectures+ including a #ully 89,bit native Alpha port Support #or multiprocessor architectures Other new features included: Improved memory-management code Improved "CP*IP per#ormance Support #or internal kernel threads, #or handling dependencies bet een loadable modules+ and #or automatic loading of modules on demand Standardized configuration inter#ace Available for Motorola 68022,series processors, Sun Sparc systems, and for PC and PowerMac systems =39 and 2.6 increased SMP support, added journaling file system, preemptive kernel+ 64-bit memory support 732 released in 2011, =2th anniversary o# Linux+ improved virtualization support, new page write-back facility, improved memory management, new Completely Fair Scheduler Operating System Concepts – 10th dition 20!) Silberschatz, Galvin and Gagne ©2018 The Linux System Linux uses many tools developed as part of ;erkeley's ;SD operating system+ MI"'s % Windo System+ and the Free So#t are Foundation's EN$ project "he main system libraries ere started by the EN$ pro/ect+ ith improvements provided by the Linux community Linux net orking-administration tools ere deri&ed #rom 937;SD codeF recent ;SD derivatives such as Free ;SD have (orro ed code #rom Linux in return "he Linux system is maintained (y a loose net ork of developers colla(orating over the Internet+ ith a small num(er o# public #tp sites acting as de #acto standard repositories +ile System ,ierarchy Standard document maintained (y the Linux community to ensure compati(ility across the various system components Specifies overall layout of a standard Linux file system, determines under which directory names con)guration files, libraries, system binaries, and run-time data files should (e stored Operating System Concepts – 10th dition 20!* Silberschatz, Galvin and Gagne ©2018 Linux Distributions Standard, precompiled sets o# pac!ages, or distributions, include the basic Linux system, system installation and management utilities+ and ready-to-install packages of common UNIX tools The first distributions managed these pac!ages (y simply providing a means o# unpac!ing all the files into the appropriate places; modern distributions include advanced package management Early distributions included SLS and Slackware -ed Hat and .ebian are popular distributions from commercial and noncommercial sources, respectively, others include Canonical and S&SE The RPM Package file format permits compatibility among the various Linux distributions Operating System Concepts – 10th dition 20!8 Silberschatz, Galvin and Gagne ©2018 Linux Licensing The Linux kernel is distributed under the GNU General Public License (GPL)+ the terms o# which are set out by the Free Software Foundation Not public domain, in that not all rights are waived Anyone using Linux, or creating their own derivative o# Linux, may not make the derived product proprietary; so#tware released under the GPL may not be redistributed as a (inary- only product Can sell distributions, (ut must offer the source code too Operating System Concepts – 10th dition 20!/ Silberschatz, Galvin and Gagne ©2018 Design Principles Linux is a multiuser, multitasking system ith a full set of UNIX-compatible tools Its file system adheres to traditional UNIX semantics, and it fully implements the standard $NIX networking model Main design goals are speed+ efficiency, and standardization Linux is designed to be compliant ith the relevant POSIX documents; at least t o Linux distributions have achieved o0cial POSIX certification Supports Pthreads and a subset of POSIX real-time process control The Linux programming inter#ace adheres to the S1R4 UNIX semantics, rather than to BSD behavior Operating System Concepts – 10th dition 20!10 Silberschatz, Galvin and Gagne ©2018 Components of a Linux System Operating System Concepts – 10th dition 20!11 Silberschatz, Galvin and Gagne ©2018 Components of a Linux System Like most UNIX implementations, Linux is composed of three main bodies of codeF the most important distinction bet een the kernel and all other components3 The $ernel is responsible for maintaining the important abstractions of the operating system Kernel code executes in kernel mode with full access to all the physical resources of the computer All kernel code and data structures are kept in the same single address space Operating System Concepts – 10th dition 20!12 Silberschatz, Galvin and Gagne ©2018 Components of a Linux System (Cont.) The system libraries define a standard set of functions through which applications interact with the kernel, and which implement much o# the operating-system functionality that does not need the full pri&ileges o# kernel code The system utilities perform individual specialized management tasks $ser-mode programs rich and varied, including multiple shells like the bourne-again 4bash5 Operating System Concepts – 10th dition 20!1" Silberschatz, Galvin and Gagne ©2018 Kernel Modules Sections of kernel code that can (e compiled, loaded+ and unloaded independent of the rest o# the kernel3 A kernel module may typically implement a device driver, a file system, or a networking protocol The module interface allows third parties to write and distribute+ on their own terms, device drivers or file systems that could not (e distributed under the GPL3 Kernel modules allow a Linux system to be set up ith a standard, minimal kernel, ithout any extra device drivers (uilt in. Four components to Linux module support: mod&le0management system mod&le loader and &nloader driver0registration system con1ict0resol&tion mechanism Operating System Concepts – 10th dition 20!1# Silberschatz, Galvin and Gagne ©2018 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: Managing sections of module code in kernel memory Handling symbols that modules are allowed to re#erence The module requestor manages loading requested, (ut currently unloaded, modulesF it also regularly queries the kernel to see hether a dynamically loaded module is still in use, and will unload it when it is no longer actively needed Operating System Concepts – 10th dition 20!1( Silberschatz, Galvin and Gagne ©2018 Driver Registration Allows modules to tell the rest o# the kernel that a new driver has (ecome available "he kernel maintains dynamic tables o# all known drivers, and pro&ides a set of routines to allow drivers to (e added to or removed from these tables at any time Registration tables include the following items: Device drivers File systems Network protocols Binary format Operating System Concepts – 10th dition 20!1) Silberschatz, Galvin and Gagne ©2018 Conflict Resolution A mechanism that allows different de&ice drivers to reserve hardware resources and to protect those resources #rom accidental use by another driver. "he conflict resolution module aims to: Pre&ent