1 / 39

Advanced Operating Systems

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

hoai
Télécharger la présentation

Advanced Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Operating Systems Introduction Prof. Muhammad Saeed

  2. Course Name: Advanced Operating Systems Course Structure:3 + 0 Course Code:CS703 Course Outline: Introduction Characterization of Modern Operating Systems, file systems, memory management techniques, process scheduling and resource management System Models: Architectural Models. Inter process communication Issues of security in Distributed Systems (Partial Coverage) Distributed file system. Concurrency control in Distributed Systems. Problems of coordination and agreement in Distributed Systems Replication: Advantages and requirements. Fault-tolerant services Mobile and Ubiquitous computing. Text Books/Reference Books: 1) Modern Operating Systems by A. S. Tanenbaum 3rd Edition 2) Distributed Systems: Concepts and Design by Coulouris, Dollimore, and Kindberg, 3rd Edition. 3) Distributed Operating Systems: Concepts and Design by Paradeep K. Sinha 4) Advanced Concepts in Operating Systems by Singhal and Shiviratri Computer Science

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

  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 Computer Science

  5. 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 Science

  6. A Short History: • Charles Babbage hired Ada Lovelace as world’s first programmer. • Vacuum Tubes. Electronic Circuits. 1945-55 • 3) Transistors.During 1955-65 Batch System was implemented. Punch Cards introduced. Computer Science

  7. 1965-80, IC’s 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). • 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 60’s. • 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 Science

  8. Hardware Review: • 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 Science

  9. Processor: • 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. Computer Science

  10. Execute Unit Execute Unit Execute Unit Pipeline Superscalar Holding Buffer

  11. Clock: • 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 Science

  12. Memory: • 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 Science

  13. Memory: Computer Science

  14. Caching L1 Core 1 L1 L1 Core 1 Core 2 L1 Core 2 L 2 L 2 L 2 Cache L1 Core 3 L1 L1 Core 3 Core 4 L1 Core 4 L 2 L 2 A quad-core chip with separate L2 Cache A quad-core chip with shared L2 Cache Computer Science

  15. Caching • 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 Science

  16. Performance of Storage Levels Computer Science

  17. Ports: • 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 Science

  18. Bus: • 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 system’s main processors Computer Science

  19. Computer-System Operation • 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 Science

  20. Interrupt • 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 Science

  21. Handling Interrupts • 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 Science

  22. Interrupt Classes Computer Science

  23. Interrupt Classes Computer Science

  24. I/O Interrupts • 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 Science

  25. I/O Interrupts • 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 Computer Science

  26. Device-Status Table • 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

  27. Multiprogramming • 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 Science

  28. Multiprogramming: Computer Science

  29. UniprogrammingMultiprogramming Processor use 22% 43% Memory use 30% 67% Disk use 33% 67% Printer use 33% 67% Elapsed time 30 min. 15 min. Throughput rate 6 jobs/hr 12 jobs/hr Mean response time 18 min. 10 min. Computer Science

  30. Batch Systems • 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 Science

  31. Timesharing • 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 Science

  32. Operating System Structure • Monolithic Systems • Layered Systems • Microkernels • Client-Server Model • Virtual Machines • Exokernels. Computer Science

  33. 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 Science

  34. Layered Systems Computer Science

  35. 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 Science

  36. 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 Science

  37. 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 virtualizableto run previleged instructions. • Type 1 hypervisor run on hardware but type II hypervisor runs on top of host operating system. Computer Science

  38. 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 Science

  39. END Computer Science

More Related