SlideShare a Scribd company logo
1 of 52
Download to read offline
Chapter 9

I/O System
Input/Output System
Major objectives:
• Take an application I/O request and
  send it to the physical device.
• Take whatever response comes back
  from the device and send it to the
  application.
• Optimize the performance of the
  various I/O requests.
2
General I/O Issues
• The operating system is able to improve overall
  system performance if it can keep the various
  devices as busy as possible.
• It is important for the operating system to handle
  device interrupts as quickly as possible.
     – For interactive devices (keyboard, mouse, microphone),
       this can make the system more responsive.
     – For communication devices (modem, Ethernet, etc), this
       can affect the effective speed of the communications.
     – For real-time systems, this can be the difference
       between the system operating correctly and
 3
       malfunctioning.
Disk Drive Mechanism




4
Disk Structure and Organization

• Moving-head disk - one head per surface

• Fixed-head disk - one head per track

• Data on a disk is addressed by:
    – Cylinder
    – Surface
    – Sector
5
Disk Structure
• Disk drives are addressed as large 1-dimensional
  arrays of logical blocks, where the logical block is
  the smallest unit of transfer.

• The 1-dimensional array of logical blocks is
  mapped into the sectors of the disk sequentially.
    – Sector 0 is the first sector of the first track on the
      outermost cylinder.
    – Mapping proceeds in order through that track, then the
      rest of the tracks in that cylinder, and then through the
      rest of the cylinders from outermost to innermost.
6
Disk Track Format




7
Direct Access Storage Devices
• Otherwise known as DASDs
     – Devices that can directly read or write to a
       specific place on a disk or drum
     – Also called random access storage devices


• Grouped into two major categories
     – fixed read/write heads
     – movable read/write heads

8
Fixed-Head Drums
• Developed in the early 1950s
    – access times of 5 to 25 ms were considered
      fast
    – used a drum with a capacity of 2000 bytes
      • later increased to 4000 bytes
      • speed was 200 rpm
      • much faster than other drums of the time which
        were only 50-60 rpm
• By 1970 drums increased to 1 megabyte and
  speed of 3000 rpm
9
Fixed-Head Drums
•    Resemble a giant coffee can
•    Covered with magnetic film
•    Formatted so tracks run around it
•    Data recorded serially on each track by
     the read/write head positioned over it

These drums were quite fast, yet expensive
 and did store as much as other DASDs.
10
Fixed-Head Disks
• Disks resemble phonograph record albums
  covered with magnetic film that has been
  formatted into concentric circles called tracks

• Data is recorded in the same manner as
  fixed-head drum

• These were very expensive and had less
  storage space as compared to movable-head
  disks but were faster.
11
Movable-Head Drums
• Consist of a few read/write heads that
  move from track to track to cover the
  entire surface of the drum

• Device that is least expensive has only
  one read/write head for the whole drum

• Drums with several read/write heads work
  faster but also cost more
12
Movable-Head Disks

     The read/write head floats over the
       surface of the disk:
     • Exist as individual units, as in a PC
     • Can also be in a disk pack, which is a
       stack of disks



13
Disk Pack
A typical disk pack consists of several
  platters that are stacked on a common
  central spindle, with a slight space
  between them so the read/write heads can
  move between the pairs of disks.




14
Architecture of M-Head Disks
• Each platter has two surfaces for
  recording, except the top and bottom

• Each surface is formatted with specific
  numbers of tracks for the data to be
  recorded on
     – number of tracks varies depending on the
       manufacturer
     – usually range from 200 to 800 tracks

15
Optical Storage
• Direct access storage

• CD-ROMs contained the first optical
  storage DASDs
     – these were incompatible with most systems,
       as they were developed for a single system

• Is a major contender for the replacement
  of magnetic disks because it has high-
  density storage and durability
16
Function of Optical Disc
• Optical disc drive functions similar to the
  magnetic disk drive

• Read head is on an arm that moves
  forward and backward, track to track
     – disc rotates at 200-500 rpm
     – average seek time is 500 ms and maximum
       seek is 1 second
     – transfer rate is about 150 kilobytes/second

17
CD Storage Capacity

CD-ROM has large storage potential, more
 than 700 megabytes of data




18
Read/Write
• To read or write data, disk device must move the
  arm to the appropriate track.
• The time to carry this out this is called Seek Time.
• Then, the disk device must wait for the desired
  sector/data to rotate into position under the head
  (rotational latency).
• Each track is recorded in units called Sectors. A
  sector is the smallest amount of data that can be
  physically read or written.

 19
Disk Access Time
The disk access time can be calculated as
 follows:

Disk Access time =
         Seek time + Rotational Latency




20
I/O Requests
• In general, there may be many I/O
  requests for a device at the same time.

• These requests may come from multiple
  processes or the same process.




21
I/O System Structure




22
Stages of an I/O Request




23
I/O Device Handling
• A Queue of Pending Requests

• A Resource Scheduler that determines the
  next request to execute

• A Mechanism to initiate the next request
  whenever a request completes.

24
I/O Request Queuing




25
I/O Performance Optimization
• I/O processing is much slower than CPU
  processing. Every physical disk I/O has a
  dramatic impact on system performance

• To improve I/O performance:
     – Reduce the number of I/O requests
     – Carry out buffering and/or caching
     – I/O Scheduling

26
Reducing Number of I/O Requests
• The most efficient I/O request is one that
  is never requested




27
Buffering and Caching
• The I/O system should make the physical I/O
  requests as big as possible.

• This will reduce the number of physical I/O
  requests by the buffering factor used.

• The application's logical I/O requests should copy
  data to/from a large memory buffer. The physical
  I/O requests then transfer the entire buffer.

28
Buffered Write




29
I/O Scheduling
• For most devices, a FCFS (First-Come-First-
  Serve) scheduling algorithm is appropriate.
  For example, one wants the segments of a
  music file to be played in sequential order.

• For some devices (disks especially), the
  order in which requests are processed is not
  inherently constrained by the device
  characteristics.
 30
I/O Scheduling (Cont.)
• On a typical system, there will be pending disk
  I/O requests from many different processes.

• The correct functioning of these processes
  usually does not depend on the order in which
  the disk I/O operations actually occur.

• Thus, we will want the Resource Scheduler to
  attempt to optimize performance for devices
  such as disks.

31
Context Switching in I/O
• In CPU scheduling, the context-switch time is
  relatively small with respect to the service
  time
• In I/O scheduling the context-switch time is
  relatively large with respect to the service
  time

The time to move the head between cylinders is
  much greater than the time it takes to read or
  write to a cylinder.
32
Goal of Disk Scheduling
• In any disk system with a moving
  read/write head, the seek time between
  cylinders takes a significant amount of
  time

• This traveling head time should be
  minimized


33
An Analogy

• Traveling service person, a technician who
  has to service requests from several clients
  in a geographical area

• Often spends more time driving than
  actually carrying out service


34
Purpose of Disk Scheduling

• Select a disk request from the queue of
  I/O requests

• Decide when to process this I/O request




35
Issues in Disk Scheduling
• Throughput - the number of disk requests
  that are completed in some period

• Fairness - some disk requests may have
  to wait a long time before being served

A totally fair system would ensure that the
  mean response time of the disk requests
  is the same for all processes
36
Goal of Disk Scheduling?

• High Throughput

• Fairness

There is a trade-off between total system
 throughput and fairness.


37
State-Dependent Behavior

The current position of the read/write head
 (i.e., the state of the disk) affects the
 response time of the next request




38
Disk Scheduling Algorithms
For moving-head disk, disk scheduling
 algorithms are needed to minimize seek time
•    FCFS scheduling: first-come-first-served
•    SSTF scheduling: shortest-seek-time-first
•    SCAN scheduling
•    C-SCAN scheduling: circular SCAN
•    LOOK scheduling
•    C-LOOK scheduling

    39
Disk Scheduling Algorithms

• Several algorithms exist to schedule the servicing
  of disk I/O requests.

• Given the following disk request sequence for a
  disk with 100 tracks:

     44, 20, 95, 4, 50, 52, 47, 61, 87, 25
  Head pointer 50 (current position of R/W heads)

40
FCFS Scheduling
• FCFS scheduling service I/O requests in
  the order in which they arrive.

• It is, of course, the simplest scheduling
  algorithm and actually does no scheduling.

• It serves as a useful baseline to compare
  other scheduling algorithms.
41
FCFS Scheduling Example




42
Another Example with FCFS
      Illustration shows total head movement of 640 cylinders.




43
SSTF
• Selects the request with the minimum seek
  time from the current head position.

• SSTF scheduling is a form of SJF
  scheduling; may cause starvation of some
  requests.

• Illustration shows total head movement of
  152 cylinders (or tracks).
44
SSTF Scheduling Example




45
Another Example with SSTF




46
SCAN
• The disk arm starts at one end of the disk, and
  moves toward the other end, servicing requests
  until it gets to the other end of the disk, where the
  head movement is reversed and servicing
  continues.

• Sometimes called the elevator algorithm.

• Illustration shows total head movement of 136
  cylinders.
 47
Example with SCAN Scheduling




48
Another Example with SCAN




49
C-SCAN
• A variant of SCAN

• Provides a more uniform wait time than SCAN.

• The head moves from one end of the disk to the
  other. servicing requests as it goes. When it
  reaches the other end, however, it immediately
  returns to the beginning of the disk, without
  servicing any requests on the return trip.

50
Example with C-SCAN




51
C-LOOK

• Variant of C-SCAN

• Disk arm only travels as far as the last
  request in each direction, then reverses
  direction immediately, without first going
  all the way to the end of the disk.


52

More Related Content

What's hot (17)

Pandi
PandiPandi
Pandi
 
06 External Memory
06  External  Memory06  External  Memory
06 External Memory
 
Io (2)
Io (2)Io (2)
Io (2)
 
Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...
Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...
Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...
 
Ch8
Ch8Ch8
Ch8
 
internal_memory
internal_memoryinternal_memory
internal_memory
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
external_memory
external_memoryexternal_memory
external_memory
 
Os
OsOs
Os
 
Os
OsOs
Os
 
Os7
Os7Os7
Os7
 
09. storage-part-1
09. storage-part-109. storage-part-1
09. storage-part-1
 
Secondary storage devices
Secondary storage devicesSecondary storage devices
Secondary storage devices
 
External memory - Computer Architecture
External memory - Computer ArchitectureExternal memory - Computer Architecture
External memory - Computer Architecture
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 

Viewers also liked

Dbms role advantages
Dbms role advantagesDbms role advantages
Dbms role advantagesjeancly
 
Operating System 5
Operating System 5Operating System 5
Operating System 5tech2click
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management systemPrerana Bhattarai
 
Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 

Viewers also liked (8)

Advantages of DBMS
Advantages of DBMSAdvantages of DBMS
Advantages of DBMS
 
Dbms role advantages
Dbms role advantagesDbms role advantages
Dbms role advantages
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
Files Vs DataBase
Files Vs DataBaseFiles Vs DataBase
Files Vs DataBase
 
Process management in os
Process management in osProcess management in os
Process management in os
 

Similar to Chapter 9 I/O System

Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer ManagementAnshGoyal32
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdfJESUNPK
 
OS@PPT.pdf
OS@PPT.pdfOS@PPT.pdf
OS@PPT.pdfNiru82
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices Slideshare
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.comHemant Gautam
 
Hard Disk Drive
Hard Disk Drive Hard Disk Drive
Hard Disk Drive Rohan Awale
 
Disk scheduling algorithm.52
Disk scheduling algorithm.52Disk scheduling algorithm.52
Disk scheduling algorithm.52myrajendra
 
Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Seshu Chakravarthy
 
Operating System for Undergraduates. level 200 course
Operating System for Undergraduates. level 200 courseOperating System for Undergraduates. level 200 course
Operating System for Undergraduates. level 200 courseReubenMawukoDordunu
 

Similar to Chapter 9 I/O System (20)

Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
 
18CSC205J-UNIT-5.pptx
18CSC205J-UNIT-5.pptx18CSC205J-UNIT-5.pptx
18CSC205J-UNIT-5.pptx
 
Unit 4 DBMS.ppt
Unit 4 DBMS.pptUnit 4 DBMS.ppt
Unit 4 DBMS.ppt
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf
 
OS@PPT.pdf
OS@PPT.pdfOS@PPT.pdf
OS@PPT.pdf
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices
 
Disk memory systems
Disk memory systemsDisk memory systems
Disk memory systems
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.com
 
Hard Disk Drive
Hard Disk Drive Hard Disk Drive
Hard Disk Drive
 
Viknesh
VikneshViknesh
Viknesh
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Disk scheduling algorithm.52
Disk scheduling algorithm.52Disk scheduling algorithm.52
Disk scheduling algorithm.52
 
11-IOManagement.ppt
11-IOManagement.ppt11-IOManagement.ppt
11-IOManagement.ppt
 
11-IOManagement.ppt
11-IOManagement.ppt11-IOManagement.ppt
11-IOManagement.ppt
 
Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02
 
Operating System for Undergraduates. level 200 course
Operating System for Undergraduates. level 200 courseOperating System for Undergraduates. level 200 course
Operating System for Undergraduates. level 200 course
 
Hard disk drives
Hard disk drivesHard disk drives
Hard disk drives
 
Ch12
Ch12Ch12
Ch12
 

Recently uploaded

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 

Recently uploaded (20)

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Chapter 9 I/O System

  • 2. Input/Output System Major objectives: • Take an application I/O request and send it to the physical device. • Take whatever response comes back from the device and send it to the application. • Optimize the performance of the various I/O requests. 2
  • 3. General I/O Issues • The operating system is able to improve overall system performance if it can keep the various devices as busy as possible. • It is important for the operating system to handle device interrupts as quickly as possible. – For interactive devices (keyboard, mouse, microphone), this can make the system more responsive. – For communication devices (modem, Ethernet, etc), this can affect the effective speed of the communications. – For real-time systems, this can be the difference between the system operating correctly and 3 malfunctioning.
  • 5. Disk Structure and Organization • Moving-head disk - one head per surface • Fixed-head disk - one head per track • Data on a disk is addressed by: – Cylinder – Surface – Sector 5
  • 6. Disk Structure • Disk drives are addressed as large 1-dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer. • The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially. – Sector 0 is the first sector of the first track on the outermost cylinder. – Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost. 6
  • 8. Direct Access Storage Devices • Otherwise known as DASDs – Devices that can directly read or write to a specific place on a disk or drum – Also called random access storage devices • Grouped into two major categories – fixed read/write heads – movable read/write heads 8
  • 9. Fixed-Head Drums • Developed in the early 1950s – access times of 5 to 25 ms were considered fast – used a drum with a capacity of 2000 bytes • later increased to 4000 bytes • speed was 200 rpm • much faster than other drums of the time which were only 50-60 rpm • By 1970 drums increased to 1 megabyte and speed of 3000 rpm 9
  • 10. Fixed-Head Drums • Resemble a giant coffee can • Covered with magnetic film • Formatted so tracks run around it • Data recorded serially on each track by the read/write head positioned over it These drums were quite fast, yet expensive and did store as much as other DASDs. 10
  • 11. Fixed-Head Disks • Disks resemble phonograph record albums covered with magnetic film that has been formatted into concentric circles called tracks • Data is recorded in the same manner as fixed-head drum • These were very expensive and had less storage space as compared to movable-head disks but were faster. 11
  • 12. Movable-Head Drums • Consist of a few read/write heads that move from track to track to cover the entire surface of the drum • Device that is least expensive has only one read/write head for the whole drum • Drums with several read/write heads work faster but also cost more 12
  • 13. Movable-Head Disks The read/write head floats over the surface of the disk: • Exist as individual units, as in a PC • Can also be in a disk pack, which is a stack of disks 13
  • 14. Disk Pack A typical disk pack consists of several platters that are stacked on a common central spindle, with a slight space between them so the read/write heads can move between the pairs of disks. 14
  • 15. Architecture of M-Head Disks • Each platter has two surfaces for recording, except the top and bottom • Each surface is formatted with specific numbers of tracks for the data to be recorded on – number of tracks varies depending on the manufacturer – usually range from 200 to 800 tracks 15
  • 16. Optical Storage • Direct access storage • CD-ROMs contained the first optical storage DASDs – these were incompatible with most systems, as they were developed for a single system • Is a major contender for the replacement of magnetic disks because it has high- density storage and durability 16
  • 17. Function of Optical Disc • Optical disc drive functions similar to the magnetic disk drive • Read head is on an arm that moves forward and backward, track to track – disc rotates at 200-500 rpm – average seek time is 500 ms and maximum seek is 1 second – transfer rate is about 150 kilobytes/second 17
  • 18. CD Storage Capacity CD-ROM has large storage potential, more than 700 megabytes of data 18
  • 19. Read/Write • To read or write data, disk device must move the arm to the appropriate track. • The time to carry this out this is called Seek Time. • Then, the disk device must wait for the desired sector/data to rotate into position under the head (rotational latency). • Each track is recorded in units called Sectors. A sector is the smallest amount of data that can be physically read or written. 19
  • 20. Disk Access Time The disk access time can be calculated as follows: Disk Access time = Seek time + Rotational Latency 20
  • 21. I/O Requests • In general, there may be many I/O requests for a device at the same time. • These requests may come from multiple processes or the same process. 21
  • 23. Stages of an I/O Request 23
  • 24. I/O Device Handling • A Queue of Pending Requests • A Resource Scheduler that determines the next request to execute • A Mechanism to initiate the next request whenever a request completes. 24
  • 26. I/O Performance Optimization • I/O processing is much slower than CPU processing. Every physical disk I/O has a dramatic impact on system performance • To improve I/O performance: – Reduce the number of I/O requests – Carry out buffering and/or caching – I/O Scheduling 26
  • 27. Reducing Number of I/O Requests • The most efficient I/O request is one that is never requested 27
  • 28. Buffering and Caching • The I/O system should make the physical I/O requests as big as possible. • This will reduce the number of physical I/O requests by the buffering factor used. • The application's logical I/O requests should copy data to/from a large memory buffer. The physical I/O requests then transfer the entire buffer. 28
  • 30. I/O Scheduling • For most devices, a FCFS (First-Come-First- Serve) scheduling algorithm is appropriate. For example, one wants the segments of a music file to be played in sequential order. • For some devices (disks especially), the order in which requests are processed is not inherently constrained by the device characteristics. 30
  • 31. I/O Scheduling (Cont.) • On a typical system, there will be pending disk I/O requests from many different processes. • The correct functioning of these processes usually does not depend on the order in which the disk I/O operations actually occur. • Thus, we will want the Resource Scheduler to attempt to optimize performance for devices such as disks. 31
  • 32. Context Switching in I/O • In CPU scheduling, the context-switch time is relatively small with respect to the service time • In I/O scheduling the context-switch time is relatively large with respect to the service time The time to move the head between cylinders is much greater than the time it takes to read or write to a cylinder. 32
  • 33. Goal of Disk Scheduling • In any disk system with a moving read/write head, the seek time between cylinders takes a significant amount of time • This traveling head time should be minimized 33
  • 34. An Analogy • Traveling service person, a technician who has to service requests from several clients in a geographical area • Often spends more time driving than actually carrying out service 34
  • 35. Purpose of Disk Scheduling • Select a disk request from the queue of I/O requests • Decide when to process this I/O request 35
  • 36. Issues in Disk Scheduling • Throughput - the number of disk requests that are completed in some period • Fairness - some disk requests may have to wait a long time before being served A totally fair system would ensure that the mean response time of the disk requests is the same for all processes 36
  • 37. Goal of Disk Scheduling? • High Throughput • Fairness There is a trade-off between total system throughput and fairness. 37
  • 38. State-Dependent Behavior The current position of the read/write head (i.e., the state of the disk) affects the response time of the next request 38
  • 39. Disk Scheduling Algorithms For moving-head disk, disk scheduling algorithms are needed to minimize seek time • FCFS scheduling: first-come-first-served • SSTF scheduling: shortest-seek-time-first • SCAN scheduling • C-SCAN scheduling: circular SCAN • LOOK scheduling • C-LOOK scheduling 39
  • 40. Disk Scheduling Algorithms • Several algorithms exist to schedule the servicing of disk I/O requests. • Given the following disk request sequence for a disk with 100 tracks: 44, 20, 95, 4, 50, 52, 47, 61, 87, 25 Head pointer 50 (current position of R/W heads) 40
  • 41. FCFS Scheduling • FCFS scheduling service I/O requests in the order in which they arrive. • It is, of course, the simplest scheduling algorithm and actually does no scheduling. • It serves as a useful baseline to compare other scheduling algorithms. 41
  • 43. Another Example with FCFS Illustration shows total head movement of 640 cylinders. 43
  • 44. SSTF • Selects the request with the minimum seek time from the current head position. • SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests. • Illustration shows total head movement of 152 cylinders (or tracks). 44
  • 47. SCAN • The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. • Sometimes called the elevator algorithm. • Illustration shows total head movement of 136 cylinders. 47
  • 48. Example with SCAN Scheduling 48
  • 50. C-SCAN • A variant of SCAN • Provides a more uniform wait time than SCAN. • The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. 50
  • 52. C-LOOK • Variant of C-SCAN • Disk arm only travels as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk. 52