Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
University of Pennsylvania CSE 380 Introduction to Operating Systems Insup Lee Fall 00 9/7/00 CSE 380 1 University of Pennsylvania What is an Operating System? • A piece of software that provides a convenient, efficient environment for the execution of user programs. Users Applications software Systems software Operating systems Hardware 9/7/00 CSE 380 2 University of Pennsylvania Resource Abstraction and Sharing • Hides the details of how the hardware operates • Provides an abstract model of the operation of hardware components – generalize hardware behavior – limit the flexibility in which hardware can be manipulated • Computation model: processes, threads • Resources: memory, disk, files, cpu, etc. 9/7/00 CSE 380 3 University of Pennsylvania Why do we need an operating system? • User viewpoint -- provide user interface, command interpreter, directory structure, utility programs (compilers, editors, filters) • Program environment viewpoint -- enhance the bare machine higher-level I/O, structure files, notion of independent processes, improved store (size, protection) • Efficiency viewpoint -- replace a human operator scheduling jobs, storing I/O (files), invoking necessary programs such as compiler • Economic viewpoint -- allow concurrent uses and good scheduling of resources So, the goals are to make the system convenient to use (via system calls) and to manage resources efficiently. 9/7/00 CSE 380 4 University of Pennsylvania Evolution of an OS • • • • Hardware upgrades New types of hardware New services Fixes 9/7/00 CSE 380 5 University of Pennsylvania Brief History of Operating Systems • • • • • 1940's -- First Computers 1950's -- Batch Processing 1960's -- Multiprogramming (timesharing) 1970's -- Minicomputers & Microprocessors Late 1970's, 1980's -- Networking, Distributed Systems, Parallel Systems • 1990's and Beyond -- PC’s, WWW, Mobile Systems 9/7/00 CSE 380 6 University of Pennsylvania 1940's -- First Computers • Computer dedicated to one user/programmer at a time. Program loaded manually by programmer, using console switches. Debugging using console lights. • Advantages: – Interactive (user gets immediate response) • Disadvantages: – Expensive machine idle most of time, because people are slow. – Programming & debugging are tedious. – Each program must include code to operate peripherals -error prone, device dependencies. • Libraries of subroutines to drive peripherals are example of typical OS service. 9/7/00 CSE 380 7 University of Pennsylvania 1950's -- Batch Processing • User/programmer submits a deck of cards that describes a job to be executed. • Jobs submitted by various users are sequenced automatically by a resident monitor. • Tape drives available for batching of input and spooling of output. • Advantages: – Computer system is kept busier. • Disadvantages: – No longer interactive; longer turnaround time. – CPU is still idle for I/O-bound jobs. • OS issues -- command processor (JCL), protection of resident monitor from user programs, loading of user programs after monitor. 9/7/00 CSE 380 8 University of Pennsylvania 1960's -- Multiprogramming (timesharing) • The advent of the I/O processor made simultaneous I/O and CPU processing possible. • CPU is multiplexed (shared) among a number of jobs -- while one job waiting for I/O, another can use CPU. • Advantages: – Interactiveness is restored. – CPU is kept busy. • Disadvantages: – Hardware and O.S. required become significantly more complex. • Timesharing - switch CPU among jobs for pre-defined time interval • Most O.S. issues arise from trying to support multiprogramming -CPU scheduling, deadlock, protection, memory management, virtual memory, etc. • CTSS (Compatible Time Sharing System), Multics 9/7/00 CSE 380 9 University of Pennsylvania 1970's - Minicomputers & Microprocessors • Trend toward many small to mid-range personal computers, rather than a single mainframe. • Early minicomputers and microprocessors were small, so there was some regression to earlier OS ideas. – e.g. DOS on PC is still essentially a batch system similar to those used in 1960, with some modern OS ideas thrown in (e.g., hierarchical file system). • This trend is changing rapidly because of powerful new microprocessors. • Also, the user interface became more important. • UNIX, DOS 9/7/00 CSE 380 10 University of Pennsylvania Late 1970's, 1980's - Networking • Powerful workstations (e.g., PDP, VAX, Sunstations, etc.) • Local area networks (e.g., Ethernet, Token ring) and longdistance network (Arpanet) • Networks organized with clients and servers • Decentralization of computing requires more communication (e.g., resource sharing) • O.S. issues -- network communication protocols, data encryption, security, reliability, consistency of distributed data • Real-Time Systems – timing constraints, deadlines, QoS (90’s term) 9/7/00 CSE 380 11 University of Pennsylvania 1990's and Beyond • Parallel Computing (tera-flops) • Powerful PCs, Multimedia computers • High-speed, long-distance communication links to send large amounts of data, including graphical, audio and video • World Wide Web • Electronic notebooks using wireless communication technologies • O.S. issues -- Large heterogeneous systems, mobile computing, etc. 9/7/00 CSE 380 12 University of Pennsylvania Basic OS Concepts • Processes: programs in execution • Resources (e.g., files, memory, display) – A process must request it from the OS – The process is blocked until it is allocated • System calls • Shell -- command interpreter 9/7/00 CSE 380 13 University of Pennsylvania Services provided by OS • • • • • Program creation Program execution Access to I/O devices Controlled access to files Error detection and response – hardware errors (e.g., memory error, device failures) – software errors (e.g., overflow, out of memory boundary) • Accounting – collect usage statistics, monitor performance 9/7/00 CSE 380 14 University of Pennsylvania Services Provided by OS (2) • • • • • • • • • • • CPU scheduling: allocate computing time among several processes Memory management: allocate main memory among several processes Swapping: move processes and their data between main memory and secondary storage I/O device drivers: specialized code required to operate I/O devices File system: organize mass storage (disk) into files and directories Utilities: date/time, accounting, file copy, etc. Command interpreter: allow users to enter commands interactively System calls: allow user programs access to O.S. services Protection: keep processes from interfering with each other and system Communication & Resource sharing: allow users/processes to communicate (over networks) and share resources (e.g., laser printers, disks, etc.) Security: protect machines from intruders, worms and viruses 9/7/00 CSE 380 15 University of Pennsylvania Factors in OS Design • Engineering factors: – Performance/Efficiency -- CPU utilization, resource utilization (e.g. disks), response time – Correctness/Reliability -- error-free (no software crashes) – Maintainability -- modular construction, clearly defined interfaces, well-documented – Small in size-- main memory and secondary storage valuable, larger means more error-prone, larger means takes longer to write • Non-engineering factors: – Commercial factors – Standards and open systems 9/7/00 CSE 380 16 University of Pennsylvania Operating System Structure • • • • Monolithic Systems Layered Systems Virtual Machines Client-Server Model 9/7/00 CSE 380 17