Chapter 20: the Linux System

Total Page:16

File Type:pdf, Size:1020Kb

Chapter 20: the Linux System 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
Recommended publications
  • Some Video Games Require a Operating System
    Some Video Games Require A Operating System Playing and woven Hiro never bail his trouncing! Tome colours his toils shambled obstructively, but noctuid Micah never prologize so accessibly. Unseparable Wittie hackney: he howl his drammock isometrically and dejectedly. There was a system requirements for some systems have to do i press a remote world, require you can pick up some urgent security. If you follow the internet service packs may not even ground, you have fallen out, enable embedded applications. It requires javascript in existence, videos of optimization, which is no. Are some systems? Vram do operating system. Sgi needed to some maintainers look around at different processes can. Your pc gamer, require some video games function checks for. Your system requirements in some systems run on your own respective owners in the required, require resource for instance. Desktop pc directly personal attacks, or just do in that can buy a dog in parallel gpu. Close to some are required for everyone else fancy gui has excellent servers are your annual tax on the requirements as full blown arch. Scroll on console or installation in your pc in beautiful places of. We will learn more, some time and capturing tools for bigger game? For residential clients, which disappeared from. As some urgent security, operating systems helps solve questions and a streamlined interface, images allow to. Api for server by default, it are done in more modern operating system? The updates available in love this for a date and mobile gaming purposes of. Fragmentation and secure a member only. Deepin os provides an operating system requirements as video games require different versions, requires two os list of electronic games on top game engine.
    [Show full text]
  • Chapter 1: Introduction What Is an Operating System?
    Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real -Time Systems Handheld Systems Computing Environments Operating System Concepts 1.1 Silberschatz, Galvin and Gagne 2002 What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: ) Execute user programs and make solving user problems easier. ) Make the computer system convenient to use. Use the computer hardware in an efficient manner. Operating System Concepts 1.2 Silberschatz, Galvin and Gagne 2002 1 Computer System Components 1. Hardware – provides basic computing resources (CPU, memory, I/O devices). 2. Operating system – controls and coordinates the use of the hardware among the various application programs for the various users. 3. Applications programs – define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs). 4. Users (people, machines, other computers). Operating System Concepts 1.3 Silberschatz, Galvin and Gagne 2002 Abstract View of System Components Operating System Concepts 1.4 Silberschatz, Galvin and Gagne 2002 2 Operating System Definitions Resource allocator – manages and allocates resources. Control program – controls the execution of user programs and operations of I/O devices . Kernel – the one program running at all times (all else being application programs).
    [Show full text]
  • The Linux Kernel Module Programming Guide
    The Linux Kernel Module Programming Guide Peter Jay Salzman Michael Burian Ori Pomerantz Copyright © 2001 Peter Jay Salzman 2007−05−18 ver 2.6.4 The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License, version 1.1. You can obtain a copy of this license at http://opensource.org/licenses/osl.php. This book is distributed in the hope it will be useful, but without any warranty, without even the implied warranty of merchantability or fitness for a particular purpose. The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and distribute this book free of charge or for a profit. No explicit permission is required from the author for reproduction of this book in any medium, physical or electronic. Derivative works and translations of this document must be placed under the Open Software License, and the original copyright notice must remain intact. If you have contributed new material to this book, you must make the material and source code available for your revisions. Please make revisions and updates available directly to the document maintainer, Peter Jay Salzman <[email protected]>. This will allow for the merging of updates and provide consistent revisions to the Linux community. If you publish or distribute this book commercially, donations, royalties, and/or printed copies are greatly appreciated by the author and the Linux Documentation Project (LDP).
    [Show full text]
  • Use of Seek When Writing Or Reading Binary Files
    Title stata.com file — Read and write text and binary files Description Syntax Options Remarks and examples Stored results Reference Also see Description file is a programmer’s command and should not be confused with import delimited (see [D] import delimited), infile (see[ D] infile (free format) or[ D] infile (fixed format)), and infix (see[ D] infix (fixed format)), which are the usual ways that data are brought into Stata. file allows programmers to read and write both text and binary files, so file could be used to write a program to input data in some complicated situation, but that would be an arduous undertaking. Files are referred to by a file handle. When you open a file, you specify the file handle that you want to use; for example, in . file open myfile using example.txt, write myfile is the file handle for the file named example.txt. From that point on, you refer to the file by its handle. Thus . file write myfile "this is a test" _n would write the line “this is a test” (without the quotes) followed by a new line into the file, and . file close myfile would then close the file. You may have multiple files open at the same time, and you may access them in any order. 1 2 file — Read and write text and binary files Syntax Open file file open handle using filename , read j write j read write text j binary replace j append all Read file file read handle specs Write to file file write handle specs Change current location in file file seek handle query j tof j eof j # Set byte order of binary file file set handle byteorder hilo j lohi j 1 j 2 Close
    [Show full text]
  • Studying the Real World Today's Topics
    Studying the real world Today's topics Free and open source software (FOSS) What is it, who uses it, history Making the most of other people's software Learning from, using, and contributing Learning about your own system Using tools to understand software without source Free and open source software Access to source code Free = freedom to use, modify, copy Some potential benefits Can build for different platforms and needs Development driven by community Different perspectives and ideas More people looking at the code for bugs/security issues Structure Volunteers, sponsored by companies Generally anyone can propose ideas and submit code Different structures in charge of what features/code gets in Free and open source software Tons of FOSS out there Nearly everything on myth Desktop applications (Firefox, Chromium, LibreOffice) Programming tools (compilers, libraries, IDEs) Servers (Apache web server, MySQL) Many companies contribute to FOSS Android core Apple Darwin Microsoft .NET A brief history of FOSS 1960s: Software distributed with hardware Source included, users could fix bugs 1970s: Start of software licensing 1974: Software is copyrightable 1975: First license for UNIX sold 1980s: Popularity of closed-source software Software valued independent of hardware Richard Stallman Started the free software movement (1983) The GNU project GNU = GNU's Not Unix An operating system with unix-like interface GNU General Public License Free software: users have access to source, can modify and redistribute Must share modifications under same
    [Show full text]
  • Android (Operating System) 1 Android (Operating System)
    Android (operating system) 1 Android (operating system) Android Home screen displayed by Samsung Nexus S with Google running Android 2.3 "Gingerbread" Company / developer Google Inc., Open Handset Alliance [1] Programmed in C (core), C++ (some third-party libraries), Java (UI) Working state Current [2] Source model Free and open source software (3.0 is currently in closed development) Initial release 21 October 2008 Latest stable release Tablets: [3] 3.0.1 (Honeycomb) Phones: [3] 2.3.3 (Gingerbread) / 24 February 2011 [4] Supported platforms ARM, MIPS, Power, x86 Kernel type Monolithic, modified Linux kernel Default user interface Graphical [5] License Apache 2.0, Linux kernel patches are under GPL v2 Official website [www.android.com www.android.com] Android is a software stack for mobile devices that includes an operating system, middleware and key applications.[6] [7] Google Inc. purchased the initial developer of the software, Android Inc., in 2005.[8] Android's mobile operating system is based on a modified version of the Linux kernel. Google and other members of the Open Handset Alliance collaborated on Android's development and release.[9] [10] The Android Open Source Project (AOSP) is tasked with the maintenance and further development of Android.[11] The Android operating system is the world's best-selling Smartphone platform.[12] [13] Android has a large community of developers writing applications ("apps") that extend the functionality of the devices. There are currently over 150,000 apps available for Android.[14] [15] Android Market is the online app store run by Google, though apps can also be downloaded from third-party sites.
    [Show full text]
  • Android Operating System
    Software Engineering ISSN: 2229-4007 & ISSN: 2229-4015, Volume 3, Issue 1, 2012, pp.-10-13. Available online at http://www.bioinfo.in/contents.php?id=76 ANDROID OPERATING SYSTEM NIMODIA C. AND DESHMUKH H.R. Babasaheb Naik College of Engineering, Pusad, MS, India. *Corresponding Author: Email- [email protected], [email protected] Received: February 21, 2012; Accepted: March 15, 2012 Abstract- Android is a software stack for mobile devices that includes an operating system, middleware and key applications. Android, an open source mobile device platform based on the Linux operating system. It has application Framework,enhanced graphics, integrated web browser, relational database, media support, LibWebCore web browser, wide variety of connectivity and much more applications. Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. Architecture of Android consist of Applications. Linux kernel, libraries, application framework, Android Runtime. All applications are written using the Java programming language. Android mobile phone platform is going to be more secure than Apple’s iPhone or any other device in the long run. Keywords- 3G, Dalvik Virtual Machine, EGPRS, LiMo, Open Handset Alliance, SQLite, WCDMA/HSUPA Citation: Nimodia C. and Deshmukh H.R. (2012) Android Operating System. Software Engineering, ISSN: 2229-4007 & ISSN: 2229-4015, Volume 3, Issue 1, pp.-10-13. Copyright: Copyright©2012 Nimodia C. and Deshmukh H.R. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
    [Show full text]
  • File Handling in Python
    hapter C File Handling in 2 Python There are many ways of trying to understand programs. People often rely too much on one way, which is called "debugging" and consists of running a partly- understood program to see if it does what you expected. Another way, which ML advocates, is to install some means of understanding in the very programs themselves. — Robin Milner In this Chapter » Introduction to Files » Types of Files » Opening and Closing a 2.1 INTRODUCTION TO FILES Text File We have so far created programs in Python that » Writing to a Text File accept the input, manipulate it and display the » Reading from a Text File output. But that output is available only during » Setting Offsets in a File execution of the program and input is to be entered through the keyboard. This is because the » Creating and Traversing a variables used in a program have a lifetime that Text File lasts till the time the program is under execution. » The Pickle Module What if we want to store the data that were input as well as the generated output permanently so that we can reuse it later? Usually, organisations would want to permanently store information about employees, inventory, sales, etc. to avoid repetitive tasks of entering the same data. Hence, data are stored permanently on secondary storage devices for reusability. We store Python programs written in script mode with a .py extension. Each program is stored on the secondary device as a file. Likewise, the data entered, and the output can be stored permanently into a file.
    [Show full text]
  • Chapter 1: Introduction
    Chapter 1: Introduction Operating System Concepts Silberschatz, Galvin and Gagn Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization Operating System Concepts 1.2 Silberschatz, Galvin and Gagne What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware Operating system goals: Execute user programs and make solving user problems easier Make the computer system convenient to use Use the computer hardware in an efficient manner Operating System Concepts 1.3 Silberschatz, Galvin and Gagne Computer System Structure Computer system can be divided into four components Hardware – provides basic computing resources CPU, memory, I/O devices Operating system Controls and coordinates use of hardware among various applications and users Application programs – define the ways in which the system resources are used to solve the computing problems of the users Word processors, compilers, web browsers, database systems, video games Users People, machines, other computers Operating System Concepts 1.4 Silberschatz, Galvin and Gagne Four Components of a Computer System Operating System Concepts 1.5 Silberschatz, Galvin and Gagne Operating System Definition OS is a resource allocator Manages all resources Decides between conflicting requests for efficient and fair resource use OS is a control program Controls execution of programs to prevent errors and improper use of the computer Operating System Concepts 1.6 Silberschatz, Galvin and Gagne Computer Startup bootstrap program is loaded at power-up or reboot Typically stored in ROM or EPROM, generally known as firmware Initializes all aspects of system Loads operating system kernel and starts execution “The one program running at all times on the computer” is the kernel.
    [Show full text]
  • Introduction to Linux Kernel Driver Programming
    IntroductionIntroduction toto LinuxLinux kernelkernel driverdriver programmingprogramming Introduction to Linux kernel driver programming The Linux kernel device model Authors and license ● Authors – Michael Opdenacker ([email protected]) Founder of Bootlin, kernel and embedded Linux engineering company https://bootlin.com/company/staff/michael-opdenacker ● License – Creative Commons Attribution – Share Alike 4.0 https://creativecommons.org/licenses/by-sa/4.0/ – Document sources: https://github.com/e-ale/Slides Need for a device model ● For the same device, need to use the same device driver on multiple CPU architectures (x86, ARM…), even though the hardware controllers are different. ● Need for a single driver to support multiple devices of the same kind. ● This requires a clean organization of the code, with the device drivers separated from the controller drivers, the hardware description separated from the drivers themselves, etc. Driver: between bus infrastructure and framework In Linux, a driver is always interfacing with: ● a framework that allows the driver to expose the hardware features in a generic way. ● a bus infrastructure, part of the device model, to detect/communicate with the hardware. Let’s focus on the bus infrastructure for now Device model data structures The device model is organized around three main data structures: ● The struct bus_type structure, which represent one type of bus (USB, PCI, I2C, etc.) ● The struct device_driver structure, which represents one driver capable of handling certain devices on a certain bus. ● The struct device structure, which represents one device connected to a bus The kernel uses inheritance to create more specialized versions of struct device_driver and struct device for each bus subsystem.
    [Show full text]
  • History and Evolution of the Android OS
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Springer - Publisher Connector CHAPTER 1 History and Evolution of the Android OS I’m going to destroy Android, because it’s a stolen product. I’m willing to go thermonuclear war on this. —Steve Jobs, Apple Inc. Android, Inc. started with a clear mission by its creators. According to Andy Rubin, one of Android’s founders, Android Inc. was to develop “smarter mobile devices that are more aware of its owner’s location and preferences.” Rubin further stated, “If people are smart, that information starts getting aggregated into consumer products.” The year was 2003 and the location was Palo Alto, California. This was the year Android was born. While Android, Inc. started operations secretly, today the entire world knows about Android. It is no secret that Android is an operating system (OS) for modern day smartphones, tablets, and soon-to-be laptops, but what exactly does that mean? What did Android used to look like? How has it gotten where it is today? All of these questions and more will be answered in this brief chapter. Origins Android first appeared on the technology radar in 2005 when Google, the multibillion- dollar technology company, purchased Android, Inc. At the time, not much was known about Android and what Google intended on doing with it. Information was sparse until 2007, when Google announced the world’s first truly open platform for mobile devices. The First Distribution of Android On November 5, 2007, a press release from the Open Handset Alliance set the stage for the future of the Android platform.
    [Show full text]
  • Chapter 10 Streams Streams Text Files and Binary Files
    Streams Chapter 10 • A stream is an object that enables the flow of File I/O data between a ppgrogram and some I/O device or file – If the data flows into a program, then the stream is called an input stream – If the dtdata flows out of a program, then the stream is called an output stream Copyright © 2012 Pearson Addison‐Wesley. All rights reserved. 10‐2 Streams Text Files and Binary Files • Input streams can flow from the kbkeyboar d or from a • Files that are designed to be read by human beings, file and that can be read or written with an editor are – StSystem. in is an itinput stream tha t connects to the called text files keyboard – Scanner keyy(y);board = new Scanner(System.in); Text files can also be called ASCII files because the data they contain uses an ASCII encoding scheme • Output streams can flow to a screen or to a file – An advantage of text files is that the are usually the same – System.out is an output stream that connects to the screen on all computers, so tha t they can move from one System.out.println("Output stream"); computer to another Copyright © 2012 Pearson Addison‐Wesley. All rights reserved. 10‐3 Copyright © 2012 Pearson Addison‐Wesley. All rights reserved. 10‐4 Text Files and Binary Files Writing to a Text File • Files tha t are didesigne d to be read by programs and • The class PrintWriter is a stream class that consist of a sequence of binary digits are called binary files that can be used to write to a text file – Binary files are designed to be read on the same type of – An object of the class PrintWriter has the computer and with the same programming language as the computer that created the file methods print and println – An advantage of binary files is that they are more efficient – These are similar to the System.out methods to process than text files of the same names, but are used for text file – Unlike most binary files, Java binary files have the advantage of being platform independent also output, not screen output Copyright © 2012 Pearson Addison‐Wesley.
    [Show full text]