SlideShare a Scribd company logo
1 of 15
Download to read offline
Part IV I/O Systems
  Chapter 13: I/O Systems
I/O Hardware
a typical PCI bus structure
How do the processor and
   controller communicate?
qUse the controller: a controller usually has a
 few registers (e.g., status, control, data-in and
 data-out).
qUse memory-mapped I/O.
qOr, a combination of both.
Memory-Mapped I/O
I/O address         Device           qEach controller
  000-00F      DMA controller         has a few registers
   020-021   Interrupt controller     that are used for
   040-043          timer             communicating
  200-20F      Game controller        with the CPU.
  2F8-2FF Serial port (secondary)    qIf these registers
  320-32F    Hard-disk controller     are part of the
  378-37F        Parallel port        regular memory
  3D0-3DF    Graphics controller
                                      address space, it is
                                      called memory-
  3F0-3F7   Floppy-disk controller
                                      mapped I/O.
  3F8-3FF   Serial port (primary)
Three Commonly Seen Protocols

 qPooling
 qInterrupts
 qDirect Memory Access (DMA)
Polling
qThe status register has two bits, busy and
 command-ready.

          Processor                            Controller
wait until the busy bit is not set

set the write bit in command

set command-ready bit

                                     if command-ready is set, set busy

                                     do input/output transfer

                                     clear the command-ready and busy
Interrupt
       CPU
                          I/O Controller
     device driver
     initiates I/O


                              initiates I/O
  receives interrupt
calls interrupt handler


                                   done
    processes data           raises interrupt
     and returns



      resumes the
     Interrupt task
Direct Memory Access: 1/2
qFor large volume data transfer, most systems use
 direct memory access to avoid burdening the CPU.
qThe CPU gives the controller (1) disk address, (2)
 memory address for storing the block, and (3) a
 byte count. Then, the CPU goes back to work.
Direct Memory Access: 2/2
qDMA requests data transfer to memory
qThe disk controller copies the information into
 the address provided by the CPU, byte-by-byte,
 until the counter becomes 0, at which time an
 interrupt is generated.
Application I/O Interface
I/O Devices

qCharacter stream: a character stream device
 transfers byte one by one (e.g., modem)
qBlock: a block device transfers a block of bytes
 as a unit (e.g., disk)
qOthers: clocks, memory-mapped screens and so
 on.
qNot all devices may be recognized by an OS.
 Thus, device drivers are needed.
Kernel I/O System

qBuild on top of hardware and device drivers,
 the kernel usually provide many I/O services:
  vI/O scheduling (e.g., disk head scheduling)
  vI/O Buffering (see below)
  vCaching (see below)
  vSpooling
  vError handling
Buffering: 1/2
qA buffer is a memory area that stores data
 while they are transferred between two devices
 or between a device and an application.
qMajor reasons of using buffers
  vEfficiency (see below)
  vCopy semantics. What if there is no buffer
    and a process runs so fast that overwrites its
    previous write? The content on the disk
    becomes incorrect. The use of buffers
    overcomes this problem.
Buffering: 2/2
        No buffer. The user process
        must wait until data transfer
        completes.

         One buffer: While the user
         process is running, next data
         transfer may begin

         Double buffer: while the user
         process is processing the first
         buffer, data transfer can be
         performed on the second.

         Multiple buffers: very efficient

        (figures taken from W. Stallings’ OS text)
Caching
qJust like a cache memory between the faster CPU and
 slower physical memory, a cache (i.e., disk cache) may
 be used between the faster physical memory and
 slower I/O devices.
qNote that buffering and caching are different things.


               controller       physical memory

  I/O device

                                cache
                 cache

More Related Content

What's hot

Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
Tech_MX
 
Unit3 pipelining io organization
Unit3 pipelining  io organizationUnit3 pipelining  io organization
Unit3 pipelining io organization
Swathi Veeradhi
 

What's hot (20)

What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
 
Memory map selection of real time sdram controller using verilog full project...
Memory map selection of real time sdram controller using verilog full project...Memory map selection of real time sdram controller using verilog full project...
Memory map selection of real time sdram controller using verilog full project...
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Direct Memory Access
Direct Memory AccessDirect Memory Access
Direct Memory Access
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
LCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and Updates
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Unit3 pipelining io organization
Unit3 pipelining  io organizationUnit3 pipelining  io organization
Unit3 pipelining io organization
 
03 Buses
03 Buses03 Buses
03 Buses
 
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicUnix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
 
Unit4.tms320c54x
Unit4.tms320c54xUnit4.tms320c54x
Unit4.tms320c54x
 
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicHow to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
 
computer architecture
computer architecture computer architecture
computer architecture
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
DMA and DMA controller
DMA and DMA controllerDMA and DMA controller
DMA and DMA controller
 
DMA presentation [By- Digvijay]
DMA presentation [By- Digvijay]DMA presentation [By- Digvijay]
DMA presentation [By- Digvijay]
 

Similar to Io sys

discuss the drawbacks of programmed and interrupt driven io and des.pdf
discuss the drawbacks of programmed and interrupt driven io and des.pdfdiscuss the drawbacks of programmed and interrupt driven io and des.pdf
discuss the drawbacks of programmed and interrupt driven io and des.pdf
info998421
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input output
risal07
 
Input output concepts in operating systems
Input output concepts in operating systemsInput output concepts in operating systems
Input output concepts in operating systems
isitneededwhy
 

Similar to Io sys (20)

Io systems final
Io systems finalIo systems final
Io systems final
 
Iosystemspre final-160922112930
Iosystemspre final-160922112930Iosystemspre final-160922112930
Iosystemspre final-160922112930
 
Unit 6
Unit 6Unit 6
Unit 6
 
discuss the drawbacks of programmed and interrupt driven io and des.pdf
discuss the drawbacks of programmed and interrupt driven io and des.pdfdiscuss the drawbacks of programmed and interrupt driven io and des.pdf
discuss the drawbacks of programmed and interrupt driven io and des.pdf
 
I/O System
I/O SystemI/O System
I/O System
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdf
 
IO and file systems
IO and file systems IO and file systems
IO and file systems
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
Nvidia tegra K1 Presentation
Nvidia tegra K1 PresentationNvidia tegra K1 Presentation
Nvidia tegra K1 Presentation
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input output
 
Operating System Lecture 2
Operating System Lecture 2Operating System Lecture 2
Operating System Lecture 2
 
Input output concepts in operating systems
Input output concepts in operating systemsInput output concepts in operating systems
Input output concepts in operating systems
 
I/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.SivakumarI/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.Sivakumar
 
IO hardware
IO hardwareIO hardware
IO hardware
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTURE
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk scheduling
 
Operating System Case Study and I/O System
Operating System Case Study and I/O SystemOperating System Case Study and I/O System
Operating System Case Study and I/O System
 
Processor management
Processor managementProcessor management
Processor management
 
IO Management
IO ManagementIO Management
IO Management
 

More from Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
Mohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
Mohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
Mohd Arif
 
Project identification
Project identificationProject identification
Project identification
Mohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
Mohd Arif
 
Presentation
PresentationPresentation
Presentation
Mohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in c
Mohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
Mohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
Mohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
Mohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
Mohd Arif
 
Network management
Network managementNetwork management
Network management
Mohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basics
Mohd Arif
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
Mohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
Mohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
Mohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
Mohd Arif
 

More from Mohd Arif (20)

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Project identification
Project identificationProject identification
Project identification
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
 
Presentation
PresentationPresentation
Presentation
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
 
Network management
Network managementNetwork management
Network management
 
Networing basics
Networing basicsNetworing basics
Networing basics
 
Loaders
LoadersLoaders
Loaders
 
Lists
ListsLists
Lists
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
 
Heap sort
Heap sortHeap sort
Heap sort
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

Io sys

  • 1. Part IV I/O Systems Chapter 13: I/O Systems
  • 2. I/O Hardware a typical PCI bus structure
  • 3. How do the processor and controller communicate? qUse the controller: a controller usually has a few registers (e.g., status, control, data-in and data-out). qUse memory-mapped I/O. qOr, a combination of both.
  • 4. Memory-Mapped I/O I/O address Device qEach controller 000-00F DMA controller has a few registers 020-021 Interrupt controller that are used for 040-043 timer communicating 200-20F Game controller with the CPU. 2F8-2FF Serial port (secondary) qIf these registers 320-32F Hard-disk controller are part of the 378-37F Parallel port regular memory 3D0-3DF Graphics controller address space, it is called memory- 3F0-3F7 Floppy-disk controller mapped I/O. 3F8-3FF Serial port (primary)
  • 5. Three Commonly Seen Protocols qPooling qInterrupts qDirect Memory Access (DMA)
  • 6. Polling qThe status register has two bits, busy and command-ready. Processor Controller wait until the busy bit is not set set the write bit in command set command-ready bit if command-ready is set, set busy do input/output transfer clear the command-ready and busy
  • 7. Interrupt CPU I/O Controller device driver initiates I/O initiates I/O receives interrupt calls interrupt handler done processes data raises interrupt and returns resumes the Interrupt task
  • 8. Direct Memory Access: 1/2 qFor large volume data transfer, most systems use direct memory access to avoid burdening the CPU. qThe CPU gives the controller (1) disk address, (2) memory address for storing the block, and (3) a byte count. Then, the CPU goes back to work.
  • 9. Direct Memory Access: 2/2 qDMA requests data transfer to memory qThe disk controller copies the information into the address provided by the CPU, byte-by-byte, until the counter becomes 0, at which time an interrupt is generated.
  • 11. I/O Devices qCharacter stream: a character stream device transfers byte one by one (e.g., modem) qBlock: a block device transfers a block of bytes as a unit (e.g., disk) qOthers: clocks, memory-mapped screens and so on. qNot all devices may be recognized by an OS. Thus, device drivers are needed.
  • 12. Kernel I/O System qBuild on top of hardware and device drivers, the kernel usually provide many I/O services: vI/O scheduling (e.g., disk head scheduling) vI/O Buffering (see below) vCaching (see below) vSpooling vError handling
  • 13. Buffering: 1/2 qA buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. qMajor reasons of using buffers vEfficiency (see below) vCopy semantics. What if there is no buffer and a process runs so fast that overwrites its previous write? The content on the disk becomes incorrect. The use of buffers overcomes this problem.
  • 14. Buffering: 2/2 No buffer. The user process must wait until data transfer completes. One buffer: While the user process is running, next data transfer may begin Double buffer: while the user process is processing the first buffer, data transfer can be performed on the second. Multiple buffers: very efficient (figures taken from W. Stallings’ OS text)
  • 15. Caching qJust like a cache memory between the faster CPU and slower physical memory, a cache (i.e., disk cache) may be used between the faster physical memory and slower I/O devices. qNote that buffering and caching are different things. controller physical memory I/O device cache cache