Computer Science 4500 Operating Systems

Size: px
Start display at page:

Download "Computer Science 4500 Operating Systems"

Transcription

1 Computer Science 4500 Operating Systems Module 8 Input/Output Last update: 3/10/ Stanley A. Wileman, Jr. Operating Systems Slide 1 1

2 In This Module Principles of Input/Output Hardware Overview of Input/Output Software Details of Common I/O Devices Disks RAM Disks Clocks Terminals 2008 Stanley A. Wileman, Jr. Operating Systems Slide 2 2

3 Principles of I/O Hardware Much I/O hardware maps software requests to physical actions external to a processor. Some I/O devices are virtual that is, they don t physically exist. To understand I/O requires understanding The physical characteristics of I/O devices The software interface to the I/O hardware (from the operating system) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 3 3

4 I/O Devices Devices can be characterized in several ways: What is the purpose of the device? data storage (e.g. disk drive, tape, CD-ROM, flash drive) data transfer (e.g. serial port, modem, network interface, USB hub, Ethernet switch) environmental interface (e.g. keyboard, monitor, mouse, A/D converter) How is the device accessed? block by block one character or byte at a time 2008 Stanley A. Wileman, Jr. Operating Systems Slide 4 4

5 Device Drivers A device driver is the software component of the operating system that manages detailed interactions with the device. Each device driver provides a common interface to the kernel of the operating system. To some extent, then, the drivers normalize the I/O software used by the operating system. Example: different disks have different sector sizes, number of cylinders, tracks, etc. But a disk device driver might provide a generic function like read block, given a buffer address, a device number, and a logical block number Stanley A. Wileman, Jr. Operating Systems Slide 5 5

6 Device Controllers A device controller consists of the electronic interface between a device and the computer system. A device controller is sometimes called a device adapter. The controller physically connects the device to the computer system s bus. Many modern devices have a device controller as an integral component. Example: SCSI devices, IDE disk drives For these devices a simplified interface (frequently called a host adapter) is used to connect it to the system s bus Stanley A. Wileman, Jr. Operating Systems Slide 6 6

7 How It All Fits Together 2008 Stanley A. Wileman, Jr. Operating Systems Slide 6.1 7

8 Typical Device Driver Functions 2008 Stanley A. Wileman, Jr. Operating Systems Slide 6.2 8

9 Device Controller Features Each device controller has two interfaces, one to the system bus and one to the device. Some device controllers can handle multiple devices of the same type. For example, most PC floppy disk controllers can handle two drives. Many device interfaces are standardized, including those for floppy disks, IDE and SCSI hard disks, and network interfaces. Likewise, many bus interfaces are standardized. The operating system (device driver) always interacts with the controller, not directly with the device Stanley A. Wileman, Jr. Operating Systems Slide 7 9

10 A Typical PC s I/O Configuration (Simplified) CPU Memory Controller #1 Controller #2 Clock Etc. Device Device Device Device 2008 Stanley A. Wileman, Jr. Operating Systems Slide 8 10

11 A Real PC s I/O Device, Bus, Port, and Memory Layout From Stanley A. Wileman, Jr. Operating Systems Slide

12 Mainframe Data Channels Used by mainframes, I/O channels are specialized processors that deal exclusively with I/O operations. Channel programs, written using an instruction set different from the main CPUs, are executed exclusively by the I/O channels. Device controllers attach to the I/O channel s bus, and not to the same bus as the memory and CPUs. There are two major kinds of channels: one for block structured devices (called a selector channel), and one for character devices (called a multiplexor channel) Stanley A. Wileman, Jr. Operating Systems Slide 9 12

13 A Possible Mainframe Configuration CPU CPU Memory I/O Channel #1 I/O Channel #2 Controller #1 Controller #2 Etc. Device Device Device Device 2008 Stanley A. Wileman, Jr. Operating Systems Slide 10 13

14 Bus Adapters A bus is used to connect various components of a computer system. It is often desirable to provide more than one type of bus in a system, each bus designed for the typical communication needs of a set of devices. Device controllers are designed to be connected to a specific bus (e.g. Multibus, ISA, PCI, USB, ATA, SCSI) A bus adapter can be used to interconnect the separate busses in a system. Example: Sequent uses a proprietary bus for its parallel systems, but uses Multibus device controllers for terminal attachment to the system Stanley A. Wileman, Jr. Operating Systems Slide 11 14

15 A Sequent Configuration CPU CPU CPU CPU Memory PROPRIETARY Multibus Adapter Controller #1 Terminal Controller Device Device Term Term MULTIBUS (STANDARD) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 12 15

16 Bridges A bridge is typically a device (often a single integrated circuit) that functions as a bus adapter and a router. Many PCs employ two bridges: The northbridge handles fast communication (with RAM and video). The southbridge deals with slower devices (disks, USB ports, PCI devices, etc.) As integrated circuit technology develops, many of the bridge functions are included on the processor chip, even including video controller/gpu features Stanley A. Wileman, Jr. Operating Systems Slide

17 Disk Drives Floppy and most modern hard disk drive motors can be turned on and off. The serial data stream to/from a disk drive is created/interpreted by the disk controller. The data in each disk sector is preceded by a preamble containing identifying information (like the track number, cylinder number, and sector number). The speed of the disk is constant (during operation), requiring the controller to keep up with the disk Stanley A. Wileman, Jr. Operating Systems Slide 13 17

18 Display devices The display itself is functionally similar to those found in televisions, with the screen s pixels (the smallest individual picture elements) being continually and rapidly updated (e.g. the entire screen might be redrawn 120 times each second). The controller must pump data to the display to keep up with the constant scan rate. The video data comes from video RAM (directly or indirectly). This RAM maintains a copy of the displayed data, and can be directly accessed by the processor. Commands to the controller modify various video parameters, primarily at system initialization time. Manipulating the display controller registers is done relatively infrequently Stanley A. Wileman, Jr. Operating Systems Slide 14 18

19 Direct Memory Access (DMA) In older computer systems, the CPU had to keep up with the constant data rate required by the device, essentially eliminating any possibility of multiprocessing (multitasking). DMA devices manage data transfers between the controller and the system s primary memory independent of the CPU (once the transfer has been set up). DMA is a support device that connects to the system bus Stanley A. Wileman, Jr. Operating Systems Slide 15 19

20 A PC with a DMA Device CPU DMA Memory Device Controller #1 Device DMA transfers are usually performed only for block devices that transfer many bytes for each I/O request. The DMA device can be used in both directions Stanley A. Wileman, Jr. Operating Systems Slide 16 20

21 Interleaving Disk Sectors After a sector has been read from the disk, it must be transferred to primary memory (usually using DMA). The disk continues to rotate after a sector has been read, thus The next sequential sector has passed by before the controller is ready to read again. To eliminate the delay while waiting for the next sequentially numbered sector, some systems logically number the sectors so they are not contiguous! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 17 21

22 Interleaving Example Non-interleaved Interleaved Assume the disk rotates at 1 rev/sec (unrealistic, but easy for the math), and processing the data from a sector requires 1/8 sec. The green arrow (at the top) shows the initial head position. The red arrow shows the position of the head after processing sector Stanley A. Wileman, Jr. Operating Systems Slide 18 22

23 Principles of I/O Software Build I/O software in layers, so each layer can deal with one type of complexity. The lowest layers deal with device and controller details (e.g. device drivers). The upper layers provide a clean, generic interface to the user software Stanley A. Wileman, Jr. Operating Systems Slide 19 23

24 Goals of the I/O Software - I Device independence: most devices should be capable of being used for an arbitrary purpose without modifying user software (e.g. I/O redirection, pipes vs. files) Uniform naming conventions: device characteristics should not influence file naming requirements unnecessarily Error handling: most transient errors should be handled by the lower layers. Only catastrophic errors should be reported to the user. Error logs should be maintained Stanley A. Wileman, Jr. Operating Systems Slide 20 24

25 Goals of the I/O Software - II Concurrency: users should be able to wait for I/O completion, or start an I/O operation and continue computing (or start another I/O operation). Shared devices (printers, disks, some communication devices): these should be managed so each user thinks they are the only one using the device. Dedicated devices (e.g. terminals) must be protected from misuse Stanley A. Wileman, Jr. Operating Systems Slide 21 25

26 Structuring the I/O Software Interrupt Handlers Device drivers Device-independent OS software User-level software 2008 Stanley A. Wileman, Jr. Operating Systems Slide 22 26

27 Interrupt Handlers Interrupts (short messages from a device controller to a processor) are generated when an I/O operation completes or important device events occur; these happen at imprecise times. An interrupt report identifies its source, but additional information must be obtained from the device controller. For example, an I/O operation may be successful or unsuccessful. The purpose of the interrupt handler is to save transient/volatile information, and to translate the interrupt into a wakeup signal (e.g. a V/up on a semaphore) Stanley A. Wileman, Jr. Operating Systems Slide 23 27

28 Device Driver Entry Points Interrupt handlers are sometimes listed as belonging to the device driver, but they have different entry mechanisms. UNIX device drivers often have the following routines: Initialization Open and close Character read and write Block strategy routine General purpose I/O control routine 2008 Stanley A. Wileman, Jr. Operating Systems Slide 24 28

29 Driver Initialization This routine is usually called once during the startup of an operating system. It may probe the system to determine specific I/O device configuration information. It will initialize counters, local variables, and allocate any needed resources. It permits drivers to be included for devices that may optionally be present Stanley A. Wileman, Jr. Operating Systems Slide 25 29

30 Device Open and Close Routines These routines are invoked by the kernel on behalf of a user process that issues the open or close system calls for a device. For simple devices, these routines may have no required actions. For other devices, these routines guarantee the device is placed in a consistent/specified state. These are NOT the same as the open/close routines for disk files! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 26 30

31 Read and Write Routines For character devices, these routines accomplish the transfer of a single byte, or a sequence of bytes between a buffer and the user process. If the device is busy, the routines will queue the request until the device becomes available, when an interrupt will trigger its processing Stanley A. Wileman, Jr. Operating Systems Slide 27 31

32 Strategy Routine The kernel passes a structure containing a request for I/O on a block structured device. If the device is idle, the requested action is started immediately. Otherwise, a request is queued until it can be processed (indicated when the device generates an interrupt). The requests are not necessarily performed in FIFO order. They may be reordered for efficiency. This is what gives this routine its name Stanley A. Wileman, Jr. Operating Systems Slide 28 32

33 General Purpose I/O Control This routine is used to handle device requests that do not fit the traditional open/close/read/write model. For example, setting the data rate on a serial port would be handled by this routine. This routine is invoked by the kernel when a user process issues the ioctl system call Stanley A. Wileman, Jr. Operating Systems Slide 29 33

34 Handling Unexpected Events Q. What happens if an I/O request is issued, but the corresponding interrupt never occurs? A. Obviously this would lock up the device driver, since it would never be able to proceed to the next request. Good driver design will include setting a timer when an I/O request starts, so a missing interrupt can be identified when the timer goes off Stanley A. Wileman, Jr. Operating Systems Slide 30 34

35 Device-Independent I/O Software Uniform interfacing for device drivers Device naming Device protection Storage allocation on block devices Allocating and releasing dedicated devices Error reporting and logging Device-independent (logical) block sizes Buffering 2008 Stanley A. Wileman, Jr. Operating Systems Slide 31 35

36 User-Space I/O Software System call interface to application programs I/O libraries (e.g. formatting functions) User-level buffering (e.g. getchar()) Utility programs (e.g. UNIX mt, lpr/lpd) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 32 36

37 Disks Advantages Over RAM Persistence: they retain their contents after power is removed Price per bit is lower; late 2014 prices: RAM costs about $10 per GB SATA disk costs about $50 - $100 per TB Storage capacity is much larger 2008 Stanley A. Wileman, Jr. Operating Systems Slide 33 37

38 Stanley A. Wileman, Jr. Operating Systems Slide 38

39 Disk Hardware Physical organization One or more platters, each with two surfaces (some may utilize only one of the two surfaces) Each surface has multiple concentric tracks Each track has some number of sectors Many drives today have integrated controllers (e.g. SCSI, IDE, SATA) Overlapped seeks are possible with many systems (positioning the heads on one disk while a different disk is transferring data) Stanley A. Wileman, Jr. Operating Systems Slide 34 39

40 Disk Drive Terminology Figure from Stanley A. Wileman, Jr. Operating Systems Slide 35 40

41 Legacy/Advanced Sector Formats Legacy disks usually have 512 data bytes in each sector, but more modern drives may have 4096 data bytes (called advanced format ). This reduces the space used for sector gaps, preamble (Sync/DAM), etc. and provides a small increase in drive capacity and speed Stanley A. Wileman, Jr. Operating Systems Slide 36 41

42 Steps in reading/writing a sector Assuming the disk drive and controller are ready to accept a command: Issue a seek command to move the heads to the appropriate cylinder and wait for that to complete. Issue a read or write command (the seek and read/write can often be combined in one command) Wait for command completion (usually indicated by an interrupt). Assess the results (examine status register) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 37 42

43 Three separate times for disk I/O Seek time: the time required for the heads to move to the proper cylinder Rotational latency: the time required for the disk to rotate so the beginning of the desired sector is under the heads Transfer time: the time required to transfer the data Seek time is variable, and depends on the current head location. Rotational latency and transfer time are directly related to the disk s rotational speed Stanley A. Wileman, Jr. Operating Systems Slide 38 43

44 Example Disk Parameters - I Parameter 1.44 MB Floppy 6.23 GB Drive Cylinders 80 24,704 Tracks/cyl 2 8 Sectors/track Sectors/disk 2,880 12,450,816 Bytes/sector Bytes/disk 1,474,560 6,374,817, Stanley A. Wileman, Jr. Operating Systems Slide 39 44

45 Example Disk Parameters - II Parameter 1.44 MB Floppy 6.23 GB Drive Adj. Cyl. Seek 3 msec 2 msec Avg. Seek 94 msec 9.5 msec Rotation time 200 msec 11 msec Transfer time 11 msec 176 sec Transfer rate 45 KB/sec 2.77 MB/sec 2008 Stanley A. Wileman, Jr. Operating Systems Slide 40 45

46 Disk Parameters: Real vs. Logical Modern disk drives store data much more densely that older drives. 63 sectors per track is the logical limit only because legacy controllers have only 6 bits in the register that specifies the sector number. The actual number of sectors per track (and number of cylinders and heads) is probably different from the logical values used by software. In fact, the number of number of sectors per track probably varies from track to track! Thanks to clever controllers, we usually don t have to worry about these logical versus physical differences Stanley A. Wileman, Jr. Operating Systems Slide 41 46

47 Disk Controller Buffering Modern disks controllers have significant RAM (8 to 128 MB is common) used to buffer requests. A read request may copy an entire track into RAM so additional requests for other sectors from that track can be processed without another physical read. Likewise, a write request may save the data in RAM and write it to disk after reporting completion of the write! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 42 47

48 Disk Arm Scheduling Algorithms Q. Given multiple requests to read/write a single disk, in what order should the requests be performed? A. It depends on the sophistication of the operating system, and the needs of the user(s) Stanley A. Wileman, Jr. Operating Systems Slide 43 48

49 First Come, First Served Simple to implement The only appropriate algorithm for single-process systems without concurrent I/O to a single device (e.g. MS-DOS) Sometimes appropriate, since most requests are likely to be to the same general area of the disk 2008 Stanley A. Wileman, Jr. Operating Systems Slide 44 49

50 Shortest Seek Time First Always chooses the closest request to process next Can result in poor performance as viewed from certain processes Could result in indefinite postponement! Aging can be used to modify the behavior to accommodate requests that have been waiting a long time Stanley A. Wileman, Jr. Operating Systems Slide 45 50

51 Elevator Algorithms - I SCAN - moves the head in one direction only until all cylinders in that direction have been considered, then reverse direction and repeat. May produce high variation in response time for requests at ends of head travel. Always covers entire cylinder range, even though there may be no requests Stanley A. Wileman, Jr. Operating Systems Slide 46 51

52 Elevator Algorithms - II C-SCAN - treats the disk as if the highest-numbered cylinder is adjacent to the lowest-numbered cylinder. Moves the head in only one direction; after processing requests for the highest-numbered cylinder, seek back to the lowest-numbered cylinder. Eliminates statistical problems with SCAN 2008 Stanley A. Wileman, Jr. Operating Systems Slide 47 52

53 Rationale for C-SCAN Doing large (long-distance) seeks usually takes less time than expected. These are certainly faster than doing many single-cylinder seek operations Stanley A. Wileman, Jr. Operating Systems Slide

54 SCAN/C-SCAN Algorithms - Implementation I Requests for service are queued on a cylinder by cylinder basis (i.e. there are, in effect, separate queues for each cylinder) When the head reaches a particular cylinder, all requests in the queue for that cylinder are processed. Q. When should requests for the current cylinder no longer be queued? 2008 Stanley A. Wileman, Jr. Operating Systems Slide 48 54

55 SCAN/C-SCAN Algorithms - Implementation II A. When the head reaches cylinder k, new requests for cylinder k should be deferred until the next scan. Why? Because if we didn t, indefinite postponement could occur. Consider an elevator on floor k with a continuous stream of folks saying hold the elevator! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 49 55

56 The LOOK and C-LOOK Algorithms One simple modification of the SCAN algorithms is to move the heads only as far as the highest numbered or lowest numbered request. That is, the algorithm looks ahead. While this appears to be obvious, requests that would arrive from cylinders between the last referenced cylinder and the highest numbered cylinder while the heads are moving to the highest numbered cylinder won t be processed by the LOOK algorithms Stanley A. Wileman, Jr. Operating Systems Slide 50 56

57 Batch Processing of Requests Another modification applicable to all the previous algorithms is called batching. Instead of including all requests in the request data structure as soon as they arrive, save them (as an ordered group) until the current batch has been processed. Then start again, processing the next batch of requests and saving newly-arriving requests Stanley A. Wileman, Jr. Operating Systems Slide 51 57

58 RAID Disks - I RAID = Redundant Array of Inexpensive Disks To achieve a performance increase, two disks could be used in parallel, with the data in corresponding blocks on each disk treated as a single larger block, but allowing the transfer of data in parallel. This would give an effective block twice as large, but needing the same time to transfer, thus effectively doubling the transfer rate Stanley A. Wileman, Jr. Operating Systems Slide 52 58

59 RAID Disks - II Different arrangements of disks can be used to achieve different goals. Some systems may use mirroring of disks, meaning every block is written to a second, mirrored disk, giving duplicates of every disk block. Alternately, a system may spread a logical block out over a number of disks, with the effect of increasing transfer rate. Log-structured file systems are designed to make effective use of RAID systems Stanley A. Wileman, Jr. Operating Systems Slide 53 59

60 Error Handling Programming errors Transient errors (e.g. checksum errors) Permanent errors (bad blocks) Seek errors (head goes to wrong cylinder) Controller errors 2008 Stanley A. Wileman, Jr. Operating Systems Slide 54 60

61 RAM Disks Basically, a RAM disk is just a region of primary memory made to function like a small disk. The I/O interface to the user and the system is the same; only a different device driver is used. Separate hardware RAM disks can be made to have the same interface as a real disk! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 55 61

62 Clock/Calendar Chips (RTC) The original device was the Motorola MC On modern systems, the RTC is integrated into the southbridge chip. This device has registers to record the time and the date. It is powered by a lithium battery (or a supercapacitor) when the main power to the system is off. This device is usually referenced only when system boots to obtain the current date and time. Afterwards, the time and date is recorded in memory and periodically updated using interrupts from a programmable interval timer Stanley A. Wileman, Jr. Operating Systems Slide 56 62

63 Programmable Interval Timers The original device was the Intel 8253 (three separate timers); functionality is now in the southbridge chip. One timer register (say A) holds a value that is used to load an auto-decremented register (B). The B register is decremented each time a fixed-frequency oscillator goes through one cycle. When the B register reaches 0, an interrupt is generated (and possibly, B is automatically reloaded from A, to cause a sequence of periodic interrupts). The oscillator frequency can be controlled by software Stanley A. Wileman, Jr. Operating Systems Slide 57 63

64 Clock Software - I Typical uses of clocks: Maintaining the time of day Measuring the quantum for running processes Accounting for CPU utilization Allowing processes to delay, or limit the time spent in certain functions (e.g. login) Providing watchdog timers for the system (e.g. missing interrupt detection) Profiling, monitoring, generating statistics 2008 Stanley A. Wileman, Jr. Operating Systems Slide 58 64

65 Clock Software - II Handling the time of day: Keep one large value in tick units (e.g. 64 bits) Keep one value in ticks this second, and another in seconds (UNIX) Keep a battery clock with the date and time, and measure time in ticks from when the system was booted (Windows NT) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 59 65

66 Clock Software - III Q. How does the system handle multiple requests for timers, when it only has one? A. Keep a queue of scheduled events, with each queue entry identifying the event and the delta time from the previous event Clock interrupts must be handled very efficiently, since they occur frequently, and are very important to the system Stanley A. Wileman, Jr. Operating Systems Slide 60 66

67 Clock Software - IV Q. How do you set the time of day? A. Carefully! Suppose the system clock says it s 11:59AM, but the time is really 12:01PM. If you just change the software clock directly to 12:01PM, what happens to the activities scheduled to occur at noon? UNIX solution: don t change the time, just speed up the clock for a while!!! 2008 Stanley A. Wileman, Jr. Operating Systems Slide 61 67

68 Terminals Two major components Display Keyboard Other related components are treated as separate devices: Mouse Pen 2008 Stanley A. Wileman, Jr. Operating Systems Slide 62 68

69 Terminal Categories Three major categories with subcategories Memory-mapped terminals Character oriented Bit oriented RS-232 terminals Glass Teletype Intelligent terminal X terminals 2008 Stanley A. Wileman, Jr. Operating Systems Slide 63 69

70 Memory-mapped Terminals - I Video RAM (on the video interface card) is accessible by both the system (CPU) and the video controller. Video controller continually refreshes the image on the terminal screen from the contents of the video RAM Stanley A. Wileman, Jr. Operating Systems Slide 64 70

71 Memory-mapped Terminals - II Video RAM can either contain a bit-by-bit map of the display s image, or it could can character codes with additional codes to specify blinking and color If character codes are specified, then the video controller maps from these codes to the appropriate bit-mapped image of the character as it updates the display Stanley A. Wileman, Jr. Operating Systems Slide 65 71

72 Memory-mapped Terminals - III Keyboards in memory-mapped terminals are really separate from the display. Example. On a PC, each key press and key release results in an interrupt being sent; the data read from the keyboard indicates only a key number, not an ASCII code. Thus it s possible to identify when someone presses the ALT, SHIFT, and plus keys at the same time Stanley A. Wileman, Jr. Operating Systems Slide 66 72

73 RS-232 Terminals - I An RS-232 terminal (or equivalent) is basically a keyboard, a display, a serial port, and a small microprocessor-based system in a box with a program in read-only memory. They have been all but obsoleted by cheap microprocessor systems with displays and serial ports. In operation, data is sent to the terminal through its serial port from a corresponding serial port on the computer system. Keyboard data is also sent back via the serial port Stanley A. Wileman, Jr. Operating Systems Slide 67 73

74 RS-232 Terminals - II Early RS-232 terminals did little more than display characters as they were received. These glass ttys are now obsolete. Modern terminals (or terminal emulators) are able to process escape sequences which are control commands to do things like clear the display, insert/delete characters or lines, change color/blink/underline, etc Stanley A. Wileman, Jr. Operating Systems Slide 68 74

75 RS-232 Terminals - III Serial communication is slow compared to the rates that can be achieved with memory-mapped displays. Common data rates range from 9600 baud through 56K baud. Anywhere between 9 and 11 bit times are required for each character sent or received Stanley A. Wileman, Jr. Operating Systems Slide 69 75

76 X Terminals The X Window System is essentially a protocol that governs the exchanges between a client (that wants to display something) and a server (that manages the display, the keyboard, and the mouse or other pointing device). An X terminal is just a dedicated memory-mapped display and a microprocessor system running an X server. These are essentially obsolete. But the X protocol is not obsolete. However, there are numerous similar network devices in common use. For example, most tablet devices, with much more powerful processors than X terminals, can function as a networked terminal Stanley A. Wileman, Jr. Operating Systems Slide 70 76

77 Input Software - I Terminal modes (using UNIX/POSIX terms): cooked/canonical; only complete lines result in input being passed to a process; editing and special signal characters are handled by the input software; keyboard data is echoed raw/non-canonical; every keystroke immediately available as input data; no automatic echo of input; no editing characters processed 2008 Stanley A. Wileman, Jr. Operating Systems Slide 72 77

78 Input Software - II Task: collect the typed characters. Each keypress causes at least one interrupt, regardless of terminal type. PCs generate an interrupt for each keypress and another for each keyrelease. Keycodes are typically not the same as the character codes expected by application software. That is, they are not ASCII or EBCDIC codes Stanley A. Wileman, Jr. Operating Systems Slide 73 78

79 Input Software - III Task: process the collected characters. Deal with different keyboard arrangements and character sets Process editing characters in cooked mode (the ioctl system call sets these) Buffer characters not yet requested by a process associated with the terminal; two main approaches Use a common pool of small buffers for all terminals Use a statically allocated buffer for each terminal 2008 Stanley A. Wileman, Jr. Operating Systems Slide 74 79

80 Input Software - IV Task: echo characters to the display where to display echoed characters? when to display echoed characters? how to handle tab characters? Task: handle end-of-line characters Task: handle special characters which special characters to handle? how to indicate changes (POSIX tcsetattr, tcgetattr functions, UNIX ioctl) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 75 80

81 Output Software - I Two main tasks: get characters from the user and display them. process special output editing sequences. Although for RS-232 terminals the second task need not be performed by the source, the microprocessor in the terminal must still do this work Stanley A. Wileman, Jr. Operating Systems Slide 76 81

82 Output Software - II Task: display characters identify escape sequences identify correct location for next output character handle end-of-line and special characters handle scrolling at the end of a line handle cursor positioning handle special display attributes (e.g. blinking, bell, color) 2008 Stanley A. Wileman, Jr. Operating Systems Slide 77 82

83 Output Software - II Task: process special editing sequences ANSI has defined a standard for escape sequences, but they are not always used Escape sequences (because they usually begin with the escape character) allow for inserting/deleting lines and characters, positioning the cursor, clearing and scrolling the screen, marking text as readonly, etc Stanley A. Wileman, Jr. Operating Systems Slide 78 83

84 Next In the next module we ll begin our study of memory management. We will study a sequence of memory management techniques, relating them to the various problems related to the use of memory. We ll also examine a simple model that shows the effectiveness of multiprogramming Stanley A. Wileman, Jr. Operating Systems Slide 79 84

Computer Science 4500 Operating Systems

Computer Science 4500 Operating Systems Computer Science 4500 Operating Systems Module 8 Input/Output Last update: 3/10/2015 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 In This Module Principles of Input/Output Hardware Overview of

More information

COMPUTER SCIENCE 4500 OPERATING SYSTEMS

COMPUTER SCIENCE 4500 OPERATING SYSTEMS Last update: 1/6/2017 COMPUTER SCIENCE 4500 OPERATING SYSTEMS 2017 Stanley Wileman Module 8: Input/Output In This Module 2! Principles of Input/Output Hardware! Overview of Input/Output Software! Details

More information

CS Operating Systems

CS Operating Systems CS 4500 - Operating Systems Module 8: Input/Output Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA August 2, 2017 In This Module... Principles of

More information

2. Which of the following resources is not one which can result in deadlocking processes? a. a disk file b. a semaphore c. the central processor (CPU)

2. Which of the following resources is not one which can result in deadlocking processes? a. a disk file b. a semaphore c. the central processor (CPU) CSCI 4500 / 8506 Sample Questions for Quiz 4 Covers Modules 7 and 8 1. Deadlock occurs when each process in a set of processes a. is taking a very long time to complete. b. is waiting for an event (or

More information

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware CSE 120 July 27, 2006 Day 8 Input/Output Instructor: Neil Rhodes How hardware works Operating Systems Layer What the kernel does API What the programmer does Overview 2 Kinds Block devices: read/write

More information

I/O Hardwares. Some typical device, network, and data base rates

I/O Hardwares. Some typical device, network, and data base rates Input/Output 1 I/O Hardwares Some typical device, network, and data base rates 2 Device Controllers I/O devices have components: mechanical component electronic component The electronic component is the

More information

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices Introduction Operating Systems Input/Output Devices (Ch12.1-12.3, 12.7; 13.1-13.3, 13.7) One OS function is to control devices significant fraction of code (80-90% of Linux) Want all devices to be simple

More information

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done)

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done) Introduction Operating Systems Input/Output Devices (Ch 13.3, 13.5; 14.1-14.3) One OS function is to control devices significant fraction of code (80-90% of Linux) Want all devices to be simple to use

More information

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices Introduction Operating Systems Input/Output Devices (Ch12.1-12.3, 12.7; 13.1-13.3, 13.7) One OS function is to control devices significant fraction of code (80-90% of Linux) Want all devices to be simple

More information

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security Input/Output Today Principles of I/O hardware & software I/O software layers Disks Next Protection & Security Operating Systems and I/O Two key operating system goals Control I/O devices Provide a simple,

More information

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done? Input/Output : I/O Systems Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Character-oriented terminals Graphical user interfaces Network terminals Power management

More information

Outline. Operating Systems: Devices and I/O p. 1/18

Outline. Operating Systems: Devices and I/O p. 1/18 Outline Diversity of I/O devices block and character devices Organization of I/O subsystem of kernel device drivers Common hardware characteristics of device I/O subsystem tasks Operating Systems: Devices

More information

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 9: Mass Storage Structure Prof. Alan Mislove (amislove@ccs.neu.edu) Moving-head Disk Mechanism 2 Overview of Mass Storage Structure Magnetic

More information

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition Chapter 10: Mass-Storage Systems Silberschatz, Galvin and Gagne 2013 Chapter 10: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management Swap-Space

More information

Chapter 11. I/O Management and Disk Scheduling

Chapter 11. I/O Management and Disk Scheduling Operating System Chapter 11. I/O Management and Disk Scheduling Lynn Choi School of Electrical Engineering Categories of I/O Devices I/O devices can be grouped into 3 categories Human readable devices

More information

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006 November 21, 2006 The memory hierarchy Red = Level Access time Capacity Features Registers nanoseconds 100s of bytes fixed Cache nanoseconds 1-2 MB fixed RAM nanoseconds MBs to GBs expandable Disk milliseconds

More information

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems Chapter 10: Mass-Storage Systems Silberschatz, Galvin and Gagne 2013 Chapter 10: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management Swap-Space

More information

V. Mass Storage Systems

V. Mass Storage Systems TDIU25: Operating Systems V. Mass Storage Systems SGG9: chapter 12 o Mass storage: Hard disks, structure, scheduling, RAID Copyright Notice: The lecture notes are mainly based on modifications of the slides

More information

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara Operating Systems Christopher Kruegel Department of Computer Science http://www.cs.ucsb.edu/~chris/ Input and Output Input/Output Devices The OS is responsible for managing I/O devices Issue requests Manage

More information

Operating Systems. V. Input / Output

Operating Systems. V. Input / Output Operating Systems V. Input / Output Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Devices of a Computer System Applications OS CPU Memory

More information

I/O Management and Disk Scheduling. Chapter 11

I/O Management and Disk Scheduling. Chapter 11 I/O Management and Disk Scheduling Chapter 11 Categories of I/O Devices Human readable used to communicate with the user video display terminals keyboard mouse printer Categories of I/O Devices Machine

More information

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1 Ref: Chap 12 Secondary Storage and I/O Systems Applied Operating System Concepts 12.1 Part 1 - Secondary Storage Secondary storage typically: is anything that is outside of primary memory does not permit

More information

I/O Devices. Chapter 5 Input/Output. Memory-Mapped I/O (2) Memory-Mapped I/O (1) Interrupts Revisited. Direct Memory Access (DMA) 11/26/2013

I/O Devices. Chapter 5 Input/Output. Memory-Mapped I/O (2) Memory-Mapped I/O (1) Interrupts Revisited. Direct Memory Access (DMA) 11/26/2013 MODERN OPERATING SYSTEMS I/O Devices Third Edition ANDREW S. TANENBAUM Chapter 5 Input/Output Figure 5-1. Some typical device, network, and bus data rates. Memory-Mapped I/O (1) Memory-Mapped I/O (2) Figure

More information

CSE 380 Computer Operating Systems

CSE 380 Computer Operating Systems CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania Fall 2003 Lecture Note on Disk I/O 1 I/O Devices Storage devices Floppy, Magnetic disk, Magnetic tape, CD-ROM, DVD User

More information

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition, Chapter 12: Secondary-Storage Structure, Silberschatz, Galvin and Gagne 2009 Chapter 12: Secondary-Storage Structure Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk

More information

CSE380 - Operating Systems. Communicating with Devices

CSE380 - Operating Systems. Communicating with Devices CSE380 - Operating Systems Notes for Lecture 15-11/4/04 Matt Blaze (some examples by Insup Lee) Communicating with Devices Modern architectures support convenient communication with devices memory mapped

More information

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage Chapter 12: Mass-Storage Systems Chapter 12: Mass-Storage Systems Revised 2010. Tao Yang Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management Swap-Space Management

More information

OPERATING SYSTEMS CS136

OPERATING SYSTEMS CS136 OPERATING SYSTEMS CS136 Jialiang LU Jialiang.lu@sjtu.edu.cn Based on Lecture Notes of Tanenbaum, Modern Operating Systems 3 e, 1 Chapter 5 INPUT/OUTPUT 2 Overview o OS controls I/O devices => o Issue commands,

More information

Chapter 5 - Input / Output

Chapter 5 - Input / Output Chapter 5 - Input / Output Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 5 - Input / Output 1 / 90 1 Motivation 2 Principle of I/O Hardware I/O Devices Device Controllers Memory-Mapped

More information

CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 12: Mass-Storage Systems Overview of Mass-Storage Structure Disk Structure Disk Attachment Disk Scheduling

More information

Chap. 3. Input/Output

Chap. 3. Input/Output Chap. 3. Input/Output 17 janvier 07 3.1 Principles of I/O hardware 3.2 Principles of I/O software 3.3 Deadlocks [3.4 Overview of IO in Minix 3] [3.5 Block Devices in Minix 3] [3.6 RAM Disks] 3.7 Disks

More information

EIDE, ATA, SATA, USB,

EIDE, ATA, SATA, USB, Magnetic disks provide bulk of secondary storage of modern computers! Drives rotate at 60 to 200 times per second! Transfer rate is rate at which data flow between drive and computer! Positioning time

More information

CSE 153 Design of Operating Systems Fall 2018

CSE 153 Design of Operating Systems Fall 2018 CSE 153 Design of Operating Systems Fall 2018 Lecture 12: File Systems (1) Disk drives OS Abstractions Applications Process File system Virtual memory Operating System CPU Hardware Disk RAM CSE 153 Lecture

More information

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo STORAGE SYSTEMS Operating Systems 2015 Spring by Euiseong Seo Today s Topics HDDs (Hard Disk Drives) Disk scheduling policies Linux I/O schedulers Secondary Storage Anything that is outside of primary

More information

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University I/O & Storage Jin-Soo Kim ( jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics I/O systems Device characteristics: block vs. character I/O systems

More information

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University I/O, Disks, and RAID Yi Shi Fall 2017 Xi an Jiaotong University Goals for Today Disks How does a computer system permanently store data? RAID How to make storage both efficient and reliable? 2 What does

More information

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) I/O Fall 2011 Tore Larsen Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) Big Picture Today we talk about I/O characteristics interconnection devices & controllers (disks

More information

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) I/O Fall 2010 Tore Larsen Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) Big Picture Today we talk about I/O characteristics interconnection devices & controllers (disks

More information

CSE 153 Design of Operating Systems

CSE 153 Design of Operating Systems CSE 153 Design of Operating Systems Winter 2018 Lecture 20: File Systems (1) Disk drives OS Abstractions Applications Process File system Virtual memory Operating System CPU Hardware Disk RAM CSE 153 Lecture

More information

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13 I/O Handling ECE 650 Systems Programming & Engineering Duke University, Spring 2018 Based on Operating Systems Concepts, Silberschatz Chapter 13 Input/Output (I/O) Typical application flow consists of

More information

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017 CIS 5512 - Operating Systems I/O Systems & Secondary Storage Professor Qiang Zeng Fall 2017 Previous class Memory subsystem How to allocate physical memory? How to do address translation? How to be quick?

More information

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems Chapter 10: Mass-Storage Systems Silberschatz, Galvin and Gagne Overview of Mass Storage Structure Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 200 times

More information

Operating Systems. V. Input / Output. Eurecom

Operating Systems. V. Input / Output. Eurecom Operating Systems V. Input / Output Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Issues OS manages devices Protection Sharing Ease-of-use

More information

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 10: Mass-Storage Systems Zhi Wang Florida State University Content Overview of Mass Storage Structure Disk Structure Disk Scheduling Disk

More information

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2. BASIC ELEMENTS Simplified view: Processor Slide 1 Computer System Overview Operating Systems Slide 3 Main Memory referred to as real memory or primary memory volatile modules 2004/S2 secondary memory devices

More information

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition, Chapter 12: Mass-Storage Systems, Silberschatz, Galvin and Gagne 2009 Chapter 12: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management

More information

Lecture 9. I/O Management and Disk Scheduling Algorithms

Lecture 9. I/O Management and Disk Scheduling Algorithms Lecture 9 I/O Management and Disk Scheduling Algorithms 1 Lecture Contents 1. I/O Devices 2. Operating System Design Issues 3. Disk Scheduling Algorithms 4. RAID (Redundant Array of Independent Disks)

More information

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers I/O 1 Devices and Device Controllers network interface graphics adapter secondary storage (disks, tape) and storage controllers serial (e.g., mouse, keyboard) sound co-processors... I/O 2 Bus Architecture

More information

Bus Architecture Example

Bus Architecture Example I/O 1 network interface graphics adapter Devices and Device Controllers secondary storage (disks, tape) and storage controllers serial (e.g., mouse, keyboard) sound co-processors... I/O 2 Bus Architecture

More information

Operating Systems 2010/2011

Operating Systems 2010/2011 Operating Systems 2010/2011 Input/Output Systems part 2 (ch13, ch12) Shudong Chen 1 Recap Discuss the principles of I/O hardware and its complexity Explore the structure of an operating system s I/O subsystem

More information

Mass-Storage Structure

Mass-Storage Structure Operating Systems (Fall/Winter 2018) Mass-Storage Structure Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review On-disk structure

More information

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel Chapter-6 SUBJECT:- Operating System TOPICS:- I/O Management Created by : - Sanjay Patel Disk Scheduling Algorithm 1) First-In-First-Out (FIFO) 2) Shortest Service Time First (SSTF) 3) SCAN 4) Circular-SCAN

More information

Hard Disk Drives (HDDs)

Hard Disk Drives (HDDs) Hard Disk Drives (HDDs) Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3052: Introduction to Operating Systems, Fall 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism Chapter 13: Mass-Storage Systems Disk Scheduling Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices

More information

Chapter 13: Mass-Storage Systems. Disk Structure

Chapter 13: Mass-Storage Systems. Disk Structure Chapter 13: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices Operating System

More information

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Hard Disk Drives (HDDs) Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Virtualization Virtual CPUs Virtual memory Concurrency Threads Synchronization

More information

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling I/O 1 Devices and I/O key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling reading Three Easy Pieces: Chapters 36-37 I/O 2 Sys/161 Device

More information

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College CISC 7310X C11: Mass Storage Hui Chen Department of Computer & Information Science CUNY Brooklyn College 4/19/2018 CUNY Brooklyn College 1 Outline Review of memory hierarchy Mass storage devices Reliability

More information

Database Systems II. Secondary Storage

Database Systems II. Secondary Storage Database Systems II Secondary Storage CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 29 The Memory Hierarchy Swapping, Main-memory DBMS s Tertiary Storage: Tape, Network Backup 3,200 MB/s (DDR-SDRAM

More information

Storage Systems. Storage Systems

Storage Systems. Storage Systems Storage Systems Storage Systems We already know about four levels of storage: Registers Cache Memory Disk But we've been a little vague on how these devices are interconnected In this unit, we study Input/output

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University l Chapter 10: File System l Chapter 11: Implementing File-Systems l Chapter 12: Mass-Storage

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University Storage and Other I/O Topics I/O Performance Measures Types and Characteristics of I/O Devices Buses Interfacing I/O Devices

More information

Free Space Management

Free Space Management CSC 4103 - Operating Systems Spring 2007 Lecture - XVI File Systems - II Tevfik Koşar Louisiana State University March 22 nd, 2007 1 Free Space Management Disk space limited Need to re-use the space from

More information

CS420: Operating Systems. Mass Storage Structure

CS420: Operating Systems. Mass Storage Structure Mass Storage Structure James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Overview of Mass Storage

More information

Computer System Overview

Computer System Overview Computer System Overview Operating Systems 2005/S2 1 What are the objectives of an Operating System? 2 What are the objectives of an Operating System? convenience & abstraction the OS should facilitate

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 29: Computer Input/Output Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Announcements ECE Honors Exhibition Wednesday, April

More information

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018 CIS 3207 - Operating Systems I/O Systems & Secondary Storage Professor Qiang Zeng Spring 2018 Previous class Memory subsystem How to allocate physical memory? How to do address translation? How to be quick?

More information

Introduction to I/O and Disk Management

Introduction to I/O and Disk Management 1 Secondary Storage Management Disks just like memory, only different Introduction to I/O and Disk Management Why have disks? Ø Memory is small. Disks are large. Short term storage for memory contents

More information

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14 CS 134 Operating Systems April 8, 2013 Lecture 20 Input/Output Instructor: Neil Rhodes Hardware How hardware works Operating system layer What the kernel does API What the programmer does Overview 2 kinds

More information

I/O CANNOT BE IGNORED

I/O CANNOT BE IGNORED LECTURE 13 I/O I/O CANNOT BE IGNORED Assume a program requires 100 seconds, 90 seconds for main memory, 10 seconds for I/O. Assume main memory access improves by ~10% per year and I/O remains the same.

More information

Storing Data: Disks and Files

Storing Data: Disks and Files Storing Data: Disks and Files Chapter 7 (2 nd edition) Chapter 9 (3 rd edition) Yea, from the table of my memory I ll wipe away all trivial fond records. -- Shakespeare, Hamlet Database Management Systems,

More information

Mass-Storage Systems

Mass-Storage Systems CS307 Mass-Storage Systems Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2018 The First Commercial Disk Drive 1956 IBM RAMDAC computer included the IBM Model

More information

Tape pictures. CSE 30341: Operating Systems Principles

Tape pictures. CSE 30341: Operating Systems Principles Tape pictures 4/11/07 CSE 30341: Operating Systems Principles page 1 Tape Drives The basic operations for a tape drive differ from those of a disk drive. locate positions the tape to a specific logical

More information

UNIT 2 Data Center Environment

UNIT 2 Data Center Environment UNIT 2 Data Center Environment This chapter provides an understanding of various logical components of hosts such as file systems, volume managers, and operating systems, and their role in the storage

More information

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File File File System Implementation Operating Systems Hebrew University Spring 2007 Sequence of bytes, with no structure as far as the operating system is concerned. The only operations are to read and write

More information

Introduction to I/O and Disk Management

Introduction to I/O and Disk Management Introduction to I/O and Disk Management 1 Secondary Storage Management Disks just like memory, only different Why have disks? Ø Memory is small. Disks are large. Short term storage for memory contents

More information

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling I/O 1 Devices and I/O key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling reading Three Easy Pieces: Chapters 36-37 I/O 2 Sys/161 Device

More information

CSE 451: Operating Systems Winter I/O System. Gary Kimura

CSE 451: Operating Systems Winter I/O System. Gary Kimura CSE 451: Operating Systems Winter 2012 I/O System Gary Kimura What s Ahead Principles of I/O Hardware Structuring of I/O Software Layers of an I/O System Operation of an I/O System 2 Hardware Environment

More information

Readings. Storage Hierarchy III: I/O System. I/O (Disk) Performance. I/O Device Characteristics. often boring, but still quite important

Readings. Storage Hierarchy III: I/O System. I/O (Disk) Performance. I/O Device Characteristics. often boring, but still quite important Storage Hierarchy III: I/O System Readings reg I$ D$ L2 L3 memory disk (swap) often boring, but still quite important ostensibly about general I/O, mainly about disks performance: latency & throughput

More information

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage CSCI-GA.2433-001 Database Systems Lecture 8: Physical Schema: Storage Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com View 1 View 2 View 3 Conceptual Schema Physical Schema 1. Create a

More information

Overview of Mass Storage Structure

Overview of Mass Storage Structure CSC 4103 - Operating Systems Spring 2008 Lecture - XVIII Mass Storage & IO Tevfik Ko!ar Louisiana State University April 8th, 2008 1 Overview of Mass Storage Structure Magnetic disks provide bulk of secondary

More information

Input/Output Management

Input/Output Management Chapter 11 Input/Output Management This could be the messiest aspect of an operating system. There are just too much stuff involved, it is difficult to develop a uniform and consistent theory to cover

More information

Input / Output. Kevin Webb Swarthmore College April 12, 2018

Input / Output. Kevin Webb Swarthmore College April 12, 2018 Input / Output Kevin Webb Swarthmore College April 12, 2018 xkcd #927 Fortunately, the charging one has been solved now that we've all standardized on mini-usb. Or is it micro-usb? Today s Goals Characterize

More information

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova Mass-Storage ICS332 - Fall 2017 Operating Systems Henri Casanova (henric@hawaii.edu) Magnetic Disks! Magnetic disks (a.k.a. hard drives ) are (still) the most common secondary storage devices today! They

More information

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall 1 2 Differences

More information

Chapter 14: Mass-Storage Systems

Chapter 14: Mass-Storage Systems Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices Operating System

More information

Chapter 5. Input / Output

Chapter 5. Input / Output Chapter 5 Input / Output 1 The Spectrum of I/O Devices 2 Device Controllers The Device vs. its Controller Some duties of a device controller: Interface between CPU and the Device Start/Stop device activity

More information

1 What is an operating system?

1 What is an operating system? B16 SOFTWARE ENGINEERING: OPERATING SYSTEMS 1 1 What is an operating system? At first sight, an operating system is just a program that supports the use of some hardware. It emulates an ideal machine one

More information

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage hapter 12: Mass-Storage Systems hapter 12: Mass-Storage Systems Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management RAID Structure Objectives Moving-head Disk

More information

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage hapter 12: Mass-Storage Systems hapter 12: Mass-Storage Systems To explain the performance characteristics of mass-storage devices To evaluate disk scheduling algorithms To discuss operating-system services

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: November 28, 2017 at 14:31 CS429 Slideset 18: 1 Random-Access Memory

More information

Chapter 14: Mass-Storage Systems. Disk Structure

Chapter 14: Mass-Storage Systems. Disk Structure 1 Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices Operating System

More information

COT 4600 Operating Systems Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM

COT 4600 Operating Systems Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM Lecture 23 Attention: project phase 4 due Tuesday November 24 Final exam Thursday December 10 4-6:50

More information

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition Chapter 13: I/O Systems Silberschatz, Galvin and Gagne 2013 Chapter 13: I/O Systems Overview I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: April 9, 2018 at 12:16 CS429 Slideset 17: 1 Random-Access Memory

More information

Today: Secondary Storage! Typical Disk Parameters!

Today: Secondary Storage! Typical Disk Parameters! Today: Secondary Storage! To read or write a disk block: Seek: (latency) position head over a track/cylinder. The seek time depends on how fast the hardware moves the arm. Rotational delay: (latency) time

More information

I/O Systems. Jo, Heeseung

I/O Systems. Jo, Heeseung I/O Systems Jo, Heeseung Today's Topics Device characteristics Block device vs. Character device Direct I/O vs. Memory-mapped I/O Polling vs. Interrupts Programmed I/O vs. DMA Blocking vs. Non-blocking

More information

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory Memory Hierarchy Contents Memory System Overview Cache Memory Internal Memory External Memory Virtual Memory Memory Hierarchy Registers In CPU Internal or Main memory Cache RAM External memory Backing

More information

Operating Systems. Operating Systems Professor Sina Meraji U of T

Operating Systems. Operating Systems Professor Sina Meraji U of T Operating Systems Operating Systems Professor Sina Meraji U of T How are file systems implemented? File system implementation Files and directories live on secondary storage Anything outside of primary

More information