Advanced Operating Systems Prof. Muhammad Saeed. Computer Science2 Course Name: Advanced Operating Systems Course Structure: 3 + 0 Course Code: CS703.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
CS 345 Computer System Overview
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
Chapter 1 and 2 Computer System and Operating System Overview
Computer-System Structures
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Silberschatz, Galvin and Gagne  Operating System Concepts Bare Machine (early 1950s) Structure  Large machines run from console  Single user.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
2.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 2: Computer-System Structures Computer System Operation I/O Structure.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: Computer-System Structures
2: Computer-System Structures
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: Phone:
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
1.1 Sandeep TayalCSE Department MAIT 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming Batched Systems Time-Sharing Systems.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Chapter 2: Computer-System Structures(Hardware) or Architecture or Organization Computer System Operation I/O Structure Storage Structure Storage Hierarchy.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
OPERATING SYSTEM CONCEPT AND PRACTISE
Applied Operating System Concepts
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: System Structures
Module 2: Computer-System Structures
Operating System Concepts
Module 2: Computer-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CS 143A Principles of Operating Systems
Operating System Introduction
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Operating System Concepts
Presentation transcript:

Advanced Operating Systems Prof. Muhammad Saeed

Computer Science2 Course Name: Advanced Operating Systems Course Structure: Course Code: CS703 Text Books/Reference Books: 1) Modern Operating Systems by A. S. Tanenbaum 3 rd Edition 2) Distributed Systems: Concepts and Design by Coulouris, Dollimore, and Kindberg, 3 rd Edition. 3) Distributed Operating Systems: Concepts and Design by Paradeep K. Sinha 4) Advanced Concepts in Operating Systems by Singhal and Shiviratri

3Computer Science Def. in nutshell It manages hardware resources and provides abstract set of resources. Web Browser Reader Video Player User Interface Program Operating System Hardware User Mode Kernel Mode What is an Operating System ?

Computer Science4 Program development o Editors and debuggers Program execution Access to I/O devices Controlled access to files System access Services Provided by the Operating System

Computer Science5 Error detection and response internal and external hardware errors memory error device failure software errors arithmetic overflow access forbidden memory locations operating system cannot grant request of application

Computer Science6 1)Charles Babbage hired Ada Lovelace as worlds first programmer. 2)Vacuum Tubes. Electronic Circuits )Transistors.During Batch System was implemented. Punch Cards introduced.

Computer Science7 4) , ICs and Multiprogramming, spooling (Simultaneous Peripheral Operation On Line), introductory timesharing. IBM System 360, PDP series, MULTICS ( Multiplexed Information and Computing Service) System V and BSD versions of UNIX (UNICS). 5)1980-,LSI,Microcomputers. i)CPM(Control Program for Microcomputers), Kildall wrote for 8080 and Zilog Z80, ii)IBM PC Bill Gates provided DOS(Disk Operating System)/Basic package for IBM PC. iii)Engelbert invented GUI at Stanford Research Institute in the 60s. iv)Steve Jobs used GUI in Apple Macintosh. v)in 1985 Microsoft developed Windows. Windows 95 was a real GUI based System. vi)UNIX System with X Windows. vii)Network and Distributed Operating Systems viii)Multiprocessor Operating Systems. ix)Handheld Computer Operating Systems. x)Embedded Operating Systems. xi)Sensor Node Operating Systems. xii)Real-Time Operating Systems. xiii)Smart Card Operating Systems.

Computer Science8 Processor - traditionally controls the operation of the computer and performs the data processing function Memory - Stores data and programs, typically volatile (aka real or primary memory) I/O modules - move data between computer and external environment (i.e. disks, network) System Bus - communication among processors, memory, and I/O modules

Computer Science9 A processor is hardware that executes machine-language CPU executes the instructions of a program Coprocessor executes special-purpose instructions Ex., graphics or audio coprocessors Registers are high-speed memory located on processors Data must be in registers before a processor can operate on it Instruction length is the size of a machine-language instruction Some processors support multiple instruction lengths.

Holding Buffer Execute Unit

Computer Science11 Computer time is measured in cycles One complete oscillation of an electrical signal Provided by system clock generator Processor speeds are measured in GHz (billions of cycles per second) Modern desktops execute at hundreds of megahertz or several GHz

Computer Science12 The memory hierarchy is a scheme for categorizing memory Fastest and most expensive at the top, slowest and least expensive at the bottom Registers L1 Cache L2 Cache Main Memory Secondary and tertiary storage (CDs, DVDs and floppy disks) Main memory is the lowest data referenced directly by processor Volatile – loses its contents when the system loses power

Computer Science13

Computer Science14 Core 1 L1 Core 2 L1 Core 3 L1 Core 4 L1 L 2 Cache Core 1 L1 Core 2 L1 Core 3 L1 Core 4 L1 L 2 A quad-core chip with shared L2 Cache A quad-core chip with separate L2 Cache

Computer Science15 Use of high-speed memory to hold recently-accessed data. Requires a cache management policy. Careful selection of the cache size and of a replacement policy can result in 80 to 99 percent of all accesses being in cache greatly improving performance Caching introduces another level in storage hierarchy. This requires data that is simultaneously stored in more than one level to be consistent.

Computer Science16

Computer Science17 Device port. Serial Port. Parrallel Port USB (Universal Serial Bus) The computer acts as the host. Up to 127 devices can connect to the host, either directly or by way of USB hubs. Individual USB cables can run as long as 5 meters; with hubs, devices can be up to 30 meters. With USB 2.0,the bus has a maximum data rate of 480 megabits per second. With USB 3.0, data rate is 5 gbits/sec. While USB 2.0 can only send data in one direction at a time, USB 3.0 can transmit data in both directions simultaneously. USB of 256 GB capacity are available.

Computer Science18 A bus is a collection of traces Traces are thin electrical connections that transport information between hardware devices A port is a bus that connects exactly two devices An I/O channel is a bus shared by several devices to perform I/O operations Handle I/O independently of the systems main processors

Computer Science19 Starting up a computer Initial program, or bootstrap program, is run Stored in ROM or EPROM within the computer hardware Initializes all aspects of the computer (registers, controllers, memory etc.) Loads the operating system and executes it Locates and loads the OS kernel Once loaded, the OS waits for an event to occur Events usually signaled by an interrupt from either the hardware or software Hardware sends a signal to the CPU via the system bus Software triggers an interrupt by executing a system call

Computer Science20 Interrupts enable software to respond to signals from hardware May be initiated by a running process Interrupt is called a trap – software generated caused by error or user request for an OS service Dividing by zero or referencing protected memory May be initiated by some event that may or may not be related to the running process Key is pressed on a keyboard or a mouse is moved Low overhead Polling is an alternative approach – Processor repeatedly requests the status of each device – Increases in overhead as the complexity of the system increases

Computer Science21 After receiving an interrupt, the processor completes execution of the current instruction, then pauses the current process The processor will then transfer to a fixed location and executes the service routine for the interrupt The interrupt handler determines how the system should respond Interrupt handlers are stored in an array of pointers called the interrupt vector To handle the interrupt quickly, a table of pointers is generally stored in low memory which hold the addresses of the ISR for the various devices This array, or interrupt vector, of addresses is then indexed by a unique device number to provide the address of the ISR for the interrupting device After the interrupt handler completes, the interrupted process is restored and execution continues from the address of the interrupted instruction (stored on stack) or the next process is executed

Computer Science22

Computer Science23

Computer Science24 To start an I/O operation, the CPU loads the appropriate registers within the device controller The device controller examines the values and determines what action to take (e.g. read, write) When the transfer is complete, the device controller informs the CPU via an interrupt The device driver returns control to the OS Returns the data or pointer to the data if a read was done For other operations it returns status information

Computer Science25 Synchronous: After I/O starts, control returns to user program only upon I/O completion. Wait instruction or tight loop ( Loop: jmp Loop ) idles the CPU until the next interrupt At most one I/O request is outstanding at a time, no simultaneous I/O processing. Asynchronous: After I/O starts, control returns to user program without waiting for I/O completion. Increased system efficiency by increasing CPU utilization

Device-status table contains entry for each I/O device indicating its type, address, and state. Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt. If the device is busy with a request, the type of request and other parameters are stored in the table entry for that device A queue will contain a list of all those requests waiting for a device

Computer Science27 Processor has more than one program to execute The sequence the programs are executed depend on their relative priority and whether they are waiting for I/O After an interrupt handler completes, control may not return to the program that was executing at the time of the interrupt

Computer Science28

Computer Science29 UniprogrammingMultiprogramming Processor use22%43% Memory use30%67% Disk use33%67% Printer use33%67% Elapsed time30 min.15 min. Throughput rate6 jobs/hr12 jobs/hr Mean response time18 min.10 min.

Computer Science30 Reduce setup time by batching jobs with similar requirements. Add a card reader, Hire an operator User is NOT the operator Automatic job sequencing Forms a rudimentary OS. Resident Monitor Holds initial control, control transfers to job and then back to monitor. Problem Need to distinguish job from job and data from program.

Computer Science31 Programs queued for execution in FIFO order. Like multiprogramming, but timer device interrupts after a quantum (time slice). Interrupted program is returned to end of FIFO Next program is taken from head of FIFO Control card interpreter replaced by command language interpreter. Interactive (action/response) When OS finishes execution of one command, it seeks the next control statement from user. File systems Online file system is required for users to access data and code. Virtual memory Job is swapped in and out of memory to disk.

Computer Science32 Monolithic Systems Layered Systems Microkernels Client-Server Model Virtual Machines Exokernels.

Computer Science33 Monolithic Systems Entire Operating System as kernel. All individual procedures first compiled then linked together. No information hiding. One service procedure for each system call. There may be some user mode and kernel mode. loadable I/O device drivers loaded on demand.

Computer Science34 Layered Systems

Computer Science35 Microkernels: Splitting into well-defined modules Very few instructions in kernel mode A few of microkernel systems are QNX, Symbian, MINIX 3 etc. Lesser bugs and rare system crash.

Computer Science36 Client-Server Model: Divided into client processes and server processes Communication between client and server generally done by message passing. Client and server can be on the same computer.. Web operates in this way

Computer Science37 Virtual Machines: Copy of hardware, kernel/user mode, I/o, interrupts etc. Can run any operating system coexisting with other operating systems Any call is trapped in the operating system of the virtual machine. Virtualization in the web hosting world uses virtual machines to implement virtualization. CPU must be virtualizable to run previleged instructions. Type 1 hypervisor run on hardware but type II hypervisor runs on top of host operating system.

Computer Science38 Exokernals: Rather than cloning the machine partitioning is used, giving users subset of resources. Exokernal allocates resources to virtual machines. Remapping is not needed.

Computer Science39 END