Operating Systems: Principles and Practice, Introduction

Operating Systems CSCI 411 Introduction Content from Operating Systems in Depth Thomas w. Doeppner 2011 Operating Systems Principles & Practices by Anderson and Dahlin 2014 Tannenbaum 2015 M. Doman Main Points (for today)

Operating system definition Software to manage a computers resources for its users and applications OS challenges Reliability, security, responsiveness, portability, OS history In the Beginning

There was hardware processor storage card reader tape drive drum And not much else no operating system no libraries

no compilers IBM 650 OS: none get photo from: http://www-03.ibm.com/ibm/history/exhibits/650/650_p h10.html]

Programming Without an OS Assemble all software into a deck of punched cards Get 15-minute computer slot 1) 2) 3) 4)

pay $75 ($611 in 2010 dollars) mount tapes containing data read cards into computer run program it probably crashes 5) output (possibly a dump) goes to printer Steps 1, 2, 3, and 5 take 10 minutes leaving 5 minutes for step 4!

Enter the OS Group jobs into batches Setup done for all collectively Software doing this called Input/Output System the first operating system Operating System Job Provide a user program with better, simpler,

cleaner, model of the computer Handle management of all computer resources Early Operating Systems: Computers Very Expensive One application at a time Had complete control of hardware OS was runtime library Users would stand in line to use the computer

Batch systems Keep CPU busy by having a queue of jobs OS would load next job while current one runs Users would submit jobs, and wait, and wait, and Batch Systems (1) Figure 1-3. An early batch system. (a) Programmers bring cards to 1401. (b) 1401 reads batch of jobs onto tape.

Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Batch Systems Figure 1-4. Structure of a typical Fortran job. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Time-Sharing Operating Systems: Computers and People Expensive Multiple users on computer at same time

Multiprogramming: run multiple programs at same time Interactive performance: try to complete everyones tasks quickly As computers became cheaper, more important to optimize for user time, not computer time Bonus Thought Question How should an operating system allocate processing time between competing uses?

Give the CPU to the first to arrive? To the one that needs the least resources to complete? To the one that needs the most resources? What if you need to allocate memory? Disk? Todays Operating Systems: Computers Cheap

Smartphones Embedded systems Web servers Laptops

Tablets Virtual machines Tomorrows Operating Systems Giant-scale data centers Increasing numbers of processors per computer Increasing numbers of computers per user Very large scale storage

What is an operating system? Software to manage a computers resources for its users and applications Components of a Modern Computer (2)

Figure 1-1. Where the operating system fits in. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. The Operating System as a Resource Manager Top down view Provide abstractions to application programs Bottom up view Manage pieces of complex system

Alternative view Provide orderly, controlled allocation of resources Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. The Operating System as an Extended Machine

Figure 1-2. Operating systems turn ugly hardware into beautiful abstractions. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Operating System Roles Referee: Resource allocation among users, applications Isolation of different users, applications from each other Communication between users, applications

Illusionist Each application appears to have the entire machine to itself Infinite number of processors, (near) infinite amount of memory, reliable storage, reliable network transport Glue Libraries, user interface widgets, Thought Question

What do you need from hardware to be able to: Isolate different applications from each other? Isolate different users from accessing each others files? OS Challenges Reliability Does the system do what it was designed to do? Availability

What portion of the time is the system working? Mean Time To Failure (MTTF), Mean Time to Repair Security Can the system be compromised by an attacker? Privacy Data is accessible only to authorized users Both require very careful design and code

OS Challenges Performance Latency/response time How long does an operation take to complete? Throughput How many operations can be done per unit of time? Overhead How much extra work is done by the OS?

Fairness How equal is the performance received by different users? Predictability How consistent is the performance over time? OS Challenges Portability For programs:

Application programming interface (API) Abstract machine interface For the operating system Hardware abstraction layer Hardware-specific OS kernel routines System Calls

Sole interface between user and kernel Implemented as library routines that execute trap instructions to enter kernel Errors indicated by returns of 1; error code is in errno if (write(fd, buffer, bufsize) == 1) { // error! printf("error %d\n", errno); // see perror }

Operating Systems Abstraction providing an appropriate interface for applications Concerns performance time and space sharing and resource management

failure tolerance security marketability Abstractions Hardware disks memory processors network

monitor keyboard mouse Operating system files programs threads of control communication windows, graphics

input locator Processes Fundamental abstraction of program execution memory processor(s) each processor abstraction is a thread execution context

Memory Figure 1-8. (a) A quad-core chip with a shared L2 cache. (b) A quad-core chip with separate L2 caches. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Files Memory

Disk Disk I/O Devices Figure 1-11. (a) The steps in starting an I/O device and getting an interrupt. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Disks Figure 1-10. Structure of a disk drive. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Memory Sharing (1) Program 1 Program 2 Program 3

Operating System Memory Scheduling Processes Avoiding Deadlocks Virtual Machines Figure 1-29. (a) A type 1 hypervisor. (b) A pure type 2

hypervisor. (c) A practical type 2 hypervisor. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. The File Abstraction A file is a simple array of bytes Files are made larger by writing beyond their current end Files are named by paths in a naming tree System calls on files are synchronous

Standard File Descriptors main( ) { char buf[BUFSIZE]; int n; const char* note = "Write failed\n"; while ((n = read(0, buf, sizeof(buf))) > 0) if (write(1, buf, n) != n) { (void)write(2, note, strlen(note)); exit(EXIT_FAILURE); }

return(EXIT_SUCCESS); }

Recently Viewed Presentations

  • Fundamentals of Alternating Quantity

    Fundamentals of Alternating Quantity

    Necessity of Starters - Example. 5 H.P., 220 V shunt motor has a full-load current of 20 A and an armature resistance of about 0.5 ohms. If this motor is directly switched on to supply, it would take an armature...
  • Soot Particle Aerosol Mass Spectrometer: Development, Validation, and

    Soot Particle Aerosol Mass Spectrometer: Development, Validation, and

    Diameter rBC ∼ 120 nm. Similar in size to diesel exhaust particulate emissions (fresh) Diameter organics ~ 170 nm. Consistent with coating effects. Sulfates indicator of the accumulation mode. Particles least affected by atmosphere (persistent) rBC from local sources
  • Roles and Functions of the Correctional System Copyright

    Roles and Functions of the Correctional System Copyright

    Expected to read the Bible when not working or exercising. Use of the "silent system" ... Protects against double jeopardy. The right against self-incrimination. Prohibits taking life, liberty, or property without due process.
  • A Study in Scarlet - Webgarden.cz

    A Study in Scarlet - Webgarden.cz

    Dr. Watson has financial problems and looking for a new roommate. This is of course Sherlock Holmes. In this story they both tries to resolve a mystery about bloody word on the wall Rache … A Study in Scarlet, 1887...
  • Diapositive 1 - orluems.com

    Diapositive 1 - orluems.com

    P r é s e n t a t i o n g l o b a l e Wines exist in Switzerland sincethe roman empire. ... Russin, Dardigny, Lully, Barbonnex, Cologny, Jussy, Choulex, Hermance, Céligny, Collex-Bossy. Swiss wines remain...
  • GREEDY DISTRIBUTED SPANNING TREE ROUTING (GDSTR) CMPE 259:

    GREEDY DISTRIBUTED SPANNING TREE ROUTING (GDSTR) CMPE 259:

    Cmpe 259: Sensor Networks. MATTHEW HENDRICKS. WIRELESS SENSOR NETWORKS. Requirements: Made up of several nodes/sensors. Nodes consist of a CPU, storage, transmitter, and battery. Communications sometimes take many hops to reach the sink. Scalability of sensor networks
  • Glass Science - Washington State University

    Glass Science - Washington State University

    Art, Science, & Technology "It is misleading to divide human actions into 'art,' 'science,' or 'technology,' for the artist has something of the scientist in him, and the engineer of both, and the very meaning of these terms varies with...
  • Logical Database Design and the Relational Model

    Logical Database Design and the Relational Model

    Entity relation >>> Associative entity intersection relation. include as foreign keys in A the primary keys for B and C, these attributes, together, become the primary key of A. These attributes, separately, function as _____ EXAMPLE: next 3 slides