MODERN OPERATING SYSTEMS Third Edition ANDREW S

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Chapter 4 Sampling Distributions and Data Descriptions.
Adders Used to perform addition, subtraction, multiplication, and division (sometimes) Half-adder adds rightmost (least significant) bit Full-adder.
Chapter 6 I/O Systems.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Process Description and Control
Zhongxing Telecom Pakistan (Pvt.) Ltd
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
1 Hyades Command Routing Message flow and data translation.
FIGURE 8.1 Process and controller.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Chapter 6 File Systems 6.1 Files 6.2 Directories
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Figure 12–1 Basic computer block diagram.
Chapter 5 Input/Output 5.4 Disks
I/O Management and Disk Scheduling
Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Mehdi Naghavi Spring 1386 Operating Systems Mehdi Naghavi Spring 1386.
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 2: Managing Hardware Devices.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5 5 Device Management.
PP Test Review Sections 6-1 to 6-6
Chapter 3 Memory Management
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Chapter 6 File Systems 6.1 Files 6.2 Directories
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Essential Cell Biology
PSSA Preparation.
Essential Cell Biology
Chapter 13 Web Page Design Studio
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
1 Pertemuan 19 Disk Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS03.
Part 5 (Stallings) Input/Output 5.1 Principles of I/O hardware
1 Input/Output Chapter Principles of I/O hardware 5.2 Principles of I/O software 5.3 I/O software layers 5.4 Disks 5.5 Clocks 5.6 Character-oriented.
EEE 435 Principles of Operating Systems Principles and Structure of I/O Software (Modern Operating Systems 5.2 & 5.3) 5/22/20151Dr Alain Beaulieu.
Chapter 5 Input/Output Clocks User Interfaces: Keyboard, Mouse Power.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Input/Output The messiest part of O.S.
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
Chapter 5 Input/Output I/O Hardware I/O Software Software Layers Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Sistem Operasi IKH311 Masukan Luaran (Input/Output)
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-2: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-1: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Input/Output Chapter 5 Tanenbaum & Bo,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Interrupts and signals
Multiple Platters.
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
CSE306 Operating Systems Lecture #6 Input / Output
Disks Magnetic (hard) Disk arrays are used for reliable storage (RAID)
Presentation transcript:

MODERN OPERATING SYSTEMS Third Edition ANDREW S MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

I/O Devices Figure 5-1. Some typical device, network, and bus data rates. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Memory-Mapped I/O (1) Figure 5-2. (a) Separate I/O and memory space. (b) Memory-mapped I/O. (c) Hybrid. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Memory-Mapped I/O (2) Figure 5-3. (a) A single-bus architecture. (b) A dual-bus memory architecture. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Direct Memory Access (DMA) Figure 5-4. Operation of a DMA transfer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Interrupts Revisited Figure 5-5. How an interrupt happens. The connections between the devices and the interrupt controller actually use interrupt lines on the bus rather than dedicated wires. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Precise and Imprecise Interrupts (1) Properties of a precise interrupt PC (Program Counter) is saved in a known place. All instructions before the one pointed to by the PC have fully executed. No instruction beyond the one pointed to by the PC has been executed. Execution state of the instruction pointed to by the PC is known. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Precise and Imprecise Interrupts (2) Figure 5-6. (a) A precise interrupt. (b) An imprecise interrupt. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-7. Steps in printing a string. Programmed I/O (1) Figure 5-7. Steps in printing a string. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-8. Writing a string to the printer using programmed I/O. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Interrupt-Driven I/O Figure 5-9. Writing a string to the printer using interrupt-driven I/O. (a) Code executed at the time the print system call is made. (b) Interrupt service procedure for the printer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

I/O Using DMA Figure 5-10. Printing a string using DMA. (a) Code executed when the print system call is made. (b) Interrupt service procedure. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-11. Layers of the I/O software system. I/O Software Layers Figure 5-11. Layers of the I/O software system. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Interrupt Handlers (1) Save registers not already been saved by interrupt hardware. Set up a context for the interrupt service procedure. Set up a stack for the interrupt service procedure. Acknowledge the interrupt controller. If there is no centralized interrupt controller, reenable interrupts. Copy the registers from where they were saved to the process table. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Interrupt Handlers (2) Run the interrupt service procedure. Choose which process to run next. Set up the MMU context for the process to run next. Load the new process’ registers, including its PSW. Start running the new process. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Device Drivers Figure 5-12. Logical positioning of device drivers. In reality all communication between drivers and device controllers goes over the bus. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Device-Independent I/O Software Figure 5-13. Functions of the device-independent I/O software. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Uniform Interfacing for Device Drivers Figure 5-14. (a) Without a standard driver interface. (b) With a standard driver interface. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Buffering (1) Figure 5-15. (a) Unbuffered input. (b) Buffering in user space. (c) Buffering in the kernel followed by copying to user space. (d) Double buffering in the kernel. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-16. Networking may involve many copies of a packet. Buffering (2) Figure 5-16. Networking may involve many copies of a packet. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

User-Space I/O Software Figure 5-17. Layers of the I/O system and the main functions of each layer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Magnetic Disks (1) Figure 5-18. Disk parameters for the original IBM PC 360-KB floppy disk and a Western Digital WD 18300 hard disk. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Magnetic Disks (2) Figure 5-19. (a) Physical geometry of a disk with two zones. (b) A possible virtual geometry for this disk. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

RAID (1) Figure 5-20. RAID levels 0 through 5. Backup and parity drives are shown shaded. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

RAID (2) Figure 5-20. RAID levels 0 through 5. Backup and parity drives are shown shaded. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-21. Recording structure of a compact disc or CD-ROM. CD-ROMs (1) Figure 5-21. Recording structure of a compact disc or CD-ROM. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-22. Logical data layout on a CD-ROM. CD-ROMs (2) Figure 5-22. Logical data layout on a CD-ROM. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

CD-Recordables (1) Figure 5-23. Cross section of a CD-R disk and laser. A silver CD-ROM has similar structure, except without dye layer and with pitted aluminum layer instead of gold layer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

DVD (1) DVD Improvements on CDs Smaller pits (0.4 microns versus 0.8 microns for CDs). A tighter spiral (0.74 microns between tracks versus 1.6 microns for CDs). A red laser (at 0.65 microns versus 0.78 microns for CDs). Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

DVD (2) DVD Formats Single-sided, single-layer (4.7 GB). Single-sided, dual-layer (8.5 GB). Double-sided, single-layer (9.4 GB). Double-sided, dual-layer (17 GB). Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-24. A double-sided, dual-layer DVD disk. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Formatting (1) Figure 5-25. A disk sector. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Formatting (2) Figure 5-26. An illustration of cylinder skew. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Formatting (3) Figure 5-27. (a) No interleaving. (b) Single interleaving. (c) Double interleaving. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Arm Scheduling Algorithms (1) Read/write time factors Seek time (the time to move the arm to the proper cylinder). Rotational delay (the time for the proper sector to rotate under the head). Actual data transfer time. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Arm Scheduling Algorithms (2) Figure 5-28. Shortest Seek First (SSF) disk scheduling algorithm. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Disk Arm Scheduling Algorithms (3) Figure 5-29. The elevator algorithm for scheduling disk requests. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Error Handling Figure 5-30. (a) A disk track with a bad sector. (b) Substituting a spare for the bad sector. (c) Shifting all the sectors to bypass the bad one. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Stable Storage (1) Operations for stable storage using identical disks: Stable writes Stable reads Crash recovery Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-31. Analysis of the influence of crashes on stable writes. Stable Storage (2) Figure 5-31. Analysis of the influence of crashes on stable writes. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-32. A programmable clock. Clock Hardware Figure 5-32. A programmable clock. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Clock Software (1) Typical duties of a clock driver Maintaining the time of day. Preventing processes from running longer than they are allowed to. Accounting for CPU usage. Handling alarm system call made by user processes. Providing watchdog timers for parts of the system itself. Doing profiling, monitoring, statistics gathering. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-33. Three ways to maintain the time of day. Clock Software (2) Figure 5-33. Three ways to maintain the time of day. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-34. Simulating multiple timers with a single clock. Clock Software (3) Figure 5-34. Simulating multiple timers with a single clock. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Soft Timers Soft timers succeed according to rate at which kernel entries are made because of: System calls. TLB misses. Page faults. I/O interrupts. The CPU going idle. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-35. Characters that are handled specially in canonical mode. Keyboard Software Figure 5-35. Characters that are handled specially in canonical mode. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

The X Window System (1) Figure 5-36. The ANSI escape sequences accepted by the terminal driver on output. ESC denotes the ASCII escape character (0x1B), and n, m, and s are optional numeric parameters. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-37. Clients and servers in the M.I.T. X Window System. The X Window System (2) Figure 5-37. Clients and servers in the M.I.T. X Window System. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

The X Window System (3) Types of messages between client and server: Drawing commands from the program to the workstation. Replies by the workstation to program queries. Keyboard, mouse, and other event announcements. Error messages. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Graphical User Interfaces (1) . . . Figure 5-38. A skeleton of an X Window application program. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Graphical User Interfaces (2) . . . Figure 5-38. A skeleton of an X Window application program. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Graphical User Interfaces (3) Figure 5-39. A sample window located at (200, 100) on an XGA display. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Graphical User Interfaces (4) . . . Figure 5-40. A skeleton of a Windows main program. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Graphical User Interfaces (5) . . . Figure 5-40. A skeleton of a Windows main program. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Bitmaps (1) Figure 5-41. An example rectangle drawn using Rectangle. Each box represents one pixel. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-42. Copying bitmaps using BitBlt. (a) Before. (b) After. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Fonts Figure 5-43. Some examples of character outlines at different point sizes. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Figure 5-44. The THINC protocol display commands. Thin Clients Figure 5-44. The THINC protocol display commands. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Power Management Hardware Issues Figure 5-45. Power consumption of various parts of a notebook computer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Power Management The Display Figure 5-46. The use of zones for backlighting the display. (a) When window 2 is selected it is not moved. (b) When window 1 is selected, it moves to reduce the number of zones illuminated. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Power Management The CPU Figure 5-47. (a) Running at full clock speed. (b) Cutting voltage by two cuts clock speed by two and power consumption by four. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639