Clemson University -- CPSC 231 -- Fall 2009 I/O - input/output system components: CPU, memory, and bus -- now add I/O controllers and peripheral devices +-----+ | CPU | +-----+ |cache| +-----+ | +============================================+ bus | | | +--------+ +-----------+ +-----------+ | memory | |controller | |controller | | | +-----------+ +-----------+ |+------+| | | || I/O || +-----------+ +-----------+ ||buffer|| | device | | device | |+------+| +-----------+ +-----------+ | | | | +--------+ Devices source: e.g., keyboard, mouse, scanner sink: e.g., monitor, printer source/sink: e.g., modem, network connection slow memory: e.g., disk, tape keyboard - e.g., consider how keyboard on PC works: - each key press causes an interrupt and sends a scan code - each key release also causes an interrupt and sends a scan code - keyboard ISR must keep track of scan codes and translate to ASCII (e.g., consider that a capital 'A' requires four interrupts) - auto-repeat function requires a timer to be set at each depress and special processing should it go off prior to key release - "raw mode" - all characters sent to buffer and on to program - "cooked mode" - special characters processed in buffer before sending to program - e.g., backspace and/or delete monitor - again, consider a PC - memory-mapped display buffer - monitor adapter refreshes display from display buffer, will often use special dual-ported memory chips (VRAM) disk - rotating platters covered with magnetic oxide coating - collection of read/write heads, one per surface, mounted on "arm", which moves in and out - concentric circles defined by where r/w head can be positioned are called tracks, and the set of parallel tracks defined by one arm position is called a cylinder - simple disks have fixed number of sectors per track, and small number of bytes per sector (e.g., 512) - disk access requires: * "seek" - arm motion of 2-20 msecs * "rotational latency" - wait until proper sector rotates under the r/w/ head, 1/2 rotation on avg., 8.3 msecs for 3600 rpm * "transfer" - time to read or write sector, depends on sector size, fraction of msec e.g., high performance disk - IBM Ultrastar 36Z15 hard disk drive * formatted capacity: 36.7 GB + sector size: 512-528 bytes (variable, in 2-byte increments) + number of disks (i.e., platters): 6 + number of data heads: 12 + number of recording zones per surface: 11 + areal density (maximum): 10,700 Mbits/sq. in. + recording density (maximum): 397,000 BPI + track density: 27,000 TPI * seek time: 4.1 ms (avg.); track to track 0.65 ms; full 8.5 ms * rotational latency: 2.00 ms (avg.) + rotational speed: 15,000 RPM * disk transfer rate: 453-647 Mbits/sec * interface transfer rate: 160 MB/sec (Ultra160 SCSI) or 320 MB/sec (Ultra320 SCSI) * sustained data rate: 36.6 or 52.8 MB/sec * data buffer (i.e., cache on controller): 4 MB Bus address lines data lines control lines (read, write, interrupt request, ...) Bus and disk interface standards PC bus: ISA, EISA, VESA, PCI, ... SPARC bus: Sbus, Mbus, Xbus, ... PC disk: SCSI, IDE, EIDE, ... SCSI slow, but handles 7 devices IDE slow, limited to 2 small disks EIDE fast, handles disks, CDROMs, etc. wide SCSI fastest EIDE drives cheaper than SCSI RAID storage - "Redundant Array of Inexpensive Disks" (now common to see "Redundant Array of Independent Disks") RAID --concurrent-- redundancy striping number level reads writes level of disks ----- ----- ------ ---------- -------- -------- 0 yes yes none block n 1 yes no mirroring none 2n 2 no no ECC bit n+k 3 no no parity bit/byte n+1 4 yes no parity block n+1 5 yes yes distributed block n+1 6 yes yes distributed block n+2 10/01 yes no mirroring block 2n level 0 - no redundancy but parallel access, called "striping" * n disks level 1 - disk mirroring/shadowing * 2n disks * multiple, simultaneous I/Os are allowed * each write goes to two disks * read from either (e.g., choose one with shortest seek time or with fewest queued requests) level 2 - bit interleaved array - similar to ECC * n+k disks * dedicated ECC disks * expensive and uncommon level 5 - rotated parity * n+1 disks * rotated parity allows multiple, simultaneous writes * most popular among levels 3,4,5 level 10 - striped mirrors - 2n disks with n-way striping of n disk pairs level 01 - mirrored stripes - 2n disks with mirroring of n-way striped disks commercial systems emphasize reliability and use high quality disks, also use redundant power supplies, etc., to remove single points of failure enhancements include battery-backed write-back cache in controller and dynamic hot sparing adaptive RAID allows segments to be dynamically reconfigured at level 1 or level 5 (background relocation of sectors, called "rebalancing")