670 likes | 995 Views
Chapter 10. Operating Systems. Chapter Goals. A little History of Operating Systems Be familiar with current Major Operating Systems Contrast Applications Software and Systems Software Describe the main responsibilities of an operating system.
E N D
Chapter 10 Operating Systems
Chapter Goals • A little History of Operating Systems • Be familiar with current Major Operating Systems • Contrast Applications Software and Systems Software • Describe the main responsibilities of an operating system
More Chapter Goals(OS Responsibilities) • memory and process management • timesharing and the virtual machine illusion • logical and physical addresses • memory management techniques
More Chapter Goals(OS Responsibilities) • fixed and dynamic memory partitions • demand paging and the virtual memory illusion • stages and transitions of the process life cycle • CPU scheduling algorithms
2 Kinds of Software • Application software • Software written to address specific needs • To solve problems in the real world • The reason you buy the machine • System software • Software that manages a computer system at a fundamental level • It provides the tools and an environment in which application software can be created and run
Application Software • Word processing programs, games, inventory control systems, automobile diagnostic programs, and missile guidance programs are all application software • The stuff you want
Systems Software • Operating Systems, File Systems Software, Utilities (Disk Defragmenter), Compilers, Maybe a Web Browser • The stuff you need
Major OS’s • Unix • Windows • Linux • Mac OS • Embedded OS’s (Android, iOS) • Real-Time OS’s
Which is the BEST OS?? • NONE are “best” • Consumer POV • Buy whatever turns you on • Professional POV • Cost, tasks, maintenance, support, legacy issues, popularity (network effects), etc.
A Little History - Mainframes • Mainframes – from 1950 • Earliest computers had no OS at all! • Proprietary (custom) OS’s • VMX • Early Unix versions • Unix was invented at AT&T Bell Labs
Mainframe • Circa 1950
Mainframe • IBM System 360 circa 1964
A Little History - Unix • Mainframes were often shared by many users • A multiuser OS was needed • Unix arose to fill this need • IBM, Digital Equipment Corporation (DEC), Honeywell, Hewlett Packard • Each had their own proprietary version on Unix
A Little History – Early Personal Computers • Microcomputers based on the first integrated CPU chips ~ late 1970’s • MITS Altair 8800 (MS’s big break) • Commodore 64 • Atari ST • TRS 80 • Apple 2 (Apple 1 was a kit) • Each machine had their own proprietary OS (or none at all for the Altair!)
! THE MICROPROCESSOR ! • Intel 8080 – circa 1974
A Little History – PC’s n Macs • PC’s and Macs – 1980’s • IBM PC • IBM hired MS to supply DOS (A basic command-line OS) • MS bought DOS from another party • Apple Macintosh • Apple wrote there own GUI OS • Apple borrowed the idea from Xerox PARC
A Little History – Windows OS • IBM PC needed a GUI • IBM hired MS to write OS2 for PS2 (not Playstation!) • MS wrote Windows at the same time • Guess who won? • Why did MS win? • DOS was a “cash cow” for MS • Windows had backward compatibility w DOS • PC hardware was cheaper than Mac HW
What is Linux??? • Linux is based on a free source code version of UNIX • This source is compiled to Intel CPU machine code • Commercial versions are available • Internal SW architecture is circa 1960’s (A multi-user OS for a single-user machine)
What is Linux??? • It’s all about the $$$$$$ MONEY $$$$$$ • Linus Torvald’s lead the creation of Linux so that he could run UNIX-based code on cheap PC hardware
Where are the computers?? • The machines you SEE • Windows: Almost every desktop in the USA and the world • The machines you DON’T SEE • There are lots of UNIX-based machines behind closed doors
Why is Linux Important Three Main Reasons • Academia CS discipline was built with UNIX systems • Replacement of legacy hardware Linux on PC is cheaper than “Big Iron” • Internet plumbing Is all Unix-based, will not be re-done
Why is Linux ImportantAcademia • There is a lot of code and textbooks written for a UNIX point of view • Linux allows you to use this stuff on cheaper hardware
Why is Linux ImportantThe UNIX Legacy • There is a lot of application code running on old expensive Unix mainframe and workstation machines • Linux is replacing these machines because it runs on cheaper hardware
Why is Linux ImportantThe Internet • Internet routers and other hardware where originally run on old expensive Unix machines • Linux is replacing these machines because it runs on cheaper hardware • Learn Linux if you plan to study computing more
What about Wintell? • Windows/Intel machines will probably hang around as legacy systems, boring, but part of the standard infrastructure. • The “Platform” is standard and widespread • Lots of existing programs for Wintel – it has its own legacy (like UNIX)
Dominant OS’s: The Recent Past • Windows on the “front end” • Linux on the “back end”
Dominant OS’s: Present and Near Future • Mini Front End (Simple Interfacing Tasks) • Tablets and Smart Phones • Maxi Front End (More demanding specialized work) • Windows • Back End (Server processing) • Linux
LETS GET TECHNICAL • A major OS job is to provide: INTERFACES
OS: Interfaces Figure 10.1 An operating system interacts with many aspects of a computer system.
LETS GET TECHNICAL • The OS is there mainly to do what we all learned in Kindergarten: SHARING NICELY
OS: Resource Management • File systems, monitor, keyboard, etc • The OS is in charge of making all the application programs “share nicely” • Examples: • sending keystrokes to correct application • Placing overlapping windows on the screen • Making sure apps don’t access each others memory
Operating System Resource Management (Sharing) • Process Management (Sharing the CPU) • Sharing IO devices • Main (Primary Memory) Management (Shared among many programs) • Disk (Secondary) Memory) Management (More sharing)
OS: Process Management • Process A program in execution • Process managementkeeping track of processes and the states they are in • CPU scheduling determines which process in memory is executed by the CPU at any given instant in time
More History 1950’s-1960’s • Batch Processing • One big (expensive) machine • One human operating system – “The Operator” (ala The Matrix) • Several similar jobs were organized into “batches” that required the same resources • Example: • Load the compiler • Run all the programs to be compiled
History: Batch Processing Figure 10.2 In early systems, human operators would organize jobs into batches
More History: 1960’s-1970’s • Timesharing • One big (expensive) machine • Each user had her own virtual machine, in which all system resources seem to be available for use • In reality, resources are shared • Unix was created as a multi-user timesharing operating system
More History: 1970’s-now • Multitasking • Lots of cheap PC machines • Timesharing evolved into multitasking • ONE user running MANY PROGRAMS • Still, resources must be shared by several programs • Windows was created as a single-user multitasking operating system
Process States • The Process States Figure 10.8 The process life cycle
The Process Control Block • The operating system must manage a large amount of data for each active process • Usually that data is stored in RAM in a data structure called a Process Control Block (PCB) • The OS maintains one PCB for each process
CPU Context Switch • There is only one CPU and therefore only one set of CPU registers • These registers contain the values for the currently executing process • Each time a process is moved to the running state: • Register values for the currently running process are stored into its PCB • Register values of the new running state are loaded into the CPU • This exchange of information is called a context switch
CPU Scheduling • CPU Scheduling Determining which process in the ready state should be moved to the running state • Many processes may be in the ready state • Only one process can be in the running state, actually running at any one time • Which one gets to moved from ready to running?
CPU Scheduling • Nonpreemptive scheduling The currently executing process gives up the CPU voluntarily • Batch Processing, the old Mac OS, Windows 3.1 circa 1990 • Preemptive scheduling The operating system decides to favor another process, preempting the currently executing process • Win 9x and later, Unix, and most other modern OS’s
CPU Scheduling Algorithms First-Come, First-Served • Processes are moved to the CPU in the order in which they arrive in the running state Shortest Job Next • Process with shortest estimated running time in the ready state is moved into the running state first Round Robin • Each process runs for a specified time slice and moves from the running state to the ready state to await its next turn if not finished
First-Come, First-Served Page 336
Shortest Job Next • Looks at all processes in the ready state and dispatches the one with the smallest service time Page 337
Round Robin • Distributes the processing time equitably among all ready processes • Aka “Taking Turns” • The algorithm uses a time slice, which is the amount of time each process is allowed to run before it is the next process’ turn
Round Robin • Suppose the time slice was 50 Page 339