Operating System Overview CS-550: Comparative Operating Systems Operating System • A program that controls the execution of application programs • An interface between applications and hardware CS-550: Comparative Operating Systems 2 Operating System Objectives • Convenience – Makes the computer more convenient to use • Efficiency – Allows computer system resources to be used in an efficient manner • Ability to evolve – Permit effective development, testing, and introduction of new system functions without interfering with service CS-550: Comparative Operating Systems 3 Layers of Computer System CS-550: Comparative Operating Systems 4 Services Provided by the Operating System • Program development – Editors and debuggers • • • • • • Program execution Access to I/O devices Controlled access to files System access Error detection and response Accounting CS-550: Comparative Operating Systems 5 Operating System as Resource Manager • Responsible for managing all computer resources • Functions same way as ordinary computer software – It is program that is executed • Operating system relinquishes control of the processor to execute other programs CS-550: Comparative Operating Systems 6 Kernel • Portion of operating system that is in main memory • Contains most-frequently used functions • Also called the nucleus CS-550: Comparative Operating Systems 8 Operating Systems History • Early 1950s: – Systems: Univac I, II; IBM 701, 704 – large, very expensive • Serial Processing – No operating system – Machines run from a console with display lights and toggle switches, input device, and printer – Common concerns: • Idle time between jobs • Setup: running a job included loading the compiler, source program, saving compiled program, and loading and linking • Every programmer writes routines to control I/O devices CS-550: Comparative Operating Systems 9 First Generation: Simple Batch Systems • Eastern Joint Computer Conference in 1953: informal discussion of IBM users • GM develops input/output system for IBM 701 – Common set of procedures for access to I/O devices – Monitor concept: Resides in main memory and controls the running programs; Batches jobs together; Program branches back to monitor when finished; Monitor starts next job • GM and North American Aviation jointly develop supervisor program for IBM 704 • ‘Share’ Operating System (SOS) developed by IBM on 709 for Share user group – Supervisory control, buffered I/O, symbolic assembly language CS-550: Comparative Operating Systems 10 First Generation: Simple Batch Systems (Cont.) • Fortran Monitor System (FMS) on IBM 709 – Based on GM/NAA OS, first OS to support high-level language programming • Real-Time and Transaction processing Systems – SAGE real-time control system (IBM AN/FSQ7 military system) – SABRE airline reservation system (IBM for American Airlines) • Tape Operating Systems – Card input and output temporarily stored on tape – Commonly used procedures (compilers) kept on tape – Examples: TOS/360 for first S/360, TOS for RCA Spectra 70 CS-550: Comparative Operating Systems 11 First Generation: Simple Batch Systems (Cont.) • Disk Operating Systems – Direct access to large amounts of data – Operating systems provided by computer manufacturer – Components: resident loader, Job Control Language (JCL), Input/Output Control System (IOCS) – Examples: Admiral for Honeywell 1800, EXEC I for Univac 1107, Scope for Control Data 6000, Master Control Program for Burroughs 5000, IBSYS for IBM 709 and 7090 • ATLAS – Developed by Manchester Univ. and Ferranti – First use of interrupts, extracode (precursor of system call instruction), and one-level store (precursor of virtual memory) CS-550: Comparative Operating Systems 12 First Generation: Batch Multiprogramming • Batch processing: each job submitted as a ‘batch’ of cards • Batch serial: jobs processed one at a time, each one finishing before new one accepted • Batch multiprogramming: several programs execute in interleaved manner and share CPU, memory, I./O devices – when a program waits for I/O completion, CPU given to other program • SPOOLing (Simultaneous Peripheral Operation OnLine) – Spooler program reads jobs from cards and tapes onto disk and copies output from disk to printer CS-550: Comparative Operating Systems 13 First Generation: Batch Multiprogramming • Master Control Program (MCP) for Burroughs 5000 pioneered multiprogramming – Virtual memory – Priorities – High-level languages (Algol, Cobol) supported using compilers • IBM System/360 family (1964) – – – – – – Evolvable: same program runs on entire family DOS/360: interim disk OS PCP: early version of OS/360 OS/MFT: batch multiprogramming for small S/360s OS/MVT: batch multiprogramming for large S/360s JCL: Large and powerful Job Control Language CS-550: Comparative Operating Systems 14 Time-Sharing Systems • Disadvantages of batch systems: – No direct user-program interaction – Long turnaround time • Interactive computing – User and system programs on disk – JCL commands entered by user directly on terminal • Time-sharing systems – Multiple users simultaneously access the system through terminals – Processor’s time is shared among the multiple users – Time slice (time quantum) limits the amount of time (CPU) received by each job CS-550: Comparative Operating Systems 15 Time-Sharing Systems (Cont.) • Compatible Time-Sharing System (CTSS) developed in early 60s by Project MAC at MIT on IBM 709, then 7094 • Dartmouth Time-Sharing System (DTSS) – Dartmouth College with General Electric – ‘Basic’ language developed for use on DTSS • TOPS-10 developed by DEC for PDP-10 • TSS/360 developed by IBM for 360/67 – Virtual memory CS-550: Comparative Operating Systems 16 Time-Sharing Systems (Cont.) • MULTICS developed by project MAC (MIT, Bell Labs, GE) as successor of CTSS (1964) – Hardware: modified GE635 (called GE645) with virtual memory and protection support – ‘Computing Utility’ concept – Segmented virtual memory, linking and loading segments on demand, files and segments treated the same – ‘Rings of protection’ – Hierarchical file system – Device independence – I/O redirection – Powerful user interface – Written in a high-level language (PL/1) CS-550: Comparative Operating Systems 17 Abstract and Virtual Machines • T.H.E. developed by Dijkstra at the Technological Univ. in Eindhoven, Holland in late 1960s – Major contributions to OS structuring and process synchronization – Structuring: • Hierarchical structure made of layers • Each layer, an abstract machine, i.e. apparent extension of real machine – Interacting processes (sharing common resources) • Semaphores for process synchronization • Deadlock solutions CS-550: Comparative Operating Systems 18 Abstract and Virtual Machines (Cont.) • TENEX developed by Bolt, Beranek and Newman (BBN) for the PDP-10 in early 1970s – Time-sharing system with an abstract machine structure • CP/CMS (Control Program/Conversational Monitor System) developed by IBM Research in Cambridge, MA – Virtual machine concept: apparent access to all machine features (virtual memory, CPU, I/O devices) – Hardware shared by several OSs (some being developed) – Hardware: • Modified S/360 model 40 (CP/40) • Modified S/360 model 67 (CP/67) – Product: VM/370 on S/370 CS-550: Comparative Operating Systems 19 Minicomputer Operating Systems • Mid-1950s: Burroughs E-101, Bendix G-15, Librascope LGP-30 – Machine language, no OS • Early 1960s: CDC-160, IBM-1620 • Early 1970s: DEC OS-8 and TSS-8 for PDP-8 – Interrupts, DMA • Disk Operating System for IBM 1800 • Oss named ‘keyboard monitor’ and ‘real-time monitor’ – Interactive interface for single user – Run one program at a time – Typical application: real-time control of lab. Operation • DEC PDP-11 series – OS (RT-11) simple single user – RSTS time-sharing system – RSX-11 real-time executive (multiprogramming, memory management, file system, powerful command language) CS-550: Comparative Operating Systems 20 UNIX • Early 1970s: Bell Labs winds down MULTICS participation, Ken Thompson and Dennis Richie design a new OS • Hardware: PDP-7 then PDP-11 • Key features – – – – Hierachical file system I/O devices, special cases of files Powerful command language: ‘Shell’ Redirection: input/output from/to any sourse/destination in a Shell command – Concurrent processes with inter-process communication – Languages • Assembly language initially (PL/I not available for PDP) • Richie developed ‘C’ (BCPL B C) • ‘C’ compiler for PDP-11 developed • UNIX re-written in ‘C’ CS-550: Comparative Operating Systems 21 Large Systems: Super-Minis and Main Frame Systems • VAX/VMS for the VAX family from DEC – Special instructions for OS support – Extensive system services – File management techniques • UNIX implemented on the VAX • OS/MVS (Multiple Virtual Storage) – Upgrade of OS/MVT for time-sharing (S/370) based on the Time-Sharing Option (TSO) developed for MVT CS-550: Comparative Operating Systems 22 Operating Systems for Micros • Early OSs: MITS, IMSAI, Apple, Tandy, Heath develop simple OSs (loaders, ‘Basic’ language) running on Intel 8080, Zilog’s Z-80, Motorola’s 6800 • CP/M (Control Program for Microprocessors) – – – – – – – Developed by Gary Killdall at Intel on 8008, then 8080 Single user OS Simple interactive command interface Basic I/O device management Floppy disk based file system Programming language for microprocessors (PL/M) Killdall obtains rights to distribute CP/M, forms Digital Research – CP/M becomes dominant OS for micros CS-550: Comparative Operating Systems 23 Operating Systems for Micros (Cont.) • CP/M limitations – Limited user interface, file, and device management – No memory management, no multiprogramming • SCP-DOS from Seattle Computer Products – Running on Intel 8086 (16-bit) – New features: memory management, timer management, interrupt support, sophisticated file system • MS-DOS: Upgraded SCP-DOS to run on several processors (SCP-DOS acquired by Microsoft) • PC-DOS: Version of MS-DOS selected by IBM to run on their PC • UNIX influence: – MS-DOS Version 2.0: Command interface like ‘Shell’, hierarchical file system – Later versions of MS-DOS: Multiple users, multiple processes CS-550: Comparative Operating Systems 24 Major Achievements • Processes • Memory Management • Information protection and security • Scheduling and resource management • System structure CS-550: Comparative Operating Systems 25 Processes • Definitions for the term process – – – – A program in execution An instance of a program running on a computer The entity that can be assigned to and executed on a processor A unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources • Process components – An executable program – Associated data needed by the program – Execution context of the program or process state (e.g., contents of various processor registers, priority of the process) CS-550: Comparative Operating Systems 26 Memory Management • Process isolation • Automatic allocation and management • Support for modular programming • Protection and access control • Long-term storage CS-550: Comparative Operating Systems 27 Information Protection and Security • Access control – Regulating user access to the total system, subsystems, and data – Regulating process access to various resources • Information flow control – Regulating the flow of data within the system and its delivery to users • Certification – Proving that access and flow control perform according to specifications and that they enforce desired protection and security policies CS-550: Comparative Operating Systems 28 Scheduling and Resource Management • The operating system: – Manages the various resources: main memory space, I/O devices, and processors, and – Schedules their use by the active processes • The resource allocation and scheduling policy must consider: – Fairness • Give equal and fair access to all processes – Differential responsiveness • Discriminate between different classes of jobs with different service requirements – Efficiency • Maximize throughput, minimize response time, and accommodate as many users as possible CS-550: Comparative Operating Systems 29 System Structure • The size and complexity of operating systems have significantly increased in time to meet the needs of new features and complex hardware: – – – – – CTSS: 32,000 36-bit words of storage OS/360: 1 million machine instructions MULTICS: 20 million instructions Windows NT 4.0: 16 million lines of code Windows 2000: 32 million lines of code • Methods for structuring operating system software – Modular software – Hierarchical structure: hierarchical layers and information abstraction • View the system as a series of levels • Each level performs a related subset of functions • Each level relies on the next lower level to perform more primitive functions CS-550: Comparative Operating Systems 30 Operating System Design Hierarchy Level Name Objects Example Operations 13 Shell User programming Statements in shell language environment 12 User processes User processes Quit, kill, suspend, resume 11 Directories Directories Create, destroy, attach, detach, search, list 10 Devices External devices: printers, displays and keyboards Open, close, read, write 9 File system Files Create, destroy, open, close read, write 8 Communications Pipes Create, destroy, open. close, read, write CS-550: Comparative Operating Systems 31 Operating System Design Hierarchy Level Name Objects Example Operations 7 Virtual Memory Segments, pages Read, write, fetch 6 Local secondary store Blocks of data, device channels Read, write, allocate, free 5 Primitive processes Primitive process, semaphores, ready list Suspend, resume, wait, signal 4 Interrupts Interrupt-handling programs Invoke, mask, unmask, retry 3 Procedures Procedures, call stack, display Mark stack, call, return 2 Instruction Set Load, store, add, subtract 1 Electronic circuits Evaluation stack, microprogram interpreter Registers, gates, buses, etc. Clear, transfer, activate, complement CS-550: Comparative Operating Systems 32 Characteristics of Modern Operating Systems • Microkernel Architecture – Only a few essential functions are assigned to the kernel (address space, inter-process communication, and basic scheduling) – Other OS services are provided by processes (servers) that run in user mode • Symmetric MultiProcessing (SMP) – There are multiple processors – These processors share same main memory and I/O facilities and are interconnected by an internal connection scheme – All processors can perform the same functions CS-550: Comparative Operating Systems 33 Characteristics of Modern Operating Systems • Multithreading: process is divided into threads that can run concurrently – Thread • Dispatchable unit of work • Includes processor context • executes sequentially and is interruptable – Process • A collection of one or more threads and associated system resources CS-550: Comparative Operating Systems 34 Characteristics of Modern Operating Systems • Distributed operating systems – Provide the illusion of a single main memory and single secondary memory space – State of the art for distributed operating systems lags that of uniprocessor and SMP operating systems • Object-oriented design – Facilitates adding modular extensions to a small kernel – Enables programmers to customize an operating system without disrupting system integrity CS-550: Comparative Operating Systems 35 Windows 2000 (W2K): Brief History • MS-DOS and PC-DOS – DOS 1.0 released in 1981 had 4,000 lines of assembly source code, ran in 8Kbytes of memory on a 8086 – DOS 2.0 in 1983 ran on the IBM hard-disk based PC XT with 24Kbytes of memory resident OS • Support for hard disk • Hierarchical directories • UNIX-like features: I/O redirection and background printing – DOS 3.0 in 1984 ran on the PC AT (80286) with 36Kbytes – DOS 3.1, also in 1984, provided support for PC networking – DOS 3.3, in 1987 ran on IBM PS/2 with 46Kbytes CS-550: Comparative Operating Systems 36 Windows 2000 (W2K): Brief History • Need for a new operating system – MS-DOS/PC-DOS did not use the full capabilities of the evolving processors: 80286, 80386, 80486 and then Pentium (e.g., extended addressing, memory protection) – To compete with Macintosh, in 1990 Microsoft developed a graphical user interface (GUI), Windows 3.0, that had to run on top of DOS • Microsoft and IBM attempt to jointly develop a common operating system; attempt fails; IBM develops OS/2 (multitasking, multithreaded), Microsoft develops Windows NT CS-550: Comparative Operating Systems 37 Windows 2000 (W2K): Brief History • Windows NT – NT 3.1 released in 1993 • 32-bit operating system with ability to support older DOS and Windows applications, as well as provide OS/2 support • Same GUI as Windows 3.1 – NT 3.x, several versions – NT 4.0 • Same internal architecture as 3.x • Same user interface as Windows 98 • Several graphics components moved to NT Executive (kernel mode) • Windows 2000 (W2K) – Same Executive and microkernel architecture as NT 4.0 – New services and functions in support of distributed processing – W2K Professional vs. W2K Server CS-550: Comparative Operating Systems 38 Single-User and Multi-User Multitasking • W2K (like OS/2 and MacOS) was design to exploit the capabilities of 32-bit microprocessors to meet the increasing needs of new applications • Motivations for multitasking – Applications have become more complex and interrelated (e.g., use of a word processor, a drawing program, and a spreadsheet application simultaneously for a document) – Growth of client/server computing: system needs to support user interaction concurrently with inter-processor communication • W2K Professional supports single-user multitasking, while W2K Server supports multi-user multitasking CS-550: Comparative Operating Systems 39 Windows 2000 Architecture • Modular structure for flexibility • Executes on a variety of hardware platforms • Supports application written for a variety of other operating system • Currently, W2K is only implemented on the Pentium/x86 platform • Separates application-oriented software from operating system software – OS software includes the Executive, the microkernel, device drivers, and the hardware abstraction layer and runs in kernel mode (access to system data and to hardware) – Application software runs in user mode and has limited access to user data CS-550: Comparative Operating Systems 40 CS-550: Comparative Operating Systems 41 OS Organization • Modified microkernel architecture – Not a pure microkernel: Many system functions outside of the microkernel run in kernel mode (reason: performance) • Highly modular structure – Each system function is managed by just one component of the OS: the rest of the OS and all applications access that component using a standard interface – Key system data can only be accessed through the appropriate function – Any module can be removed, upgraded, or replaced without rewriting the entire system CS-550: Comparative Operating Systems 42 OS Organization – Layered Structure • Hardware Abstraction Layer (HAL): Maps between generic hardware commands and responses and those unique to a specific platform • Microkernel: Consists of the most used and most fundamental components of the OS. Manages thread scheduling, process switching, exception and interrupt handling, and multiprocessor synchronization. It does not run in threads: not preemptable nor pageable • Device Drivers: File system and hardware device drivers that translate user I/O function calls into specific hardware device I/O requests • I/O Manager: Dispatches requests to appropriate device drivers • Object Manager: Creates, manages, and deletes Executive objects • Security reference monitor: Enforces access-validation and audit-generation rules • Process/thread manager: Creates/deletes objects and tracks process and thread objects • Local Procedure Call (LPC) Facility: Enforces client/server relationship between applications and executive subsystems within a single system CS-550: Comparative Operating Systems 43 OS Organization – Layered Structure Cont.) • Virtual memory manager: Maps virtual addresses in process’s address space to physical pages in memory • Cache manager: Improves performance of file-based I/O (read from cache, defer write) • Windows/graphics modules: Creates the windows-oriented screen interface and manages the graphics devices • User processes: – Special system support processes: Services not included in W2K (e.g., logon process) – Server processes: Other W2K services (e.g., event logger) – Environment subsystems: Supported subsystems are Win32, Posix, and OS/2 – User applications: Can be of five types Win32, Posix, OS/2, Windows 3.1 or MS-DOS CS-550: Comparative Operating Systems 44 Client/Server Model • Operation: – A client (e.g., application program or another OS module) requests a service by sending a message – Message routed through the Executive to appropriate server – Server performs requested operation and returns results or status with another message – Message routed through Executive back to client • Advantages of client/server architecture: – – – – Simplifies the Executive: possible to construct a variety of APIs Improves reliability: clients cannot not directly access hardware Provides a uniform means fro applications to communicate via LPC Provides base for distributed computing CS-550: Comparative Operating Systems 45 Threads and SMP • W2K features that support threads and SMP: – OS routines can run on any available processor and different routines can execute simultaneously on different processors – Multiple threads of execution within a single process may execute on different processors simultaneously – Server processes may use multiple threads to process requests from many clients simultaneously – W2K provides mechanisms for sharing data and resources between processes and flexible interprocess communication capabilities CS-550: Comparative Operating Systems 46 UNIX • Brief history (cont.) – First widely available version outside Bell Labs was Version 6, in 1976 – Version 7, released in in 1978, is the ancestor of modern UNIX systems – Most important non-AT&T development done at U. of C. at Berkeley, called UNIX BSD, running first on PDP, then VAX – In 1982, Bell Labs combined several AT&T versions into a system marketed as UNIX System III – A number of new features were developed to produce UNIX System V – Traditional UNIX systems: System V Release 3 (SVR3), 4.3BSD • Traditional UNIX system characteristics: – Hardware is surrounded by the operating-system called kernel – UNIX comes with a number of user services and interfaces (I.e., shell, other interface software, and the components of the C compiler) – Runs on a single processor and has limited protection capabilities CS-550: Comparative Operating Systems 47 UNIX CS-550: Comparative Operating Systems 48 Modern UNIX Systems • System V Release 4 (SVR4) – Developed jointly by AT&T and Sun Microsystems, combined features from SVR3, 4.3BSD, Microsoft Xenix System V, and SunOS – New features: real-time processing support, process scheduling classes, dynamically allocated data structures, virtual memory management, virtual file system, and a preemptive kernel – Runs on machines ranging from 32-bit microprocessors up to supercomputers • Solaris 2.x – Sun’s SVR4-based UNIX release – Provides a number of advanced features: fully preemptable, multithreaded kernel, full support for SMP, and an object-oriented interface to file systems – Is is the most widely used and most successful commercial UNIX implementation • 4.4BSD • Linux CS-550: Comparative Operating Systems 49 Modern UNIX Systems (Cont.) • 4.4BSD – Berkeley Software Distribution (BSD) series of UNIX releases has played a key role in the development of OS theory – Most enhancements to UNIX first appeared in BSD versions – 4.xBSD is widely used in academic installations and has served as the basis of a number of commercial UNIX products – 4.4BSD is the final version of BSD to be released by Berkeley and includes a new virtual memory system and changes in the kernel structure • Linux CS-550: Comparative Operating Systems 50 Modern UNIX Systems (Cont.) • Linux – Started as a UNIX variant for the IBM PC architecture written by Linus Torvalds and posted on Internet in 1991 – A large number of collaborators contributed to the development of Linux under the control of Torvalds – Linux is free and the source code is available under the auspices of the Free Software Foundation (FSF) – Today, Linux is a full-featured UNIX system running on a variety of platforms – Linux key advantages: • Modular structure: kernel organized as a collection of loadable modules; a module can be loaded and linked into the kernel while the kernel is in memory and executing • With source code available, vendors can tweak applications and utilities to meet specific requirements CS-550: Comparative Operating Systems 51