University of Pennsylvania 9/7/00CSE 3801 CSE 380 Introduction to Operating Systems Insup Lee Fall 00
University of Pennsylvania 9/7/00CSE 3802 What is an Operating System? A piece of software that provides a convenient, efficient environment for the execution of user programs. Hardware Operating systems Systems software Applications software Users
University of Pennsylvania 9/7/00CSE 3803 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.
University of Pennsylvania 9/7/00CSE 3804 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.
University of Pennsylvania 9/7/00CSE 3805 Evolution of an OS Hardware upgrades New types of hardware New services Fixes
University of Pennsylvania 9/7/00CSE 3806 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
University of Pennsylvania 9/7/00CSE '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.
University of Pennsylvania 9/7/00CSE '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.
University of Pennsylvania 9/7/00CSE '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
University of Pennsylvania 9/7/00CSE '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
University of Pennsylvania 9/7/00CSE Late 1970's, 1980's - Networking Powerful workstations (e.g., PDP, VAX, Sunstations, etc.) Local area networks (e.g., Ethernet, Token ring) and long- distance 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)
University of Pennsylvania 9/7/00CSE '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.
University of Pennsylvania 9/7/00CSE 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
University of Pennsylvania 9/7/00CSE 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
University of Pennsylvania 9/7/00CSE 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
University of Pennsylvania 9/7/00CSE 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
University of Pennsylvania 9/7/00CSE Operating System Structure Monolithic Systems Layered Systems Virtual Machines Client-Server Model