290 likes | 432 Views
Operating Systems I. An Introduction to Operating System Concepts. What’s an Operating System?. “The Boss” “The Big Cheese” “The Godfather” “The Power Behind the Scenes” A control program the manages all the resources of the computer on which it runs. OS Introduction.
E N D
Operating Systems I An Introduction to Operating System Concepts
What’s an Operating System? • “The Boss” • “The Big Cheese” • “The Godfather” • “The Power Behind the Scenes” • A control program the manages all the resources of the computer on which it runs.
OS Introduction • Most computers multitask (do many things “at once”) • read/write disks and tapes • send/receive network traffic • run several programs. • Resources must be shared and programs coordinated
OS Introduction • The operating system manages multi-tasking systems. • What resources are available. • Who gets to use them. --- “Not now Bobby, it’s Sally’s turn.” --- • Also provides: • standard interfaces (ways to use) to computer hardware • standard utility programs supporting other software.
Counter Fries Customers(Applications) Drinks Grill Crew(Operating System) “McDonalds Model” of an Operating System Crew Serves Customers. Customers Don’t Cross Counter
Operating System Evolution “Batch” Operating Systems • “One-at-a-time” in a “batch” • Usually single-task • Execution required significant setup of equipment and software • Each program was a job (“batch job”) • OS designed to simplify setup and transition between jobs
Batch Operating Systems (cont’d) • Operators served as “High Priests.” • Users didn’t touch computers • User’s “submitted” jobs • Picked up program output • Written/punched input and instructions • Printed/punched output and error reports • Turn around: minutes to days “Error 410: Unterminated Do Loop, line 66”
Operating System EvolutionInteractive Processing • OS for Interactive Processing • Started with “operator-like” single user • Users interact directly via remote terminals (workstations) --- “On-Line processing” • Users demand timely response • Machines too expensive for single users N.B. “real-time” means “must respond in limited time or fail” --- not on-line system
Operating System EvolutionTime-Sharing Systems • Really “time-slicing” systems • Operating system: • puts jobs in a “circular queue” • gives each job a predetermined “time slice” • swaps old job out and new one in at the end of each slice • repeats fast enough to give illusion of simultaneously execution
Operating System EvolutionTime-Sharing Systems (continued) • “Radar O’Reilly” model of operating systems • Read the mail • Make the coffee • Check on Hawkeye • Answer the phone • Only one job at a time, but all progress “on the average.”
Operating System Evolution Time Sharing (cont’d) • Other Benefits: • best allocation of user time --- no “dead time” at the keyboard • no waiting for peripherals --- other processes can execute while one waits. • Costs: • complexity
Operating System EvolutionExamples • Batch Systems: • IBM 1620, early MITS • Interactive systems: • DOS, early MacOS, VIC20, Commodore 64 • Time-Sharing systems: • Unix, Linux, Multics, IBM MVS, DEC VMS • Windows 95/98/NT, later MacOS
Different Operating Systems on the Same Machine ? • Only one at a time • VAX: VMS or Ultrix • IBM PCs: Linux or Windows or OS/2 • Emulators let one OS act like another • “Soft-PC”: Mac Windows • “Wine” and “Wabi”: Linux Windows • Cygnus Windows: Win95/98/NT Unix • Not always complete
Inside the Operating SystemThe OS Shell • Defines interface between OS and users • Windows GUI • UNIX command line • UNIX users can choose among a variety of shells • csh is the “C shell” • tcsh is an enhanced “C shell” • Shell programming
Inside the Operating SystemOS Shell interface Users Users Users O / S shell
BASH OperatingSystem SH CSH TCSH Inside the Operating SystemDifferent Shells/Same Results Different Command Sets Same Results
Inside the Operating SystemThe OS Kernel • Central part (“hard nugget”) of Operating System • Kernel Components • File Manager • Device Drivers • Memory Manager • Scheduler • Dispatcher
Inside the Opeating SystemFile Manager • Maintains information about the files that are available on the system • location • size, type, and protections • what storage is still available • Files usually allowed to be grouped in directories or folders. Allows hierarchical organization.
Inside the Operating SystemDevice Drivers • Software to communicate with peripheral devices or controllers • Each driver is unique • Translates general requests into specific steps for that device Device Driver “read device 0xA3, cylinder 3, track 13, sector 43” “read poker.exe”
Inside the Operating SystemMemory Manager • Controls use of main memory • Allocates memory for each program and its data • Reclaims memory when programs release it (or finish). • Is supposed to know what areas are free. “Memory leak” manager loses track
Inside the Operating SystemMemory Manager (cont’d) • Virtual memory (“Imaginary memory”) • Programs only need their current data in memory. (“What’s your VIN?”) • Store remainder on disk & keep location. • Bring other data back (and put this data out) when other data is needed. • Creates the illusion of additional memory by rotating (swapping) programs and data between main memory and mass storage
Inside the Operating SystemVirtual Memory for People Calendar You Sticky notes Notebooks
Inside the Operating SystemScheduler • Maintains a record of processes that are present, adds new processes, removes completed processes • Tracks • memory area(s) assigned • priority • state of readiness to execute (ready/wait)
Inside the Operating SystemDispatcher • Executes processes when scheduled and ready • Gives each process a small (50 ms) time slice in which to execute • Stops process when time is up. • Waits for scheduler to update process record • Starts next scheduled process.
What’s a Process • The dynamic activity of executing a program • The process state is a “snapshot” of the machine, including values of the CPU registers, program counter and other memory cells • A single program can be associated with multiple processes simultaneously
Inside the Operating SystemTypes of software • Applications software • Do something “for the outside world.” • Often transportable • System Software • Performs tasks supporting operation of computer systems (“not outside world”) e.g. operating systems • Usually tightly coupled to hardware
Inside the Operating SystemTypes of software (cont’d) • Utility software • provides fundamental not included OS (check spelling, count words, calculator) • “extend” the OS (or “support” applications) • Distinction between applications and utilities is often vague • Distinction between OS and utilities is also vague
Inside the Operating SystemUtilities • Operating Systems usually come with some associated utility programs • UNIX usually has the text editors emacs and vi (and sometimes pico) • UNIX has its own sort utility • UNIX has its own mail utility (The contraction “it’s” means “it is,” not “belonging to it.”)
Inside the Operating SystemSummary • Shell -- interface to user • File Manager -- manages mass memory • Device Drivers -- communicate with peripherals • Memory manager -- manages main memory • Scheduler & Dispatcher -- manage processes