Operating Systems Lecture 1 PDF
Document Details
Uploaded by Deleted User
2021
Dr. Rashad A. A. Ragb
Tags
Summary
This document is an introductory lecture on Operating Systems, focusing on core concepts and the role of an OS. It includes basic definitions about operating systems and the functions they carry out. This lecture also includes a review of the history and evolution of operating systems design.
Full Transcript
10/11/2021 M 317: Operating Systems Chapter 1: Introduction Dr. Rashad A. A. Ragb [email protected] Chapter 1 Class outline Introduction, concepts, review & historical perspective Processes ...
10/11/2021 M 317: Operating Systems Chapter 1: Introduction Dr. Rashad A. A. Ragb [email protected] Chapter 1 Class outline Introduction, concepts, review & historical perspective Processes Synchronization Scheduling Deadlock Memory management I/O management File systems Security & protection Distributed systems (as time permits) Chapter 1 2 1 10/11/2021 Contents Today's Topic: Introduction to Operating Systems We will learn 1. What is Operating System? 2. What OS does? 3. Structure of OS 4. Evolution of OS Batch Processing, Multiprogramming, Time sharing systems 5. Operating System Functions Main Functions of OS 6. Types of OS Single User, Multi User systems 7. Operating System concepts References Textbook W. Stallings, Operating Systems Internals and Design Principles, 6th edition, 2009. Reference A. Silberschatz, P. B. Galvin, G. Gagne, Operating Systems Principles, 7th edition, 2006. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall. 2 10/11/2021 Grading (subject to adjustment) 10% Homework and practical = 20 10% project and attendance = 20 10% Mid exam1 = 20 70% Final Exam = 140 5 The landscape of operating systems (as of 2014) 3 10/11/2021 The OS wars (in 2006) Operating System A program that controls and supports the usage of computer systems Main objectives of an OS: Convenience Efficiency Ability to evolve 4 10/11/2021 Control The operating system controls the usage of the computer resources - hardware devices and software utilities. Processors Main memory Secondary Memory Peripheral devices Information Support Services to assist the users of the computer system: For the programmers: Utilities - debuggers, editors, file management, etc. For the end users - interface to the application programs For programs - loads instructions and data into memory, prepares I/O devises for usage, handles interrupts and error conditions. 5 10/11/2021 What is OS? Operating System is a software, which makes a computer to actually work. It is the software the enables all the programs we use. The OS organizes and controls the hardware. OS acts as an interface between the application programs and the machine hardware. Examples: Windows, Linux, Unix and Mac OS, etc., What is OS? Resource allocator – manages and allocates resources. (CPU time, memory space, file-storage space, I/O devices…) Since there maybe many – possibly conflicting – requests for resources, the OS must decide which requests are allocated resources so that it can operate the computer system efficiently and fairly. 12 6 10/11/2021 What is OS? Control program – controls the execution of user programs to prevent errors and improper use of the computer. It is especially concerned with the operation and control of I/O devices. Kernel – the one program running at all times (all else being application programs). 13 What OS does? An operating system performs basic tasks such as, controlling and allocating memory, prioritizing system requests, controlling input and output devices, facilitating networking and managing file systems. 7 10/11/2021 Structure of Operating System: Application Programs System Programs Software (Operating System) HARDWARE (Contd…) Structure of Operating System (Contd…): The structure of OS consists of 4 layers: 1. Hardware Hardware consists of CPU, Main memory, I/O Devices, etc, 2. Software (Operating System) Software includes process management routines, memory management routines, I/O control routines, file management routines. (Contd…) 8 10/11/2021 Structure of Operating System (Contd…): 3. System programs This layer consists of compilers, Assemblers, linker etc. 4. Application programs This is dependent on users need. Ex. Railway reservation system, Bank database management etc., Evolution of OS: The evolution of operating systems went through seven major phases. Six of them significantly changed the ways in which users accessed computers through the open shop, batch processing, multiprogramming, timesharing, personal computing, and distributed systems. In the seventh phase the foundations of concurrent programming were developed and demonstrated in model operating systems. (Contd…) 9 10/11/2021 Evolution of OS (contd..): Major Technical Operating Phases Innovations Systems The idea of OS IBM 701 open shop Open Shop (1954) Tape batching, BKS system (1961) Batch First-in, first-out Processing scheduling. Processor multiplexing, Atlas supervisor Multi- Indivisible operations, (1961), programming Demand paging, Exec II system (1966) Input/output spooling, Priority scheduling, Remote job entry (Contd…) Evolution of OS (contd..): Simultaneous user Multics file system Timesharing interaction, (1965), On-line file systems Unix (1974) Hierarchical systems, RC 4000 system (1969), Concurrent Extensible kernels, 13 Venus system Programming Parallel programming (1972), concepts, Secure parallel 14 Boss 2 system languages (1975). Graphic user interfaces OS 6 (1972) Personal Pilot system (1980) Computing Remote servers WFS file server (1979) Distributed Unix United RPC (1982) Systems 24 Amoeba system (1990) 10 10/11/2021 Batch Processing: In Batch processing same type of jobs batch (BATCH- a set of jobs with similar needs) together and execute at a time. The OS was simple, its major task was to transfer control from one job to the next. The job was submitted to the computer operator in form of punch cards. At some later time the output appeared. The OS was always resident in memory. (Ref. Fig. next slide) Common Input devices were card readers and tape drives. Batch Processing (Contd…): Common output devices were line printers, tape drives, and card punches. Users did not interact directly with the computer systems, but he prepared a job (comprising of the program, the data, & some control information). OS User program area 11 10/11/2021 Batch Processing (Contd…): Spooling Later batch systems used disks for buffering Disks enabled simultaneous peripheral operation on-line (spooling) Computer overlapped I/O of one job with execution of another Better utilization of the expensive CPU Still only one job active at any given time CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Chapter 1 23 Scott A. Brandt) Multiprogramming: Multiprogramming is a technique to execute number of programs simultaneously by a single processor. In Multiprogramming, number of processes reside in main memory at a time. The OS picks and begins to executes one of the jobs in the main memory. If any I/O wait happened in a process, then CPU switches from that job to another job. Hence CPU in not idle at any time. 12 10/11/2021 Multiprogramming (Contd…): OS Figuredipicts the layout of multiprogramming system. Job 1 The main memory consists of 5 Job 2 jobs at a time, the CPU executes one by one. Job 3 Advantages: Job 4 Efficient memory utilization Job 5 Throughput increases CPU is never idle, so performance increases. Time Sharing Systems: Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs are executed by switching the CPU between them. In this, the CPU time is shared by different processes, so it is called as “Time sharing Systems”. Time slice is defined by the OS, for sharing CPU time between processes. Examples: Multics, Unix, etc., 13 10/11/2021 Operating Systems functions: The main functions of operating systems are: 1. Program creation 2. Program execution 3. Input/Output operations 4. Error detection 5. Resource allocation 6. Accounting 7. protection Types of OS: Operating System can also be classified as,- Single User Systems Multi User Systems 14 10/11/2021 Single User Systems: Provides a platform for only one user at a time. They are popularly associated with Desk Top operating system which run on standalone systems where no user accounts are required. Example: DOS Multi-User Systems: Provides regulated access for a number of users by maintaining a database of known users. Refers to computer systems that support two or more simultaneous users. Another term for multi-user is time sharing. Ex: All mainframes and are multi-user systems. Example: Unix 15 10/11/2021 Types of modern operating systems Mainframe operating systems: MVS Server operating systems: FreeBSD, Solaris Multiprocessor operating systems: Cellular IRIX Personal computer operating systems: Windows, Unix Real-time operating systems: VxWorks Embedded operating systems Smart card operating systems ⇒Some operating systems can fit into more CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and than one category Chapter 1 31 Scott A. Brandt) Operating Systems concepts Components of a simple PC Outside world Video Hard drive USB Network controller controller controller controller CPU Computer internals (inside the “box”) Memory CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Chapter 1 32 Scott A. Brandt) 16 10/11/2021 CPU internals Execute Fetch Decode unit unit unit Fetch Decode Execute Execute Buffer unit unit unit unit Fetch Decode unit unit Execute unit Pipelined CPU Superscalar CPU CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Chapter 1 33 Scott A. Brandt) Storage pyramid Capacity Access latency < 1 KB Registers 1 ns Better 1 MB Cache (SRAM) 2–5 ns 256 MB Main memory (DRAM) 50 ns 40 GB Magnetic disk 5 ms Better > 1 TB Magnetic tape 50 sec Goal: really large memory with very low latency Latencies are smaller at the top of the hierarchy Capacities are larger at the bottom of the hierarchy Solution: move data between levels to create illusion of large memory with low latency CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 1 34 17 10/11/2021 Disk drive structure head Data stored on surfaces sector Up to two surfaces per platter One or more platters per disk platter Data in concentric tracks track Tracks broken into sectors cylinder 256B-1KB per sector Cylinder: corresponding tracks on all surfaces surfaces Data read and written by heads spindle actuato Actuator moves heads CS 1550, cs.pitt.edu (originaly r modified by Heads move in unison Ethan L. Miller and Scott A. Brandt) Chapter 1 35 Memory Address Address 0x2ffff 0x2ffff User program User data 0x2d000 and data 0x2b000 0x2bfff Limit2 User data 0x27fff Limit 0x29000 Base2 User program 0x24fff Limit1 and data User program 0x23000 Base 0x23000 Base1 0x1dfff 0x1dfff Operating Operating system system 0 0 Single base/limit pair: set for each process Two base/limit registers: one for program, one for data CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 1 36 18 10/11/2021 Anatomy of a device request Instructionn 3 2 Instructionn+1 1: Interrupt 5 Interrupt Disk CPU controller controller 1 6 4 Operating system 3: Return Interrupt handler Left: sequence as seen by hardware2: Process interrupt Request sent to controller, then to disk Disk responds, signals disk controller which tells interrupt controller Interrupt controller notifies CPU Right: interrupt handling (software point of view) cs.pitt.edu (originaly CS 1550, modified by Ethan L. Miller and Scott A. Brandt) Chapter 1 37 19