Introduction Content from Operating Systems in Depth Thomas w Doeppner 2011 Operating Systems Principles amp Practices by Anderson and Dahlin 2014 Tannenbaum 2015 Stallings 2015 ID: 675734
Download Presentation The PPT/PDF document "Operating Systems CSCI 411" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Operating SystemsCSCI 411Introduction
Content from
Operating Systems in Depth Thomas w.
Doeppner
©2011
Operating Systems Principles & Practices by Anderson and
Dahlin
2014
Tannenbaum 2015
Stallings 2015
Tutorialspoint.com
M. DomanSlide2
Main PointsReview Computer Systems
Bit of OS
history
and
flavors
Operating system definition
Semester Overview
Identify
services
OS
provides
Understand OS ChallengesSlide3
Main PointsReview Computer Systems
Bit of OS flavors and history
Operating system definition
Define what it is
Identify services it provides
Understand OS ChallengesSlide4
Basic Elements
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Processor ManagementSlide5
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Processor/Memory
Data ExchangeSlide6
Memory Hierarchy
Design constraints on a computer’s memory
How much?
How fast?
How expensive?
If the capacity is there, applications will likely be developed to use it
Memory must be able to keep up with the processor
Cost of memory must be reasonable in relationship to the other components
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide7
The Memory Hierarchy
Going down the hierarchy:
Decreasing cost per bit
Increasing capacity
Increasing access time
Decreasing frequency of access to the memory by the processor
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide8
Cache Memory
Invisible to the OS
Interacts with other memory management hardware
Processor must access memory at least once per instruction cycle
Processor execution is limited by memory cycle time
Exploit the principle of locality with a small, fast memory
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide9
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Cache and Main MemorySlide10
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Cache/Main Memory StructureSlide11
Enter the Operating System
Exploits the hardware resources of one or more processors
Provides a set of services to system users
Manages secondary memory and I/O devices
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide12
An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.
Some popular Operating Systems include Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc.Slide13
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide14
What is an operating system?
Software to manage a computer’s resources for its users and applicationsSlide15
In the Beginning …
There was hardware
processor
storage
card reader
tape drive
drum
And not much else
no operating systemno librariesno compilersSlide16
Programming Without an OS
Assemble all software into a deck of punched cards
Get 15-minute computer slot
pay $75 ($611 in 2010 dollars)
mount tapes containing data
read cards into computer
run program
it probably crashes
output (possibly a dump) goes to printer
Steps 1, 2, 3, and 5 take 10 minutes
leaving 5 minutes for step 4!Slide17
Evolution of
Operating Systems
Stages include:
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide18
Early Operating Systems:Computers Very Expensive
Serial Processing
One
application at a time
Had complete control of hardware
OS was runtime library
Users would stand in line to use the
computerSlide19
Serial Processing
Earliest Computers:
No operating system
Programmers interacted directly with the computer hardware
Computers ran from a console with display lights, toggle switches, some form of input device, and a printer
Users have access to the computer in “series”
Problems:
Scheduling:
Most installations used a hardcopy sign-up sheet to reserve computer time
Time allocations could run short or long, resulting in wasted computer time
Setup time
A considerable amount of time was spent on setting up the program to run
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide20
Simple Batch Systems
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
The
problems with Batch Systems are as follows −
Lack
of interaction between the user and the job.CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU.Difficult to provide the desired priority.Slide21
Batch Systems
Structure
of a typical Fortran job.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide22
Job Control Language (JCL)
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide23
Multiprogrammed
Batch Systems
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide24
Uniprogramming
The processor spends a certain amount of time executing, until it reaches an I/O instruction; it must then wait until that I/O instruction concludes before proceeding
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide25
Multiprogramming
Also known as multitasking
Memory is expanded to hold three, four, or more programs and switch among all of them
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide26
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 everyone’s tasks quickly
As computers became cheaper, more important to optimize for user time, not computer timeSlide27
Following are some of important functions of an operating System.
Processor Management
Memory
Management
File Management
Device
Management
SecurityControl over system performanceJob accounting
Error detecting aidsCoordination between other software and usersSlide28
Symmetric
Multiprocessing (SMP)
Term that refers to a computer hardware architecture and also to the OS behavior that exploits that architecture
The OS of an SMP schedules processes or threads across all of the processors
The OS must provide tools and functions to exploit the parallelism in an SMP system
Multithreading and SMP are often discussed together, but the two are independent facilities
An attractive feature of an SMP is that the existence of multiple processors is transparent to the user
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide29
SMP Advantages
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide30
Multicore Computer
Also known as a chip multiprocessor
Combines two or more processors (cores) on a single piece of silicon (die)
Each core consists of all of the components of an independent processor
In addition, multicore chips also include L2 cache and in some cases L3 cache
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide31
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide32
Operating System Services
Program development
Program execution
Access I/O devices
Controlled access to files
System access
Error detection and response
Accounting
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide33
Programs
Data
Code
Memory
Processor
Disk
Disk
ProcessorSlide34
Process
Fundamental to the structure of operating systems
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide35
Components of
a Process
The execution context is essential:
It is the internal data by which the OS is able to supervise and control the process
Includes the contents of the various process registers
Includes information such as the priority of the process and whether the process is waiting for the completion of a particular I/O event
A process contains three components:
An executable program
The associated data needed by the program (variables, work space, buffers, etc.)
The execution context (or “process state”) of the program
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide36
Process Control Blocks
PID
Terminated children
Link
Return code
Process Control Block
PID
Terminated children
Link
Return code
PID
Terminated children
Link
Return codeSlide37
Operating System ServicesSlide38
The Operating System as Resource Manager
The OS is responsible for controlling the use of a computer’s resources, such as I/O, main and secondary memory, and processor execution time
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide39
Operating System
as Resource Manager
Functions in the same way as ordinary computer software
Program, or suite of programs, executed by the processor
Frequently relinquishes control and must depend on the processor to allow it to regain control
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide40
Memory ManagementSlide41
Memory Management
The OS has
five
principal storage management responsibilities:
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide42
Process Management
The entire state of the process at any instant is contained in its context
New features can be designed and incorporated into the OS by expanding the context to include any new information needed to support the feature
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide43
Virtual Memory
A facility that allows programs to address memory from a logical point of view, without regard to the amount of main memory physically available
Conceived to meet the requirement of having multiple user jobs reside in main memory concurrently
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide44
Device ManagementSlide45
I/O OperationAn I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide the peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device drivers.
I/O operation means read or write operation with any file or any specific I/O device.
Operating system provides the access to the required I/O device when required.Slide46
I/O Techniques
When the processor encounters an instruction relating to I/O, it executes that instruction by issuing a command to the appropriate I/O module
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide47
Programmed I/O
The I/O module performs the requested action then sets the appropriate bits in the I/O status register
The processor periodically checks the status of the I/O module until it determines the instruction is complete
With programmed I/O the performance level of the entire system is severely degraded
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide48
Interrupt-Driven I/O
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide49
Direct Memory Access
Transfers the entire block of data directly to and from memory without going through the processor
Processor is involved only at the beginning and end of the transfer
Processor executes more slowly during a transfer when processor access to the bus is required
More efficient than interrupt-driven or programmed I/O
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide50
Abstractions
Hardware
disks
memory
processors
network
monitor
keyboardmouse
Operating system
files
programs
threads of control
communication
windows, graphics
input
locatorSlide51
Files
Memory
Disk
DiskSlide52
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 synchronousSlide53
File-Descriptor Table
0
1
2
3
.
.
.
n–1
File-descriptor
table
File descriptor
User
address space
Kernel address space
ref
count
access
mode
file
location
inode
pointerSlide54
Files (1)Figure 1-14. A file system for a university department.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide55
Files (2)Figure 1-15. (a) Before mounting, the files on the CD-ROM are not accessible. (b) After mounting, they are part of the file hierarchy.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide56
Files (3)Figure 1-16. Two processes connected by a pipe.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide57
Device Management
An
Operating System manages device communication via their respective drivers. It does the following activities for device management −
Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.Slide58
Scheduling ProcessesAvoiding DeadlocksSlide59
Virtual MachinesFigure 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. Slide60
The Operating System ZooMainframe Operating Systems
Server Operating Systems
Multiprocessor Operating Systems
Personal Computer Operating Systems
Handheld Computer Operating Systems
Embedded Operating Systems
Sensor Node Operating Systems
Real-Time Operating Systems
Smart Card Operating Systems
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide61
Monolithic Systems (1)Basic structure of OS
A main program that invokes the requested service procedure.
A set of service procedures that carry out the system calls.
A set of utility procedures that help the service procedures.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide62
Monolithic Systems (2)Figure 1-24. A simple structuring model
for a monolithic system.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide63
MicrokernelsFigure 1-26. Simplified structure of the
MINIX 3 system.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide64
Virtual MachinesFigure 1-28. The structure of VM/370 with CMS.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide65
Virtual Machines RediscoveredFigure 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. Slide66
Client-Server ModelFigure 1-27. The client-server model over a network.
Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Slide67
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide68
Multicore Computer
Also known as a chip multiprocessor
Combines two or more processors (cores) on a single piece of silicon (die)
Each core consists of all of the components of an independent processor
In addition, multicore chips also include L2 cache and in some cases L3 cache
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.Slide69
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.