CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 5 Disks CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.

Slides:



Advertisements
Similar presentations
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
Advertisements

Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD hard disk.
I/O Management and Disk Scheduling
T0542 / Disk Hardware 1. Magnetic disk • Cylindes, tracks • IDE (Integrated Drive Electronics) • Overlapped seek • Logical block addressing DISKS.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
1 Pertemuan 19 Disk Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS03.
CS 277 – Spring 2002Notes 21 CS 277: Database System Implementation Notes 02: Hardware Arthur Keller.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Input/Output Management and Disk Scheduling
Operating Systems Input/Output Devices (Ch , 12.7; , 13.7)
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management – 4 Page Replacement Algorithms CS 342 – Operating Systems.
Fig 5-5 Interrupts Handling
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
CS 333 Introduction to Operating Systems Class 16 – Secondary Storage Management Jonathan Walpole Computer Science Portland State University.
Disks.
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 3 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.
Operating Systems Input/Output Devices (Ch 5: )
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Operating Systems COMP 4850/CISG 5550 Disks, Part II Dr. James Money.
Computer SCIENCE Data Representation and Machine Concepts Section 1.3
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
1 Recitation 8 Disk & File System. 2 Disk Scheduling Disks are at least four orders of magnitude slower than main memory –The performance of disk I/O.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
CSC 322 Operating Systems Concepts Lecture - 26: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Sistem Operasi IKH311 Masukan Luaran (Input/Output)
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
Lecture 40: Review Session #2 Reminders –Final exam, Thursday 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-2: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Storing Data Dina Said 1 1.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Disk Basics CS Introduction to Operating Systems.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 9-1: Disk Scheduling Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk storage systems Question#1 (True/False) A track is divided into multiple units called sectors.
CS399 New Beginnings Jonathan Walpole. Disk Technology & Secondary Storage Management.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
Magnetic Disk Rotational latency Example Find the average rotational latency if the disk rotates at 20,000 rpm.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Part IV I/O System Chapter 12: Mass Storage Structure.
Device Management Andy Wang Operating Systems COP 4610 / CGS 5765.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
Sarah Diesburg Operating Systems CS 3430
Multiple Platters.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
Disks.
Jonathan Walpole Computer Science Portland State University
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
Disks and scheduling algorithms
Persistence: hard disk drive
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
CS333 Intro to Operating Systems
CSE 451: Operating Systems Autumn 2004 Secondary Storage
Disks Magnetic (hard) Disk arrays are used for reliable storage (RAID)
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 5 Disks CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University Department of Computer Engineering

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 2 Disks have many types  Magnetic disks Hard disk Floppy disk  Optical disks CD-ROM CD-Writable CD-Recordable DVDs

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 3 Magnetic Disks Organized into cylinders  Each cylinders contains tracks whose number is equal to the number of heads in the disk drive Each track is divided into a number of sectors: 8-32 sectors/track.  The sector size is usually 512 bytes. There are IDE disks There are SCSI disks, etc.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 4 A Hard Disk Disk Arm Arm motion path Disk Head One platter

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 5 One cylinder One track One sector

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 6 Disk Parameters ParameterWD Hard Disk Number of cyclinders10601 Tracks per cyclinder12 Sectors per track281 (average) Sectors per disk Bytes per sector512 Disk capacity18.3 GB Seek time (adjacent cylinders)0.8 msec Seek time (average case)6.9 msec Rotation time8.33 msec Motor stop/start time20 sec Time to transfer 1 sector 17  sec

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 7 Physical Geometry Two zones DiskOne zone Disk

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 8 Disk Formatting After manufacturing, there is no information on the disk  Just empty bits. Each platter need to have  A low-level format  A high-level format before disk can be used.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 9 Disk Formatting Each track should have formatted in the following way:  Sectors and inter-sector-gap between them  A sector will be have format like the following: Preable – data (512 bytes) – Checksum sector preambleData (512 bytes)ECC (~16 bytes) -certain bit pattern - cylinder number -sector number

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 10 Cylinder Skew Direction of rotation Sweep path > time to change track (cyclinder)

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 11 Interleaving registers CPU MEMORY Disk Controller 1 sector buffer (1) (2) (3)

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 12 Interleaving If we have ONE sector buffer in the disk controller:  After we have transferred one sector of data from hard-disk ton controller buffer: We will copy the controller buffer to the memory  This may take time. During this time, the disk-head will pass the start of the next sector. Therefore, the next logical sector, should not be the next physical sector in hard-disk.  There should be some interleaving.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 13 Interleaving Non-interleaving Single Interleaving Double Interleaving

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 14 Disk Arm Scheduling How long does it take to read a block (sector)  Seek time Move arm to the correct cyclinder  Rotational delay Wait until correct sector comes under head.  Actual data transfer time For most systems, the seek time dominates the other two times.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 15 Disk Arm Scheduling Assume the disk is heavily loaded.  There are a lot requests for disk blocks that are arriving to the hard disk driver.  The drivers queues the requests. The driver knows for each block request, where in hard disk the block should be stored (the cylinder number).  Since moving between cylinders (seek time) is costly, we should try to minimize these seek times.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 16 Disk Arm Scheduling Disk driver  Keeps a table of requests.  Table is indexed by the cylinder number  Blocks Requests for the same cylinder are put in a linked list. xxxxx Initial position pending requests cylinder number

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 17 Disk Arm Scheduling Algorithms Several Algorithms Exist  First Come First Served (FCFS)  Shortest Seek First (SSF)  Elevator Algorithm

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 18 FCFS Serve the request in the order they arrive (don’t look to the cylinder numbers) Example:  Assume the current position is cylinder 11.  The following requests arrive in the given time order: 1, 36, 16, 34, 9, 12  The request will be served in the same order.  The head will go to: Cylinder 1 first (10 cylinder motion) Cylinder 36 next (35 cylinder motion) Cylinder 16 next (20) Cylinder 34 next (18) Cylinder 9 next (25) Cylinder 12 next (3) Total of 111 cylinders are skipped. Cost = 111

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 19 FCFS xxxxx xx New request arrival sequence: 1, 36, 16, 34, 9, 12 Initial head position

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 20 Shortest Seek First Satisfy the request that need shortest seek from the current position. In the previous example, this algorithms moved the head to cylinders in the order given below.  12, 9, 16, 1, 34, and 36. Moving the head to these cylinders require:  1, 3, 7, 15, 33, and 2 arm motions (that many cylinders are skipped at every request).  Total cost = 61.

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 21 SSF xxxxx xx New request arrival sequence: 1, 36, 16, 34, 9, 12 Initial head position

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 22 Elevator Algorithm Do like what an elevator does.  1. Move in one direction until all request in that direction is served  2. Then change direction.  3. Move in the new direction until all request in that direction are server.  Repeat steps 1, 2, and 3. In the previous example  Assume initial position was 11 and initial direction was up (going to higher numbered cylinders).

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 23 Elevator Algorithm xxxxx xx New request arrival sequence: 1, 36, 16, 34, 9, 12 Initial head position

CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University 24 Elevator Algorithm The request are server in the following order:  12, 16, 34, 36, 9, 1 Arm motions (# of cylinder skips)  1, 4, 18, 2, 27, 8  Total cost = 60 cylinders. Performs good and is fair.