Clemson University -- CPSC 231 -- Spring 2010 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., disk specs - Fujitsu MAP 3147 * formatted capacity: 147 GB + number of disks (i.e., platters): 4 + number of data heads: 8 + sector size: 512 bytes + number of recording zones per surface: 18 - sectors/track ranges from 533 inner zone to 936 outer zone + recording density (maximum): 600,000 BPI + track density: 63,100 TPI - 48,000 cylinders * seek time (read): 4.5 ms (avg.); track to track 0.3 ms; full 10 ms + write seeks are slightly longer (5ms, 0.5ms, 11ms, respectively) * rotational latency: 2.99 ms (avg.) + rotational speed: 10,000 RPM * disk transfer rate: 62-107 MB/sec * interface transfer rate: 320 MB/sec (Ultra320 SCSI) * sustained data rate: 40-70 MB/sec * data buffer (i.e., cache on controller): 8 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")