Download IO Systems: Understanding Disk Behavior, Management, and Interfaces and more Slides Computer Science in PDF only on Docsity! 12: IO Systems 1 OPERATING SYSTEMS IO SYSTEMS Docsity.com 12: IO Systems 2 IO SYSTEMS This material covers Silberschatz Chapters 12 and 13. Mass Storage - hardware This is about Disk Behavior and Management. • Disk Characteristics • Space Management • RAID • Disk Attachment IO Interface – how the OS interfaces to the hardware The busses in the computer and how the O.S. interfaces to it. • Talking to the IO – Polling, Interrupts and DMA • Application IO Interface • Kernel IO Subsystem Docsity.com 12: IO Systems 5 Disk Management Disk formatting Creates a logical disk from the raw disk. Includes setting aside chunks of the disk for booting, bad blocks, etc. Also provides information needed by the driver to understand its positioning. Boot block That location on the disk that is accessed when trying to boot the operating system. It's a well-known location that contains the code that understands how to get at the operating system - generally this code has a rudimentary knowledge of the file system. Bad blocks The driver knows how to compensate for a bad block on the disk. It does this by putting a pointer, at the location of the bad block, indicating where a good copy of the data can be found. Swap Space Management The Operating System requires a contiguous space where it knows that disk blocks have been reserved for paging. This space is needed because a program can't be given unshared memory unless there's a backing store location for that memory. Mass-Storage Structure Docsity.com 12: IO Systems 6 Disk Attachment Host-attached storage • accessed through I/O ports talking to I/O busses • SCSI itself is a bus, up to 16 devices on one cable, SCSI initiator requests operation and SCSI targets perform tasks • Each target can have up to 8 logical units (disks attached to device controller • Fibre Channel (FC) is high-speed serial architecture • Can be switched fabric with 24-bit address space – the basis of storage area networks (SANs) in which many hosts attach to many storage units • Serial ATA (SATA) – current standard for home & medium sized servers. • Advantage is low cost with “reasonable” performance. Mass-Storage Structure Docsity.com 12: IO Systems 7 Disk Attachment Network-attached storage • Network-attached storage (NAS) is storage made available over a network rather than over a local connection (such as a bus) • NFS and CIFS are common protocols • Implemented via remote procedure calls (RPCs) between host and storage • New iSCSI protocol uses IP network to carry the SCSI protocol Mass-Storage Structure Docsity.com 12: IO Systems 10 RAID These are the various levels of RAID. The reliability increases with higher levels. In practice, only levels 0, 1, 5 and 10 are typically used. • Several improvements in disk-use techniques involve the use of multiple disks working cooperatively. • Disk striping uses a group of disks as one storage unit. • RAID schemes improve performance and improve the reliability of the storage system by storing redundant data. • Mirroring or shadowing keeps duplicate of each disk. • Block interleaved parity uses much less redundancy. Mass-Storage Structure Docsity.com 12: IO Systems 11 RAID RAID 10 becoming more and more popular. Mass-Storage Structure Docsity.com 12: IO Systems 12 What Kind Of Storage Should You Use? Price per Megabyte of DRAM, From 1981 to 2004 Mass-Storage Structure Price per Megabyte of Hard Disk, From 1981 to 2004 Is it only about price?? Where does speed fit in? Docsity.com 12: IO Systems 15 Polling and Interrupts CPU Interrupt request line triggered by I/O device Interrupt handler receives interrupts Maskable to ignore or delay some interrupts Interrupt vector to dispatch interrupt to correct handler • Based on priority • Some unmaskable Interrupt mechanism also used for exceptions. IO SYSTEMS Docsity.com 12: IO Systems 16 Polling and Interrupts When you get an interrupt, you need to be able to figure out the device that gave you the interrupt. These are the interrupt vectors for an Intel Processor. Notice that most of these are actually exceptions. IO SYSTEMS Docsity.com 12: IO Systems 17 Synchronous or Asynchronous Synchronous does the whole job – all at one time – data is obtained from the device by the processor. Asynchronous has the device and the processor acting in time independent of each other. IO SYSTEMS Docsity.com 12: IO Systems 20 Interfaces Block and Character Devices • Typical for disks – use read(), write(), seek() sequence. Network Devices Clocks and Timers • The OS uses an incredible number of clock calls – many events are timestamped within the OS Blocking and Non-Blocking IO • Non- Blocking: Some devices are started by the OS, and then proceed on without further OS intervention. The delay timer in our project works this way. • Blocking: Any Read-Device will be blocking since the program can’t proceed until it gets the information it wanted from the device. IO SYSTEMS Docsity.com 12: IO Systems 21 Kernel IO Subsystem Buffering • Used to interface between devices of different speeds (modem and disk for instance.) • Interface between operations having different data sizes. (small network packets as part of a bigger transfer.) • Users often read or write small number of bytes – but the disk wants 4096 bytes. The filesystem maintains this buffer. Spooling Kernel data structures – what needs to be maintained to • Support the device • Support an instance of opening the device. IO SYSTEMS Docsity.com 12: IO Systems 22 Kernel IO Subsystem The steps in an IO request. IO SYSTEMS Docsity.com