Storage StructureStorage systems organized in hierarchy- Speedregisters- CostcacheVolatilitymainmemorysolid-statediskharddiskopticaldiskmagnetictapes
Storage Structure • Storage systems organized in hierarchy – Speed – Cost – Volatility
StorageStructureMainmemory- CpU can load instructions only from memory (only largestorage media that the CPU can access directly)-Randomaccess,typicallysmall sizeandvolatile-All forms of memoryprovide an array of bytes·Eachbytehas itsownaddress· Interaction: load & store (memory<->register)Instruction-execution cycle- Fetch an instruction from memory and store in register- Decode instruction (fetch operands if necessary)-Storeresultbacktomemory
Storage Structure • Main memory – CPU can load instructions only from memory (only large storage media that the CPU can access directly) – Random access, typically small size and volatile – All forms of memory provide an array of bytes • Each byte has its own address • Interaction: load & store (memory <-> register) • Instruction-execution cycle – Fetch an instruction from memory and store in register – Decode instruction (fetch operands if necessary) – Store result back to memory
StorageStructureSecondary storage-extension of main memory thatprovides large nonvolatile storage capacity-Hard disks-rigid metal orglass platters covered withmagnetic recording material. Disk surface is logically divided into tracks, which are subdivided intosectors.The disk controller determines the logical interaction between thedevice and the computer-Solid-statedisks-fasterthanharddisks,nonvolatile·Varioustechnologies· Becoming more popular
Storage Structure • Secondary storage – extension of main memory that provides large nonvolatile storage capacity – Hard disks – rigid metal or glass platters covered with magnetic recording material • Disk surface is logically divided into tracks, which are subdivided into sectors • The disk controller determines the logical interaction between the device and the computer – Solid-state disks – faster than hard disks, nonvolatile • Various technologies • Becoming more popular
CachingCaching- copying information into faster storagesystem; main memory can be viewed as a cache forsecondary storageFaster storage (cache) checked first to determine ifinformation is there- If it is, information used directly from the cache (fast)- If not, data copied to cache and used there Cache smaller than storage being cached-Cachemanagement importantdesignproblem- Cache size and replacement policyImportant principle, performed at many levels in acomputer (in hardware, operating system, software)
Caching • Caching – copying information into faster storage system; main memory can be viewed as a cache for secondary storage • Faster storage (cache) checked first to determine if information is there – If it is, information used directly from the cache (fast) – If not, data copied to cache and used there • Cache smaller than storage being cached – Cache management important design problem – Cache size and replacement policy • Important principle, performed at many levels in a computer (in hardware, operating system, software)
I/oStructureStorage is only one of many types of I/O devicesDevicecontroller-Morethanonedevicemaybeattached- Local buffer storage & a set of registersDevice driver: for each device controller to manage l/Oprovides uniform interface between controller and kernelInterrupt-driven I/O-Devicedriverloadsregisterswithinthecontroller- Controller examines the registers to decide what action to take-Devicecontrollerstarts data transferto its localbufferInforms driver via an interrupt and returns control to os
I/O Structure • Storage is only one of many types of I/O devices • Device controller – More than one device may be attached – Local buffer storage & a set of registers • Device driver: for each device controller to manage I/O, provides uniform interface between controller and kernel • Interrupt-driven I/O – Device driver loads registers within the controller – Controller examines the registers to decide what action to take – Device controller starts data transfer to its local buffer – Informs driver via an interrupt and returns control to OS