Operating Systems I An Introduction to Operating System

  • Slides: 29
Download presentation
Operating Systems I An Introduction to Operating System Concepts CMSC 104 1

Operating Systems I An Introduction to Operating System Concepts CMSC 104 1

What’s an Operating System? “The Boss” l “The Big Cheese” l “The Godfather” l

What’s an Operating System? “The Boss” l “The Big Cheese” l “The Godfather” l “The Power Behind the Scenes” l A control program the manages all the resources of the computer on which it runs. l CMSC 104 2

OS Introduction l Most computers multitask (do many things “at once”) o read/write disks

OS Introduction l Most computers multitask (do many things “at once”) o read/write disks and tapes o send/receive network traffic o run several programs. l CMSC 104 Resources must be shared and programs coordinated 3

OS Introduction l The operating system manages multitasking systems. o What resources are available.

OS Introduction l The operating system manages multitasking systems. o What resources are available. o Who gets to use them. --- “Not now Bobby, it’s Sally’s turn. ” --l Also provides: o standard interfaces (ways to use) to computer hardware o standard utility programs supporting other software. CMSC 104 4

“Mc. Donalds Model” of an Operating System Fries Customers (Applications) Grill Counter Drinks Crew

“Mc. Donalds Model” of an Operating System Fries Customers (Applications) Grill Counter Drinks Crew (Operating System) Crew Serves Customers Don’t Cross Counter CMSC 104 5

Operating System Evolution “Batch” Operating Systems l “One-at-a-time” in a “batch” o Usually single-task

Operating System Evolution “Batch” Operating Systems l “One-at-a-time” in a “batch” o Usually single-task o Execution required significant setup of equipment and software o Each program was a job (“batch job”) o OS designed to simplify setup and transition between jobs CMSC 104 6

Batch Operating Systems (cont’d) l Operators served as “High Priests. ” o Users didn’t

Batch Operating Systems (cont’d) l Operators served as “High Priests. ” o Users didn’t touch computers �User’s “submitted” jobs �Picked up program output �Written/punched input and instructions �Printed/punched output and error reports o Turn around: minutes to days “Error 410: Unterminated Do Loop, line 66” CMSC 104 7

Operating System Evolution Interactive Processing l OS for Interactive Processing o Started with “operator-like”

Operating System Evolution Interactive Processing l OS for Interactive Processing o Started with “operator-like” single user o Users interact directly via remote terminals (workstations) --- “On-Line processing” o Users demand timely response o Machines too expensive for single users N. B. “real-time” means “must respond in limited time or fail” --- not on-line system CMSC 104 8

Operating System Evolution Time-Sharing Systems Really “time-slicing” systems l Operating system: l o puts

Operating System Evolution Time-Sharing Systems Really “time-slicing” systems l Operating system: l o puts jobs in a “circular queue” o gives each job a predetermined “time slice” o swaps old job out and new one in at the end of each slice o repeats fast enough to give illusion of simultaneously execution CMSC 104 9

Operating System Evolution Time-Sharing Systems (continued) l “Radar O’Reilly” model of operating systems o

Operating System Evolution Time-Sharing Systems (continued) l “Radar O’Reilly” model of operating systems o Read the mail o Make the coffee o Check on Hawkeye o Answer the phone l CMSC 104 Only one job at a time, but all progress “on the average. ” 10

Operating System Evolution Time Sharing (cont’d) l Other Benefits: o best allocation of user

Operating System Evolution Time Sharing (cont’d) l Other Benefits: o best allocation of user time --- no “dead time” at the keyboard o no waiting for peripherals --- other processes can execute while one waits. l Costs: o complexity CMSC 104 11

Operating System Evolution Examples l Batch Systems: o IBM 1620, early MITS l Interactive

Operating System Evolution Examples l Batch Systems: o IBM 1620, early MITS l Interactive systems: o DOS, early Mac. OS, VIC 20, Commodore 64 l Time-Sharing systems: o Unix, Linux, Multics, IBM MVS, DEC VMS o Windows 95/98/NT, later Mac. OS CMSC 104 12

Different Operating Systems on the Same Machine ? l Only one at a time

Different Operating Systems on the Same Machine ? l Only one at a time o VAX: VMS or Ultrix o IBM PCs: Linux or Windows or OS/2 l Emulators let one OS act like another o “Soft-PC”: Mac Windows o “Wine” and “Wabi”: Linux Windows o Cygnus Windows: Win 95/98/NT Unix o Not always complete CMSC 104 13

Inside the Operating System The OS Shell l Defines interface between OS and users

Inside the Operating System The OS Shell l Defines interface between OS and users o Windows GUI o UNIX command line o UNIX users can choose among a variety of shells �csh is the “C shell” �tcsh is an enhanced “C shell” o Shell programming CMSC 104 14

Inside the Operating System OS Shell interface Users O/S Users shell CMSC 104 15

Inside the Operating System OS Shell interface Users O/S Users shell CMSC 104 15

Inside the Operating System Different Shells/Same Results BASH Different Command Sets SH CSH Operating

Inside the Operating System Different Shells/Same Results BASH Different Command Sets SH CSH Operating System Same Results TCSH CMSC 104 16

Inside the Operating System The OS Kernel Central part (“hard nugget”) of Operating System

Inside the Operating System The OS Kernel Central part (“hard nugget”) of Operating System l Kernel Components l o File Manager o Device Drivers o Memory Manager o Scheduler o Dispatcher CMSC 104 17

Inside the Opeating System File Manager l Maintains information about the files that are

Inside the Opeating System File Manager l Maintains information about the files that are available on the system o location o size, type, and protections o what storage is still available l CMSC 104 Files usually allowed to be grouped in directories or folders. Allows hierarchical organization. 18

Inside the Operating System Device Drivers Software to communicate with peripheral devices or controllers

Inside the Operating System Device Drivers Software to communicate with peripheral devices or controllers l Each driver is unique l Translates general requests into specific steps for that device l “read poker. exe” CMSC 104 Device Driver “read device 0 x. A 3, cylinder 3, track 13, sector 43” 19

Inside the Operating System Memory Manager Controls use of main memory l Allocates memory

Inside the Operating System Memory Manager Controls use of main memory l Allocates memory for each program and its data l Reclaims memory when programs release it (or finish). l Is supposed to know what areas are free. “Memory leak” manager loses track l CMSC 104 20

Inside the Operating System Memory Manager (cont’d) l Virtual memory (“Imaginary memory”) o Programs

Inside the Operating System Memory Manager (cont’d) l Virtual memory (“Imaginary memory”) o Programs only need their current data in memory. (“What’s your VIN? ”) o Store remainder on disk & keep location. o Bring other data back (and put this data out) when other data is needed. o Creates the illusion of additional memory by rotating (swapping) programs and data between main memory and mass storage CMSC 104 21

Inside the Operating System Virtual Memory for People Calendar You Sticky notes Notebooks CMSC

Inside the Operating System Virtual Memory for People Calendar You Sticky notes Notebooks CMSC 104 22

Inside the Operating System Scheduler Maintains a record of processes that are present, adds

Inside the Operating System Scheduler Maintains a record of processes that are present, adds new processes, removes completed processes l Tracks l o memory area(s) assigned o priority o state of readiness to execute (ready/wait) CMSC 104 23

Inside the Operating System Dispatcher Executes processes when scheduled and ready l Gives each

Inside the Operating System Dispatcher Executes processes when scheduled and ready l Gives each process a small (50 ms) time slice in which to execute l Stops process when time is up. l Waits for scheduler to update process record l Starts next scheduled process. l CMSC 104 24

What’s a Process The dynamic activity of executing a program l The process state

What’s a Process The dynamic activity of executing a program l The process state is a “snapshot” of the machine, including values of the CPU registers, program counter and other memory cells l A single program can be associated with multiple processes simultaneously l CMSC 104 25

Inside the Operating System Types of software l Applications software Do something “for the

Inside the Operating System Types of software l Applications software Do something “for the outside world. ” l Often transportable l l System Software Performs tasks supporting operation of computer systems (“not outside world”) e. g. operating systems l Usually tightly coupled to hardware l CMSC 104 26

Inside the Operating System Types of software (cont’d) l Utility software o provides fundamental

Inside the Operating System Types of software (cont’d) l Utility software o provides fundamental not included OS (check spelling, count words, calculator) o “extend” the OS (or “support” applications) o Distinction between applications and utilities is often vague o Distinction between OS and utilities is also vague CMSC 104 27

Inside the Operating System Utilities Operating Systems usually come with some associated utility programs

Inside the Operating System Utilities Operating Systems usually come with some associated utility programs l UNIX usually has the text editors emacs and vi (and sometimes pico) l UNIX has its own sort utility l UNIX has its own mail utility l (The contraction “it’s” means “it is, ” not “belonging to it. ”) CMSC 104 28

Inside the Operating System Summary Shell -- interface to user l File Manager --

Inside the Operating System Summary Shell -- interface to user l File Manager -- manages mass memory l Device Drivers -- communicate with peripherals l Memory manager -- manages main memory l Scheduler & Dispatcher -- manage processes l CMSC 104 29