260 likes | 477 Views
Operating Systems. Lecture #11 Dr. Adam P. Anthony. Overview. Operating System History Early OS theory and terminology Operating System Components The many hats an OS wears Glance at the advanced: process management and deadlock Survey of existing operating systems.
E N D
Operating Systems Lecture #11 Dr. Adam P. Anthony
Overview • Operating System History • Early OS theory and terminology • Operating System Components • The many hats an OS wears • Glance at the advanced: process management and deadlock • Survey of existing operating systems
Types of Computer Software • Application software • Performs specific tasks for users • System software • Provides infrastructure for application software • Consists of: • operating system: today’s lecture • utility software: side programs that help other applications (picture viewers, DVD burner software, etc.)
The First “Operating System” Computer Operator http://www.library.upenn.edu/exhibits/rbm/mauchly/jwm8b.html
Early OS History • First Operating System: None at all! • Even in the first desktop computers, to run a new program, a human would insert a new disk, then hit the RESET button (think early game consoles) • Next step: Batch processing • Set up a ‘batch’ of several (say, 5) programs to be run automatically in sequence • But still set up manually by a human • Done to reduce crowds in the computer room • Two main influences in operating system development: interactivity and sharing
Interactivity and Sharing • Interactive Process: computer programs meant to be observed and/or interacted with by a human • Remember, processors are too fast to be observed! • Real-time processing job: anything that cannot be paused and/or accelerated to favor the processor • Music, movies, games, word processors • Sharing: What is a fair way to reserve/allocate computer resources?
The “Dark” Ages of computing • GASP! In the 70’s and 80’s one computer was shared by 100’s of people (and it didn’t even have Farmville!) • This limitation in computing power drove much of computing theory and practice • People began to expect more—to be able to interact with their programs and make decisions in real time • Not fair to give a person exclusive, real-time access to a computer when there were 100’s of others who wished to run their programs (which may not be interactive)
Modern Operating Systems • Modern operating systems deal with past problems using Multi-Programming: • The ability to run multiple programs “simultaneously” (next slide) • Enables time sharing • Multiple users running their own programs at the same time • Enables multitasking • One user running multiple programs at the same time • Time-sharing leads to several modern concepts and problems: • Usernames and passwords to permit/restrict access • Information and Process Security are now necessary
Fitting between the gaps • Processors move faster than the human eye can perceive • Homework problem: “If a typist types 60 words per minute…how much time would pass between typing each character? If a multiprogramming operating system allocated time slices in 20 mSec time units…how many time slices could be allocated between characters being typed? • Idea: we can run a different user’s program in between key presses, and the user will never know the difference • To each user, it appears that their programs are being run exclusively (i.e. it simulates simultaneous execution)
Glance at the Advanced: Process Management • Modern computers will run between 50 and 100 processes “simultaneously” • “Simultaneous” means that programs rapidly take turns using the processor • Process switch: time it takes to freeze a process and record where it left off, then load a new process • What is the best way to decide which program goes next? • Random? • First come, first served? • Priority?
Time Sharing and Load Balancing • Time sharing was invented when computers had only one processor • New computers have 2,4,8+ processors • Time sharing still applied, but to a lesser extent • Also important: load balancing • If one processor is at 90% capacity, and the other is at 15% capacity, it makes sense to balance the system by transferring some processes to run on the second processor • A more difficult task: scaling • Breaking a program up into separate pieces to achieve a speedup
Anatomy of a Modern Operating System Shell Text-based shell Window Manager Kernel Input/output Device Manager Process Manager Drive/File Manager User Access/ Security Manager Network Manager Memory Manager
What an OS Does • Process management (run programs) • File management (store data) • Security (files and programs) • Resource control • Disks • Printers • Monitors/Video Cards • Speakers/Sound Cards • USB/Firewire • Networking • Much more!
Loading the Operating System • In Chapter 2, we learned that a processor does nothing until it receives an instruction • Modern computers follow a bootstrapping process to get the operating system up and running on the computer • Find the OS on the hard drive • Load the OS into memory • Set the program counter at the beginning of the OS instructions
ROM and Firmware • ROM = Read Only Memory • All computers have a small amount of ROM that permanently stores its information • Write a program for the bootstrapping process (find, load, transfer control to OS) and store it on ROM • Configure processor to run program in ROM each time the computer is powered on
Glance at the Advanced: Deadlock • To eliminate conflicts, a process can lock a resource (e.g. only one process can use the printer at the same time) • Imagine: One process has a lock on the printer, but needs access to the hard drive. A second process has a lock on the hard drive, but needs access to the printer. Neither will release their lock until they obtain the other
Conditions for Deadlock • Conditions required for deadlock 1. Competition for non-sharable resources 2. Resources requested on a partial basis 3. An allocated resource can not be forcibly retrieved
Survey of Major Operating Systems • Two dominating classes of operating systems Windows and Unix • We’re familiar with Windows (25+ copies in this room right now!) • Many Versions/Types of Windows • Newer versions build on top of past versions • Strive for backward compatability • Parallel versions: more about controlling price • Better versions = lesser version + more stuff
What is UNIX? • UNIX was (is) originally an operating system in its own right • Originally developed in 1969 by AT&T • UNIX is a name trademarked by The Open Group • Can’t say your operating system is UNIX without their approval • There are also many “unix-like” operating systems which offer nearly-identical functionality • Usually we’ll just say it’s a UNIX system though
Characteristics of a UNIX system • Time-sharing multi-user operating system • Strong emphasis on usernames and passwords • Processes have ‘owners’ • Command-line interface (keyboard only, no windows) • Popular with programmers • Popular with web servers • UNIX is known for being stable over long periods without rebooting
Unix Example: Linux • Linux = Unix-like system created by LinusTorvalds • Major early contributor to the Open-Source Movement • Open source led to many independently controlled variations: Distributions • Linux and most of the software the runs on it is 100% free • Operating system made BY programmers/system administrators, FOR programmers/system administrators • Can be a very enjoyable computing experience if you deal with the steep learning curve
UNIX Example: MAC OS X • Created by Apple in 2000 • Complete re-design of the MAC OS • Threw all their old code out! • Has a UNIX back-end for (they say) stability and power • Also has lots of graphical power in the user-interface to provide a nice windowed experience • Many CS and CIS majors enjoy the ‘best of both worlds’ with MAC OS X • Commercialized, user-friendly experience • UNIX backend allows loading of classic power tools for programming, web servers, and other system administration tasks
Summary • Operating system: first program a computer runs • OS has many roles • Disks/Memory • Input/Output • Process Management • Deadlock: a real problem that Operating Systems work to solve • There are many types of operating systems out there • You DO have a choice!