Operating System18 - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Operating System18

Description:

... 10 platters. 1.68GB/platter. 13,085 tracks/platter. 256 ... Platters: 5. Sectors per track: 370-792. Data rate: 174-374Mbps. IBM 75GXP Virtual Specification ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 43
Provided by: epccSj
Category:

less

Transcript and Presenter's Notes

Title: Operating System18


1
Operating System(18)
  • Minyi Guo
  • Dept. of Computer Science and Engineering,
  • Shanghai Jiaotong University

2
Input/Output
  • Principles of I/O hardware
  • Principles of I/O Software
  • I/O software layers
  • Disks/Clocks/Char-Oriented Terminals
  • GUI/Network Terminals
  • Power management

3
Disks
  • Come in a variety of types
  • Magnetic disks
  • hard disk and floppy disks
  • Optical disks
  • CD-ROM, CD-RW, DVD

4
Magnetic Disks
  • Integral part of a computer system
  • Some contains a microcontroller
  • IDE Disks
  • Some have little electronics and just deliver a
    simple serial bit of stream
  • Let the device controller do all the work

5
Magnetic Disks
  • Some disks offer parallel processing
  • Doing seek on two ore more drives
  • Overlapped seeks
  • Read/write while seeking on another drive
  • Floppy disk cannot offer parallelism

6
Disk Drives
  • Disks are usually organized into drives
  • A drive may have up to 16 disks
  • With each disk having its own read/write head
  • Read data from one disk at a time

7
Tracks and Cylinders
  • The surface of a disk is divided in tracks
  • A track is one cycle
  • All tracks of a disk drive forms a cylinder
  • A disk drive can have up to 16 disks
  • Each track is further divided into sectors
  • A sector is the basic unit of I/O

8
Disk Drives
9
Sectors
  • Numbered from 0 to some maximum
  • Sectors can either be continuous or interleave
  • Continuous logically adjacent physical
    adjacent
  • Interleave logically adjacent ! physical
    adjacent

10
Sectors
  • Gaps are maintained between sectors
  • This allows continuous read

11
RAID
  • Redundant Array of Inexpensive Disks
  • Redundant Array of Independent Disks
  • Goal improve performance and reliability
  • Idea use multiple disks (drives) as 1 unit
  • Key technique stripe

12
RAID
  • Depending on how stripe is implemented
  • RAID can be classified into 6 levels
  • RAID 0 stripe in blocks
  • Performance improved, better for large request
  • Bad for small request, worse reliability, no
    redundancy

13
RAID
  • RAID 1 full redundancy, may or may not stripe
  • Write twice, performance of read is up to twice
    as good
  • RAID 2 stripe in bits, many dedicated ECCs

14
RAID
  • RAID 3 stripe in words, less ECC
  • RAID 4 stripe in blocks with dedicated ECC
  • RAID 5 stripe in blocks with round-robin ECC
  • RADI 2 and 3 require disk synchronization

15
Raid levels 0 through 2
16
Raid levels 3 through 5
17
Disk Read/Write Process
  • First move head to the correct cylinder
  • seek
  • Wait for the sector to pass by the head
  • rotation
  • Actually read/write data
  • transfer

18
Seek Time
  • Seek time
  • Time for I/O head to reach desired track.
  • Track-to-track time
  • Time to move from track to an adjacent track
  • Average Seek time
  • Average time to reach a track for random access

19
Delay time
  • Rotational Delay or Latency
  • Time for I/O head to reach the wanted data as the
    disk rotate
  • One half of a rotation on average
  • At 7200 rpm, this is 8.3/2 4.2ms

20
Transfer time
  • Time for data to move under the I/O head
  • At 7200 rpm
  • Number of sectors read / Number of sectors per
    track 8.3ms

21
Disk Spec Example
  • 16.8 GB disk with 10 platters
  • 1.68GB/platter
  • 13,085 tracks/platter
  • 256 sectors/track
  • 512 bytes/sector

22
Disk Spec Example
  • Track-to-track seek time 2.2 ms
  • Average seek time 9.5ms
  • Interleaving factor of 3
  • 5400RPM

23
Disk Access Cost Example
  • Read a 1MB file divided into 2048 records of 512
    bytes (1 sector) each
  • Assume all records are on 8 contiguous tracks
  • First track 9.5 11.1/2 3 x 11.1 48.4 ms
  • Remaining 7 tracks 2.2 11.1/2 3 x 11.1
    41.1ms
  • Total 48.4 7 41.1 335.7ms

24
How Much to Read
  • Read time for one track
  • 9.5 11.1/2 3 x 11.1 48.4ms
  • Read time for one sector
  • 9.5 11.1/2 (1/256)11.1 15.1ms

25
How Much to Read
  • Read time for one byte
  • 9.5 11.1/2 15.05 ms
  • Nearly all disk drives read/write one sector at
    every I/O access
  • Also referred to as a page

26
Physical Geometry
  • Different tracks have different length
  • Outer tracks are longer than inner tracks
  • thus tracks may have differing of sectors
  • But this cause difficult to OS
  • Solution is to provide a virtual geometry

27
Physical Geometry of a Disk
Physical geometry of a disk with two zones
A possible virtual geometry for this disk
28
IBM 75GXP Specification
  • Size 461,
  • Capacity 76GB
  • RPM 7200
  • Platters 5
  • Sectors per track 370-792
  • Data rate 174-374Mbps

29
IBM 75GXP Virtual Specification
  • Number of tracks 34327
  • Sectors per track 512
  • Average seek time 9.2ms
  • Track density 28350/in

30
Disk Formatting
  • Disk must be formatted to be useful
  • Format involves writing basic information into
    the disk
  • Sector information
  • Boot information, Partition tables
  • Reserved spare sectors
  • Formatted capacity is 20 lower than the
    unformatted capacity

31
Disk Formatting
  • A disk sector
  • The preamble starts with a certain bit pattern
    that allows the hardware to recognize the start
    of a sector, also contains the cylinder and
    sector
  • ECC contains error correction code for data
    recovery

32
Cylinder Skew
  • To allow continuous read of data across
    cylinders, the numbering of sectors in
    neighboring cylinders are gapped
  • To allow continuous read of data in the same
    track, sector may also be skewed

33
Cylinder Skew
34
Sector Interleaving
No interleaving Single
interleaving Double interleaving
35
Disk Arm Scheduling
  • Time required to read or write a disk block
    determined by 3 factors
  • Seek time
  • Rotational delay
  • Actual transfer time
  • Seek time dominates

36
Disk Arm Scheduling
  • Scheduling goal is to minimize total seek time
  • Scheduling Algorithm
  • Shortest Seek First (SSF)
  • Elevator Scheduling

37
Disk Arm Scheduling
Initial position
Pending requests
  • Shortest Seek First scheduling algorithm

38
Disk Arm Scheduling
Elevator algorithm for scheduling requests
39
Error Handling
  • Disk defect is inevitable
  • Defect in uniform substrate
  • Defect in fine oxide coating
  • Motion defect increase as time goes
  • by Read/write head moves into the wrong place
  • Environment pollution
  • Dust and speck cause temporary RW errors

40
Error Handling
  • Disk defect cause bad blocks
  • If the defect is small, let the ECC correct
  • Otherwise, let entire sector go bad and
  • deal with bad sector in controller or OS

41
Error Handling
  • 2 approaches to handle bad sectors
  • Deal with them in controller
  • Disk tested before shipping
  • bad sector marked and substituted with spare
  • Deal with them in operating system
  • OS check for bad sectors and record them

42
Error Handling
(a) Found a bad sector in a disk track (b) Find a
replace sector (c) Shift all sectors to bypass
the bad sector
Write a Comment
User Comments (0)
About PowerShow.com