SlideShare a Scribd company logo
1 of 22
SARVAJANIK COLLEGE OF ENGINEERING AND TECHNOLOGY
COMPUTER ENGINEERING DEPARTMENT
B. E.-II, CO-E, SEM-IV
(EVEN-2019)
ALA Presentation
on
“INPUT OUTPUT MANAGEMENT”
Subject Name : Operating System (2140702)
Prepared and Presented by (Group No. : 12)
Uttam Thummar (170420107559)
Dhriti Uttamchandani (170420107560)
Keyur Vadodariya (170420107561)
Aditya Vaghela (170420107562)
Sanket Variya (170424107563)
1
 Principle of I/O hardware:
 I/O devices
 Types of I/O device
 Device controllers
 Direct memory access(DMA)
 Direct memory access controller
Content2
 I/O devices are the pieces of hardware used by a human (or
other system) to communicate with a computer. For instance,
a keyboard or computer mouse is an input device for a
computer, while monitors and printers are output devices.
I/O devices3
 I/O device are divided into two categories:
I/O devices(Cont…)
I/O device
Block device
Character
device
4
 A block device is one that stores information in fixed-size
blocks, each one with its own address.
 Common block size range from 512 bytes to 32,768
bytes.
 All transfers are in units of one or more entire blocks.
 Possible to read or write each block independently of ail
the other ones.
 Examples :- hard disks, CD-ROMs, USB etc…
Block device5
 A character device delivers or accepts a stream of
characters, without regard to any block structure.
 It is not addressable and does not have any seek
operation.
 Printers, network interfaces, mice(for pointing), rats(for
psychology lab experiments), and most other devices
that are not disk-like can be seen as character devices.
 Example : serial ports, parallel ports, sounds cards etc…
Character device6
Difference between block and
character devices
7
Block Character
Block Device are hardware devices
which randomly access fixed-sized
chunks of data.
Character devices are accessed as a
stream of sequential data, one byte
after another.
Seeking is possible. Seeking is not allowed.
Reads and write done by buffer cache
mechanism by bread(), bwrite().These
request may be asynchronous
The read() and write() calls do not
return until the operation is complete.
More complex than character driver. Less complex than block driver.
The kernel does have to provide an
entire subsystem to block device.
The kernel doesn’t have to provide an
entire subsystem to the character
device.
Eg: Hard disk, Pen drive Eg: Keyboard device, serial port.
 I/O units typically consist of a mechanical component and
an electronic component.
 The Device Controller works like an interface between a
device and a device driver. I/O units (Keyboard, mouse,
printer, etc.) typically consist of a mechanical component
and an electronic component where electronic component
is called the device controller.
Device controller8
Device controller(Cont…)
 Any device connected to the computer is connected by a
plug and socket, and the socket is connected to a device
controller.
 Following is a model for connecting the CPU, memory,
controllers, and I/O devices where CPU and device
controllers all use a common bus for communication.
9
Device controller(Cont…)
 Graphically representation of device controller
10
 Slow devices like keyboards will generate an interrupt to
the main CPU after each byte is transferred. If a fast
device such as a disk generated an interrupt for each
byte, the operating system would spend most of its time
handling these interrupts.
 So a typical computer uses direct memory access
(DMA) hardware to reduce this overhead.
Direct memory access11
 Direct Memory Access (DMA) means CPU grants I/O
module authority to read from or write to memory without
involvement.
 DMA module itself controls exchange of data between
main memory and the I/O device.
 CPU is only involved at the beginning and end of the
transfer and interrupted only after entire block has been
transferred.
Direct memory access(Cont…)12
Direct memory access controller
 Direct Memory Access needs a special hardware called
DMA controller (DMAC) that manages the data
transfers and arbitrates access to the system bus. The
controllers are programmed with source and destination
pointers (where to read/write the data), counters to track
the number of transferred bytes, and settings, which
includes I/O and memory types, interrupts and states for
the CPU cycles.
13
Configurations of DMA
 Two Configuration For DMA Transfer:-
1. Single Bus
2. I/O Bus
14
Direct memory access controller (Single Bus)15
Direct memory access controller (I/O Bus)16
1. Device driver is told to
transfer disk data to
buffer at address X.
2. Device driver tells Disk
Controller to transfer C
bytes from disk to buffer
at address X.
3. Disk Controller Initiates
DMA Transfer
4. Disk Controller sends
each byte to DMA
controller.
5. DMA controller transfers
bytes to buffer, increases
the memory address,
decreases the counter C
until C becomes zero.
6. When C becomes zero,
DMA interrupts CPU to
signal transfer completion.
DMA Modes Of Operations
1. Word-at-a-Time Mode
 In this mode, the DMA controller requests the transfer of one word
and gets it.
 If the CPU also wants the bus, it has to wait.
 The mechanism is also called “cycle stealing” because the device
controller sneaks in and steals an occasional bus cycle from the CPU
once in a while, delaying it slightly.
17
DMA Modes Of Operations
2. Block Transfer Mode
 In block transfer mode the DMA is programmed to transfer a block
and does not pause or halt until the whole block is transferred
irrespective of the requests received meanwhile.
 The DMA retains control of the memory bus for the duration of the
memory transfer.
 The negative aspect of operating in this mode is that the CPU will
not be able to access the memory bus until the DMA controller
completes the memory transfer.
18
DMA Modes Of Operations
3. Transparent Mode
 In transparent mode, the DMA controller transfers data only when
the CPU is performing operations that do not use the system buses.
 The primary advantage of transparent mode is that the CPU never
stops executing its programs and the DMA transfer is free in terms
of time, while the disadvantage is that the hardware needs to
determine when the CPU is not using the system buses, which can
be complex.
19
Advantages & Disadvantages Of DMA
Advantages :-
 DMA allows a peripheral device to read from/write to memory without
going through the CPU.
 DMA allows for faster processing since the processor can be working
on something else while the peripheral can be populating memory.
Disadvantages :-
 requires a DMA controller to carry out the operation, which increases
the cost of the system.
 Cache Coherency.
20
 Modern Operating Systems (Third Edition) by Andrew S
Tanenbaum, Prentice Hall India (2008).
 Operating System Concepts (8th Edition)by Silberschatz,
Peter B. Galvin and Greg Gagne, Wiley-Indian Edition
(2010).
 www.slideshare.net
References21
Thank You…22

More Related Content

What's hot

What's hot (20)

Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating system
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Data link layer
Data link layer Data link layer
Data link layer
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory management
Memory managementMemory management
Memory management
 
Memory organization in computer architecture
Memory organization in computer architectureMemory organization in computer architecture
Memory organization in computer architecture
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Interrupts ppt
Interrupts pptInterrupts ppt
Interrupts ppt
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Buses in a computer
Buses in a computerBuses in a computer
Buses in a computer
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output Organization
 
Complete Operating System notes
Complete Operating System notesComplete Operating System notes
Complete Operating System notes
 
Ethernet
EthernetEthernet
Ethernet
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Computer registers
Computer registersComputer registers
Computer registers
 

Similar to I/O Management

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.pdfinfo998421
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREHariharan Anand
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input outputrisal07
 
Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. pratikkadam78
 
Chapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of informationChapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of informationFrankie Jones
 
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 Systemprakash ganesan
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization faria_khan
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer ArchitectureMaruf Abdullah (Rion)
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxhasanbashar400
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer OrganizationOm Prakash
 
Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecturevikram patel
 
input output ports
input output portsinput output ports
input output portsaslamslides
 

Similar to I/O Management (20)

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
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTURE
 
Chapter 6 input output
Chapter 6 input outputChapter 6 input output
Chapter 6 input output
 
Unit 6
Unit 6Unit 6
Unit 6
 
Chapter 1.pdf
Chapter 1.pdfChapter 1.pdf
Chapter 1.pdf
 
HARDWARE
HARDWAREHARDWARE
HARDWARE
 
Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture. Modes of data transfer.computer architecture.
Modes of data transfer.computer architecture.
 
Chapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of informationChapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of information
 
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
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization
 
ch -6 IO.pptx
ch -6 IO.pptxch -6 IO.pptx
ch -6 IO.pptx
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer Architecture
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptx
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
IO Techniques in Computer Organization
IO Techniques in Computer OrganizationIO Techniques in Computer Organization
IO Techniques in Computer Organization
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecture
 
IO_ORGANIZATION.pdf
IO_ORGANIZATION.pdfIO_ORGANIZATION.pdf
IO_ORGANIZATION.pdf
 
Modes of data transfer
Modes of data transferModes of data transfer
Modes of data transfer
 
input output ports
input output portsinput output ports
input output ports
 

More from Keyur Vadodariya

Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingKeyur Vadodariya
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and DestructorsKeyur Vadodariya
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And SubtractionKeyur Vadodariya
 
Laser And It's Application
Laser And It's ApplicationLaser And It's Application
Laser And It's ApplicationKeyur Vadodariya
 

More from Keyur Vadodariya (7)

Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And Subtraction
 
Ocean Acidification
Ocean AcidificationOcean Acidification
Ocean Acidification
 
Polar Curves
Polar CurvesPolar Curves
Polar Curves
 
Laser And It's Application
Laser And It's ApplicationLaser And It's Application
Laser And It's Application
 
Air Compressors
Air CompressorsAir Compressors
Air Compressors
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
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
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
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 🔝✔️✔️
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
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
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.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"
 
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
 
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🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 

I/O Management

  • 1. SARVAJANIK COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ENGINEERING DEPARTMENT B. E.-II, CO-E, SEM-IV (EVEN-2019) ALA Presentation on “INPUT OUTPUT MANAGEMENT” Subject Name : Operating System (2140702) Prepared and Presented by (Group No. : 12) Uttam Thummar (170420107559) Dhriti Uttamchandani (170420107560) Keyur Vadodariya (170420107561) Aditya Vaghela (170420107562) Sanket Variya (170424107563) 1
  • 2.  Principle of I/O hardware:  I/O devices  Types of I/O device  Device controllers  Direct memory access(DMA)  Direct memory access controller Content2
  • 3.  I/O devices are the pieces of hardware used by a human (or other system) to communicate with a computer. For instance, a keyboard or computer mouse is an input device for a computer, while monitors and printers are output devices. I/O devices3
  • 4.  I/O device are divided into two categories: I/O devices(Cont…) I/O device Block device Character device 4
  • 5.  A block device is one that stores information in fixed-size blocks, each one with its own address.  Common block size range from 512 bytes to 32,768 bytes.  All transfers are in units of one or more entire blocks.  Possible to read or write each block independently of ail the other ones.  Examples :- hard disks, CD-ROMs, USB etc… Block device5
  • 6.  A character device delivers or accepts a stream of characters, without regard to any block structure.  It is not addressable and does not have any seek operation.  Printers, network interfaces, mice(for pointing), rats(for psychology lab experiments), and most other devices that are not disk-like can be seen as character devices.  Example : serial ports, parallel ports, sounds cards etc… Character device6
  • 7. Difference between block and character devices 7 Block Character Block Device are hardware devices which randomly access fixed-sized chunks of data. Character devices are accessed as a stream of sequential data, one byte after another. Seeking is possible. Seeking is not allowed. Reads and write done by buffer cache mechanism by bread(), bwrite().These request may be asynchronous The read() and write() calls do not return until the operation is complete. More complex than character driver. Less complex than block driver. The kernel does have to provide an entire subsystem to block device. The kernel doesn’t have to provide an entire subsystem to the character device. Eg: Hard disk, Pen drive Eg: Keyboard device, serial port.
  • 8.  I/O units typically consist of a mechanical component and an electronic component.  The Device Controller works like an interface between a device and a device driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a mechanical component and an electronic component where electronic component is called the device controller. Device controller8
  • 9. Device controller(Cont…)  Any device connected to the computer is connected by a plug and socket, and the socket is connected to a device controller.  Following is a model for connecting the CPU, memory, controllers, and I/O devices where CPU and device controllers all use a common bus for communication. 9
  • 10. Device controller(Cont…)  Graphically representation of device controller 10
  • 11.  Slow devices like keyboards will generate an interrupt to the main CPU after each byte is transferred. If a fast device such as a disk generated an interrupt for each byte, the operating system would spend most of its time handling these interrupts.  So a typical computer uses direct memory access (DMA) hardware to reduce this overhead. Direct memory access11
  • 12.  Direct Memory Access (DMA) means CPU grants I/O module authority to read from or write to memory without involvement.  DMA module itself controls exchange of data between main memory and the I/O device.  CPU is only involved at the beginning and end of the transfer and interrupted only after entire block has been transferred. Direct memory access(Cont…)12
  • 13. Direct memory access controller  Direct Memory Access needs a special hardware called DMA controller (DMAC) that manages the data transfers and arbitrates access to the system bus. The controllers are programmed with source and destination pointers (where to read/write the data), counters to track the number of transferred bytes, and settings, which includes I/O and memory types, interrupts and states for the CPU cycles. 13
  • 14. Configurations of DMA  Two Configuration For DMA Transfer:- 1. Single Bus 2. I/O Bus 14
  • 15. Direct memory access controller (Single Bus)15
  • 16. Direct memory access controller (I/O Bus)16 1. Device driver is told to transfer disk data to buffer at address X. 2. Device driver tells Disk Controller to transfer C bytes from disk to buffer at address X. 3. Disk Controller Initiates DMA Transfer 4. Disk Controller sends each byte to DMA controller. 5. DMA controller transfers bytes to buffer, increases the memory address, decreases the counter C until C becomes zero. 6. When C becomes zero, DMA interrupts CPU to signal transfer completion.
  • 17. DMA Modes Of Operations 1. Word-at-a-Time Mode  In this mode, the DMA controller requests the transfer of one word and gets it.  If the CPU also wants the bus, it has to wait.  The mechanism is also called “cycle stealing” because the device controller sneaks in and steals an occasional bus cycle from the CPU once in a while, delaying it slightly. 17
  • 18. DMA Modes Of Operations 2. Block Transfer Mode  In block transfer mode the DMA is programmed to transfer a block and does not pause or halt until the whole block is transferred irrespective of the requests received meanwhile.  The DMA retains control of the memory bus for the duration of the memory transfer.  The negative aspect of operating in this mode is that the CPU will not be able to access the memory bus until the DMA controller completes the memory transfer. 18
  • 19. DMA Modes Of Operations 3. Transparent Mode  In transparent mode, the DMA controller transfers data only when the CPU is performing operations that do not use the system buses.  The primary advantage of transparent mode is that the CPU never stops executing its programs and the DMA transfer is free in terms of time, while the disadvantage is that the hardware needs to determine when the CPU is not using the system buses, which can be complex. 19
  • 20. Advantages & Disadvantages Of DMA Advantages :-  DMA allows a peripheral device to read from/write to memory without going through the CPU.  DMA allows for faster processing since the processor can be working on something else while the peripheral can be populating memory. Disadvantages :-  requires a DMA controller to carry out the operation, which increases the cost of the system.  Cache Coherency. 20
  • 21.  Modern Operating Systems (Third Edition) by Andrew S Tanenbaum, Prentice Hall India (2008).  Operating System Concepts (8th Edition)by Silberschatz, Peter B. Galvin and Greg Gagne, Wiley-Indian Edition (2010).  www.slideshare.net References21