SlideShare a Scribd company logo
1 of 26
IO hardware
Prepared By: Mr. Sangram A. Patil
Assistant Professor PVPIT,Budhgaon
overview
 Management of I/O devices is a very important part of the operating system - so
important and so varied that entire I/O subsystems are devoted to its operation.
 I/O Subsystems must contend with two ( conflicting? ) trends:
(1) The gravitation towards standard interfaces for a wide range of devices,
making it easier to add newly developed devices to existing systems, and
(2) the development of entirely new types of devices, for which the existing
standard interfaces are not always easy to apply.
 Device drivers are modules that can be plugged into an OS to handle a particular
device or category of similar devices.
IO Hardware
 Computer operate a great many kinds of devices
 I/O devices can be roughly categorized as storage (Disks and tapes), communications
or transmission devices (network cards, modems ), user-interface (screen, keyboard,
mouse), and other
 Devices communicate with the computer via signals sent over wires or through the air.
 Devices connect with the computer via ports, e.g. a serial or parallel port.
 A common set of wires connecting multiple devices is termed a bus
1. The PCI bus connects high-speed high-bandwidth devices to the memory subsystem
( and the CPU. )
2. The expansion bus connects slower low-bandwidth devices, which typically deliver data
one character at a time ( with buffering. )
3. The SCSI bus connects a number of SCSI devices to a common SCSI controller.
4. A daisy-chain bus, ( not shown) is when a string of devices is connected to each other
like beads on a chain, and only one of the devices is directly connected to the host.
Controllers
 Controllers is collection of electronics that can operate a port, a bus or devices.
 Serial port controller is simple device controller, it is a single chip that controls
signal on the wires of serial port.
 SCSI bus controllers are not simple. SCSI protocol is complex.
Communicating with devices
 One way of communicating with devices is through registers associated with each
port. Registers may be one to four bytes in size, and may typically include ( a
subset of ) the following four:The data-in register is read by the host to get input
from the device.
 The data-out register is written by the host to send output.
 The status register has bits read by the host to ascertain the status of the device,
such as idle, ready for input, busy, error, transaction complete, etc.
 The control register has bits written by the host to issue commands or to change
settings of the device such as parity checking, word length, or full- versus half-
duplex operation.
Communicating with devices
 Another technique for communicating with devices is memory-mapped I/O.
 In this case a certain portion of the processor's address space is mapped to the
device, and communications occur by reading and writing directly to/from those
memory areas.
 Memory-mapped I/O is suitable for devices which must move large quantities of
data quickly, such as graphics cards.
 Memory-mapped I/O can be used either instead of or more often in combination
with traditional registers. For example, graphics cards still use registers for control
information such as setting the video mode.
 A potential problem exists with memory-mapped I/O, if a process is allowed to
write directly to the address space used by a memory-mapped I/O device.
Polling
 One simple means of device handshaking involves polling:
 The host repeatedly checks the busy bit on the device until it becomes clear.
 The host writes a byte of data into the data-out register, and sets the write bit in the
command register ( in either order. )
 The host sets the command ready bit in the command register to notify the device of the
pending command.
 When the device controller sees the command-ready bit set, it first sets the busy bit.
 Then the device controller reads the command register, sees the write bit set, reads the byte of
data from the data-out register, and outputs the byte of data.
 The device controller then clears the error bit in the status register, the command-ready bit,
and finally clears the busy bit, signaling the completion of the operation.
 Polling can be very fast and efficient, if both the device and the controller are fast and if
there is significant data to transfer. It becomes inefficient, however, if the host must wait
a long time in the busy loop waiting for the device, or if frequent checks need to be
made for data that is infrequently there.
Interrupts
 Interrupts allow devices to notify the CPU when they have data to transfer or when
an operation is complete, allowing the CPU to perform other duties when no I/O
transfers need its immediate attention.
 The CPU has an interrupt-request line that is sensed after every instruction.
 A device's controller raises an interrupt by asserting a signal on the interrupt request
line.
 The CPU then performs a state save, and transfers control to the interrupt
handler routine at a fixed address in memory. ( The CPU catches the interrupt
and dispatches the interrupt handler. )
 The interrupt handler determines the cause of the interrupt, performs the necessary
processing, performs a state restore, and executes a return from interrupt instruction to
return control to the CPU. ( The interrupt handler clears the interrupt by servicing the
device. )
 The above description is adequate for simple interrupt-driven I/O, but there are
three needs in modern computing which complicate the picture:
1. The need to defer interrupt handling during critical processing,
2. The need to determine which interrupt handler to invoke, without having to poll all
devices to see which one needs attention, and
3. The need for multi-level interrupts, so the system can differentiate between high-
and low-priority interrupts for proper response.
 These issues are handled in modern computer architectures with interrupt-
controller hardware.
 Most CPUs now have two interrupt-request lines: One that is non-maskable for critical
error conditions and one that is maskable, that the CPU can temporarily ignore during
critical processing.
 The interrupt mechanism accepts an address, which is usually one of a small set of
numbers for an offset into a table called the interrupt vector. This table ( usually located
at physical address zero ? ) holds the addresses of routines prepared to process specific
interrupts.
 The number of possible interrupt handlers still exceeds the range of defined interrupt
numbers, so multiple handlers can be interrupt chained. Effectively the addresses held
in the interrupt vectors are the head pointers for linked-lists of interrupt handlers.
 Figure shows the Intel Pentium interrupt vector. Interrupts 0 to 31 are non-maskable and
reserved for serious hardware and other errors. Maskable interrupts, including normal
device I/O interrupts begin at interrupt 32.
 Modern interrupt hardware also supports interrupt priority levels, allowing systems to
mask off only lower-priority interrupts while servicing a high-priority interrupt, or
conversely to allow a high-priority signal to interrupt the processing of a low-priority
one.
 At boot time the system determines which devices are present, and loads the
appropriate handler addresses into the interrupt table.
 During operation, devices signal errors or the completion of commands via
interrupts.
 Exceptions, such as dividing by zero, invalid memory accesses, or attempts to
access kernel mode instructions can be signaled via interrupts.
 Time slicing and context switches can also be implemented using the interrupt
mechanism.
 The scheduler sets a hardware timer before transferring control over to a user process.
 When the timer raises the interrupt request line, the CPU performs a state-save, and
transfers control over to the proper interrupt handler, which in turn runs the scheduler.
 The scheduler does a state-restore of a different process before resetting the timer and
issuing the return-from-interrupt instruction.
 System calls are implemented via software interrupts, a.k.a. traps. When a
( library ) program needs work performed in kernel mode, it sets command
information and possibly data addresses in certain registers, and then raises a
software interrupt. ( E.g. 21 hex in DOS. ) The system does a state save and then
calls on the proper interrupt handler to process the request in kernel mode.
Software interrupts generally have low priority, as they are not as urgent as devices
with limited buffering space.
 A similar example involves the paging system for virtual memory - A page fault
causes an interrupt, which in turn issues an I/O request and a context switch as
described above, moving the interrupted process into the wait queue and selecting
a different process to run. When the I/O request has completed ( i.e. when the
requested page has been loaded up into physical memory ), then the device
interrupts, and the interrupt handler moves the process from the wait queue into
the ready queue, ( or depending on scheduling algorithms and policies, may go
ahead and context switch it back onto the CPU. )
 Interrupts are also used to control kernel operations, and to schedule activities for
optimal performance. For example, the completion of a disk read operation
involves two interrupts:
 A high-priority interrupt acknowledges the device completion, and issues the next disk
request so that the hardware does not sit idle.
 A lower-priority interrupt transfers the data from the kernel memory space to the user
space, and then transfers the process from the waiting queue to the ready queue.
Direct Memory Access
 For devices that transfer large quantities of data ( such as disk controllers ), it is
wasteful to tie up the CPU transferring data in and out of registers one byte at a
time.
 Instead this work can be off-loaded to a special processor, known as the Direct
Memory Access, DMA, Controller.
 The host issues a command to the DMA controller, indicating the location where
the data is located, the location where the data is to be transferred to, and the
number of bytes of data to transfer. The DMA controller handles the data transfer,
and then interrupts the CPU when the transfer is complete.
 A simple DMA controller is a standard component in modern PCs, and many bus-
mastering I/O cards contain their own DMA hardware.
 Handshaking between DMA controllers and their devices is accomplished through
two wires called the DMA-request and DMA-acknowledge wires.
Direct Memory Access
 While the DMA transfer is going on the CPU does not have access to the PCI bus (
including main memory ), but it does have access to its internal registers and
primary and secondary caches.
 DMA can be done in terms of either physical addresses or virtual addresses that are
mapped to physical addresses. The latter approach is known as Direct Virtual
Memory Access, DVMA, and allows direct data transfer from one memory-
mapped device to another without using the main memory chips.
 Direct DMA access by user processes can speed up operations, but is generally
forbidden by modern systems for security and protection reasons. ( I.e. DMA is a
kernel-mode operation. )
Device Drivers
 Device Drivers are the software through which, the kernel of a computer
communicates with different hardware, without having to go into the details of
how the hardware works.
 It is a software that controls a hardware part attached to a computer and allows the
computer to use the hardware by providing a suitable interface.
 This means that the operating system need not go into the details about how the
hardware part works.
 It also provides a common interface so that the operating system or the Kernel can
communicate with the hardware.
 Thus, the purpose of device drivers is to allow smooth functioning of the hardware
for which it is created and to allow it to be used with different operating systems.
Device Driver Types
 There are device drivers for almost every device associated with a computer – from
BIOS to even virtual machines and more. Device drivers can be broadly be classified
into two categories:
 Kernel Device Drivers
 User Device Drivers
Kernel Device Drivers
 Kernel Device Drivers are the generic device drivers that load with the operating
system into the memory as part of the operating system; not the entire driver but a
pointer to that effect so that the device driver can be invoked as soon as it is
required.
 The drivers are pertaining to BIOS, motherboard, processor, and similar hardware
form part of Kernel Software.
 A problem with Kernel Device Drivers is that when one of them is invoked, it is
loaded into the RAM and cannot be moved to page file (virtual memory).
 Thus, a number of device drivers running at the same time can slow down machines.
That is why there is a minimum system requirement for each operating system. The
different operating systems already add up the resources needed for kernel device
drivers, so that end users need not worry about extra memory requirements.
User Device Drivers
 User Mode Device Drivers are the ones usually triggered by users during their
session on a computer.
 It might be thought of devices that the user brought to the computer other than
the kernel devices. Drivers for most of the Plug and Play devices fall into this
category.
 User Device Drivers can be written to disk so that they don’t act tough on the
resources. However, for the drivers related to gaming devices, it is recommended
to keep them in main memory (RAM).
Block Drivers and Character Drivers
 These two – the block and character device drivers – belong to the category of data
reading and writing. Hard disks, CD ROMs, USB Drives, etc. – might be either Block
Drivers or Character Drivers based on how they are used.
 Character Drivers are used in serial buses. They write data one character at a time. One
character means a byte in a generic sense. If a device is connected to a serial port, it is
using a character driver. A mouse is a serial device and has a character device driver.
 Block drivers refer to writing and reading of more than one character at a time. Usually,
block device drivers create a block and retrieve as much information as the block can
contain. Hard disks, for example, use block device drivers. CD ROMs too, are block device
drivers, but the kernel needs to check that the device is still connected to the computer,
each time the CD ROM is invoked by any application.

More Related Content

What's hot

CS4109 Computer System Architecture
CS4109 Computer System ArchitectureCS4109 Computer System Architecture
CS4109 Computer System Architecturektosri
 
Intro to Buses (Computer Architecture)
Intro to Buses  (Computer Architecture)Intro to Buses  (Computer Architecture)
Intro to Buses (Computer Architecture)Matthew Levandowski
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded SystemsSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded SystemsArti Parab Academics
 
Control unit design
Control unit designControl unit design
Control unit designDhaval Bagal
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9myrajendra
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design processRAMESHBABU311293
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptxAshokRachapalli1
 
Multiprocessor Architecture (Advanced computer architecture)
Multiprocessor Architecture  (Advanced computer architecture)Multiprocessor Architecture  (Advanced computer architecture)
Multiprocessor Architecture (Advanced computer architecture)vani261
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharingmyrajendra
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organizationchidabdu
 
Auxiliary memory
Auxiliary memoryAuxiliary memory
Auxiliary memoryYuvrajVyas2
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systemsRAMPRAKASHT1
 

What's hot (20)

CS4109 Computer System Architecture
CS4109 Computer System ArchitectureCS4109 Computer System Architecture
CS4109 Computer System Architecture
 
Intro to Buses (Computer Architecture)
Intro to Buses  (Computer Architecture)Intro to Buses  (Computer Architecture)
Intro to Buses (Computer Architecture)
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded SystemsSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Introduction to Embedded Systems
 
operating system structure
operating system structureoperating system structure
operating system structure
 
i/o interface
i/o interfacei/o interface
i/o interface
 
Control unit design
Control unit designControl unit design
Control unit design
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Interrupts
InterruptsInterrupts
Interrupts
 
Memory management
Memory managementMemory management
Memory management
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design process
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
 
Multiprocessor Architecture (Advanced computer architecture)
Multiprocessor Architecture  (Advanced computer architecture)Multiprocessor Architecture  (Advanced computer architecture)
Multiprocessor Architecture (Advanced computer architecture)
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharing
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organization
 
Auxiliary memory
Auxiliary memoryAuxiliary memory
Auxiliary memory
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 

Similar to Guide to IO Hardware and Communication

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.pptxLeahRachael
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4Dr.MAYA NAYAK
 
Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Swathi Veeradhi
 
Iosystemspre final-160922112930
Iosystemspre final-160922112930Iosystemspre final-160922112930
Iosystemspre final-160922112930marangburu42
 
Computer organization
Computer organizationComputer organization
Computer organizationRvishnupriya2
 
Computer organization
Computer organization Computer organization
Computer organization vishnu973656
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfaptinstallpython3
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxRuhul Amin
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfTaufeeq8
 
I/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.SivakumarI/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.SivakumarSivakumar R D .
 
Ch2 OS
Ch2 OSCh2 OS
Ch2 OSC.U
 
Operating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studyOperating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studymuhammadalam77863
 

Similar to Guide to IO Hardware and Communication (20)

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
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
 
Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003
 
unit-5 ppt.ppt
unit-5 ppt.pptunit-5 ppt.ppt
unit-5 ppt.ppt
 
Io systems final
Io systems finalIo systems final
Io systems final
 
Iosystemspre final-160922112930
Iosystemspre final-160922112930Iosystemspre final-160922112930
Iosystemspre final-160922112930
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Computer organization
Computer organization Computer organization
Computer organization
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdf
 
COA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptxCOA-Unit5-ppt2.pptx
COA-Unit5-ppt2.pptx
 
Io pro
Io proIo pro
Io pro
 
Ca 2 note mano
Ca 2 note manoCa 2 note mano
Ca 2 note mano
 
Ch2
Ch2Ch2
Ch2
 
IO organization.ppt
IO organization.pptIO organization.ppt
IO organization.ppt
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdf
 
I/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.SivakumarI/O Hardware-R.D.Sivakumar
I/O Hardware-R.D.Sivakumar
 
OSCh2
OSCh2OSCh2
OSCh2
 
Ch2 OS
Ch2 OSCh2 OS
Ch2 OS
 
OS_Ch2
OS_Ch2OS_Ch2
OS_Ch2
 
Operating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to studyOperating system- Chapter 1.pptx to study
Operating system- Chapter 1.pptx to study
 

More from sangrampatil81

Directory implementation and allocation methods
Directory implementation and allocation methodsDirectory implementation and allocation methods
Directory implementation and allocation methodssangrampatil81
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlocksangrampatil81
 
Classical problems of process synchronization
Classical problems of process synchronizationClassical problems of process synchronization
Classical problems of process synchronizationsangrampatil81
 
Services and system calls
Services and system callsServices and system calls
Services and system callssangrampatil81
 
Operating system structure
Operating system structureOperating system structure
Operating system structuresangrampatil81
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementationsangrampatil81
 
Pointer to array and structure
Pointer to array and structurePointer to array and structure
Pointer to array and structuresangrampatil81
 
Pointer arithmetic in c
Pointer arithmetic in c Pointer arithmetic in c
Pointer arithmetic in c sangrampatil81
 

More from sangrampatil81 (20)

Deadlock
DeadlockDeadlock
Deadlock
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
File system structure
File system structureFile system structure
File system structure
 
File management
File managementFile management
File management
 
Disk structure
Disk structureDisk structure
Disk structure
 
Directory structure
Directory structureDirectory structure
Directory structure
 
Directory implementation and allocation methods
Directory implementation and allocation methodsDirectory implementation and allocation methods
Directory implementation and allocation methods
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Monitors
MonitorsMonitors
Monitors
 
Classical problems of process synchronization
Classical problems of process synchronizationClassical problems of process synchronization
Classical problems of process synchronization
 
System programs
System programsSystem programs
System programs
 
System programs
System programsSystem programs
System programs
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
Operating system structure
Operating system structureOperating system structure
Operating system structure
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementation
 
Pointer to array and structure
Pointer to array and structurePointer to array and structure
Pointer to array and structure
 
Pointer arithmetic in c
Pointer arithmetic in c Pointer arithmetic in c
Pointer arithmetic in c
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Guide to IO Hardware and Communication

  • 1. IO hardware Prepared By: Mr. Sangram A. Patil Assistant Professor PVPIT,Budhgaon
  • 2. overview  Management of I/O devices is a very important part of the operating system - so important and so varied that entire I/O subsystems are devoted to its operation.  I/O Subsystems must contend with two ( conflicting? ) trends: (1) The gravitation towards standard interfaces for a wide range of devices, making it easier to add newly developed devices to existing systems, and (2) the development of entirely new types of devices, for which the existing standard interfaces are not always easy to apply.  Device drivers are modules that can be plugged into an OS to handle a particular device or category of similar devices.
  • 3. IO Hardware  Computer operate a great many kinds of devices  I/O devices can be roughly categorized as storage (Disks and tapes), communications or transmission devices (network cards, modems ), user-interface (screen, keyboard, mouse), and other  Devices communicate with the computer via signals sent over wires or through the air.  Devices connect with the computer via ports, e.g. a serial or parallel port.  A common set of wires connecting multiple devices is termed a bus 1. The PCI bus connects high-speed high-bandwidth devices to the memory subsystem ( and the CPU. ) 2. The expansion bus connects slower low-bandwidth devices, which typically deliver data one character at a time ( with buffering. ) 3. The SCSI bus connects a number of SCSI devices to a common SCSI controller. 4. A daisy-chain bus, ( not shown) is when a string of devices is connected to each other like beads on a chain, and only one of the devices is directly connected to the host.
  • 4.
  • 5. Controllers  Controllers is collection of electronics that can operate a port, a bus or devices.  Serial port controller is simple device controller, it is a single chip that controls signal on the wires of serial port.  SCSI bus controllers are not simple. SCSI protocol is complex.
  • 6. Communicating with devices  One way of communicating with devices is through registers associated with each port. Registers may be one to four bytes in size, and may typically include ( a subset of ) the following four:The data-in register is read by the host to get input from the device.  The data-out register is written by the host to send output.  The status register has bits read by the host to ascertain the status of the device, such as idle, ready for input, busy, error, transaction complete, etc.  The control register has bits written by the host to issue commands or to change settings of the device such as parity checking, word length, or full- versus half- duplex operation.
  • 7.
  • 8. Communicating with devices  Another technique for communicating with devices is memory-mapped I/O.  In this case a certain portion of the processor's address space is mapped to the device, and communications occur by reading and writing directly to/from those memory areas.  Memory-mapped I/O is suitable for devices which must move large quantities of data quickly, such as graphics cards.  Memory-mapped I/O can be used either instead of or more often in combination with traditional registers. For example, graphics cards still use registers for control information such as setting the video mode.  A potential problem exists with memory-mapped I/O, if a process is allowed to write directly to the address space used by a memory-mapped I/O device.
  • 9. Polling  One simple means of device handshaking involves polling:  The host repeatedly checks the busy bit on the device until it becomes clear.  The host writes a byte of data into the data-out register, and sets the write bit in the command register ( in either order. )  The host sets the command ready bit in the command register to notify the device of the pending command.  When the device controller sees the command-ready bit set, it first sets the busy bit.  Then the device controller reads the command register, sees the write bit set, reads the byte of data from the data-out register, and outputs the byte of data.  The device controller then clears the error bit in the status register, the command-ready bit, and finally clears the busy bit, signaling the completion of the operation.  Polling can be very fast and efficient, if both the device and the controller are fast and if there is significant data to transfer. It becomes inefficient, however, if the host must wait a long time in the busy loop waiting for the device, or if frequent checks need to be made for data that is infrequently there.
  • 10. Interrupts  Interrupts allow devices to notify the CPU when they have data to transfer or when an operation is complete, allowing the CPU to perform other duties when no I/O transfers need its immediate attention.  The CPU has an interrupt-request line that is sensed after every instruction.  A device's controller raises an interrupt by asserting a signal on the interrupt request line.  The CPU then performs a state save, and transfers control to the interrupt handler routine at a fixed address in memory. ( The CPU catches the interrupt and dispatches the interrupt handler. )  The interrupt handler determines the cause of the interrupt, performs the necessary processing, performs a state restore, and executes a return from interrupt instruction to return control to the CPU. ( The interrupt handler clears the interrupt by servicing the device. )
  • 11.
  • 12.  The above description is adequate for simple interrupt-driven I/O, but there are three needs in modern computing which complicate the picture: 1. The need to defer interrupt handling during critical processing, 2. The need to determine which interrupt handler to invoke, without having to poll all devices to see which one needs attention, and 3. The need for multi-level interrupts, so the system can differentiate between high- and low-priority interrupts for proper response.
  • 13.  These issues are handled in modern computer architectures with interrupt- controller hardware.  Most CPUs now have two interrupt-request lines: One that is non-maskable for critical error conditions and one that is maskable, that the CPU can temporarily ignore during critical processing.  The interrupt mechanism accepts an address, which is usually one of a small set of numbers for an offset into a table called the interrupt vector. This table ( usually located at physical address zero ? ) holds the addresses of routines prepared to process specific interrupts.  The number of possible interrupt handlers still exceeds the range of defined interrupt numbers, so multiple handlers can be interrupt chained. Effectively the addresses held in the interrupt vectors are the head pointers for linked-lists of interrupt handlers.  Figure shows the Intel Pentium interrupt vector. Interrupts 0 to 31 are non-maskable and reserved for serious hardware and other errors. Maskable interrupts, including normal device I/O interrupts begin at interrupt 32.  Modern interrupt hardware also supports interrupt priority levels, allowing systems to mask off only lower-priority interrupts while servicing a high-priority interrupt, or conversely to allow a high-priority signal to interrupt the processing of a low-priority one.
  • 14.
  • 15.  At boot time the system determines which devices are present, and loads the appropriate handler addresses into the interrupt table.  During operation, devices signal errors or the completion of commands via interrupts.  Exceptions, such as dividing by zero, invalid memory accesses, or attempts to access kernel mode instructions can be signaled via interrupts.  Time slicing and context switches can also be implemented using the interrupt mechanism.  The scheduler sets a hardware timer before transferring control over to a user process.  When the timer raises the interrupt request line, the CPU performs a state-save, and transfers control over to the proper interrupt handler, which in turn runs the scheduler.  The scheduler does a state-restore of a different process before resetting the timer and issuing the return-from-interrupt instruction.
  • 16.  System calls are implemented via software interrupts, a.k.a. traps. When a ( library ) program needs work performed in kernel mode, it sets command information and possibly data addresses in certain registers, and then raises a software interrupt. ( E.g. 21 hex in DOS. ) The system does a state save and then calls on the proper interrupt handler to process the request in kernel mode. Software interrupts generally have low priority, as they are not as urgent as devices with limited buffering space.  A similar example involves the paging system for virtual memory - A page fault causes an interrupt, which in turn issues an I/O request and a context switch as described above, moving the interrupted process into the wait queue and selecting a different process to run. When the I/O request has completed ( i.e. when the requested page has been loaded up into physical memory ), then the device interrupts, and the interrupt handler moves the process from the wait queue into the ready queue, ( or depending on scheduling algorithms and policies, may go ahead and context switch it back onto the CPU. )
  • 17.  Interrupts are also used to control kernel operations, and to schedule activities for optimal performance. For example, the completion of a disk read operation involves two interrupts:  A high-priority interrupt acknowledges the device completion, and issues the next disk request so that the hardware does not sit idle.  A lower-priority interrupt transfers the data from the kernel memory space to the user space, and then transfers the process from the waiting queue to the ready queue.
  • 18. Direct Memory Access  For devices that transfer large quantities of data ( such as disk controllers ), it is wasteful to tie up the CPU transferring data in and out of registers one byte at a time.  Instead this work can be off-loaded to a special processor, known as the Direct Memory Access, DMA, Controller.  The host issues a command to the DMA controller, indicating the location where the data is located, the location where the data is to be transferred to, and the number of bytes of data to transfer. The DMA controller handles the data transfer, and then interrupts the CPU when the transfer is complete.  A simple DMA controller is a standard component in modern PCs, and many bus- mastering I/O cards contain their own DMA hardware.  Handshaking between DMA controllers and their devices is accomplished through two wires called the DMA-request and DMA-acknowledge wires.
  • 19. Direct Memory Access  While the DMA transfer is going on the CPU does not have access to the PCI bus ( including main memory ), but it does have access to its internal registers and primary and secondary caches.  DMA can be done in terms of either physical addresses or virtual addresses that are mapped to physical addresses. The latter approach is known as Direct Virtual Memory Access, DVMA, and allows direct data transfer from one memory- mapped device to another without using the main memory chips.  Direct DMA access by user processes can speed up operations, but is generally forbidden by modern systems for security and protection reasons. ( I.e. DMA is a kernel-mode operation. )
  • 20.
  • 21.
  • 22. Device Drivers  Device Drivers are the software through which, the kernel of a computer communicates with different hardware, without having to go into the details of how the hardware works.  It is a software that controls a hardware part attached to a computer and allows the computer to use the hardware by providing a suitable interface.  This means that the operating system need not go into the details about how the hardware part works.  It also provides a common interface so that the operating system or the Kernel can communicate with the hardware.  Thus, the purpose of device drivers is to allow smooth functioning of the hardware for which it is created and to allow it to be used with different operating systems.
  • 23. Device Driver Types  There are device drivers for almost every device associated with a computer – from BIOS to even virtual machines and more. Device drivers can be broadly be classified into two categories:  Kernel Device Drivers  User Device Drivers
  • 24. Kernel Device Drivers  Kernel Device Drivers are the generic device drivers that load with the operating system into the memory as part of the operating system; not the entire driver but a pointer to that effect so that the device driver can be invoked as soon as it is required.  The drivers are pertaining to BIOS, motherboard, processor, and similar hardware form part of Kernel Software.  A problem with Kernel Device Drivers is that when one of them is invoked, it is loaded into the RAM and cannot be moved to page file (virtual memory).  Thus, a number of device drivers running at the same time can slow down machines. That is why there is a minimum system requirement for each operating system. The different operating systems already add up the resources needed for kernel device drivers, so that end users need not worry about extra memory requirements.
  • 25. User Device Drivers  User Mode Device Drivers are the ones usually triggered by users during their session on a computer.  It might be thought of devices that the user brought to the computer other than the kernel devices. Drivers for most of the Plug and Play devices fall into this category.  User Device Drivers can be written to disk so that they don’t act tough on the resources. However, for the drivers related to gaming devices, it is recommended to keep them in main memory (RAM).
  • 26. Block Drivers and Character Drivers  These two – the block and character device drivers – belong to the category of data reading and writing. Hard disks, CD ROMs, USB Drives, etc. – might be either Block Drivers or Character Drivers based on how they are used.  Character Drivers are used in serial buses. They write data one character at a time. One character means a byte in a generic sense. If a device is connected to a serial port, it is using a character driver. A mouse is a serial device and has a character device driver.  Block drivers refer to writing and reading of more than one character at a time. Usually, block device drivers create a block and retrieve as much information as the block can contain. Hard disks, for example, use block device drivers. CD ROMs too, are block device drivers, but the kernel needs to check that the device is still connected to the computer, each time the CD ROM is invoked by any application.