SlideShare uma empresa Scribd logo
1 de 38
Chapter 13: I/O SystemsChapter 13: I/O Systems
13.2 Silberschatz, Galvin and GagneOperating System Concepts
Chapter 13: I/O SystemsChapter 13: I/O Systems
I/O Hardware
Application I/O Interface
Kernel I/O Subsystem
Transforming I/O Requests to Hardware Operations
Streams
Performance
13.3 Silberschatz, Galvin and GagneOperating System Concepts
ObjectivesObjectives
Explore the structure of an operating system’s I/O subsystem
Discuss the principles of I/O hardware and its complexity
Provide details of the performance aspects of I/O hardware and
software
13.4 Silberschatz, Galvin and GagneOperating System Concepts
I/O HardwareI/O Hardware
Incredible variety of I/O devices
Common concepts
Port
Bus (daisy chain or shared direct access)
Controller (host adapter)
I/O instructions control devices
Devices have addresses, used by
Direct I/O instructions
Memory-mapped I/O
13.5 Silberschatz, Galvin and GagneOperating System Concepts
A Typical PC Bus StructureA Typical PC Bus Structure
13.6 Silberschatz, Galvin and GagneOperating System Concepts
Device I/O Port Locations on PCs (partial)Device I/O Port Locations on PCs (partial)
13.7 Silberschatz, Galvin and GagneOperating System Concepts
PollingPolling
Determines state of device
command-ready
busy
Error
Busy-wait cycle to wait for I/O from device
13.8 Silberschatz, Galvin and GagneOperating System Concepts
InterruptsInterrupts
CPU Interrupt-request line triggered by I/O device
Interrupt handler receives interrupts
Maskable to ignore or delay some interrupts
Interrupt vector to dispatch interrupt to correct handler
Based on priority
Some nonmaskable
Interrupt mechanism also used for exceptions
13.9 Silberschatz, Galvin and GagneOperating System Concepts
Interrupt-Driven I/O CycleInterrupt-Driven I/O Cycle
13.10 Silberschatz, Galvin and GagneOperating System Concepts
Intel Pentium Processor Event-VectorIntel Pentium Processor Event-Vector
TableTable
13.11 Silberschatz, Galvin and GagneOperating System Concepts
Direct Memory AccessDirect Memory Access
Used to avoid programmed I/O for large data movement
Requires DMA controller
Bypasses CPU to transfer data directly between I/O device and memory
13.12 Silberschatz, Galvin and GagneOperating System Concepts
Six Step Process to Perform DMASix Step Process to Perform DMA
TransferTransfer
13.13 Silberschatz, Galvin and GagneOperating System Concepts
Application I/O InterfaceApplication I/O Interface
I/O system calls encapsulate device behaviors in generic classes
Device-driver layer hides differences among I/O controllers from
kernel
Devices vary in many dimensions
Character-stream or block
Sequential or random-access
Sharable or dedicated
Speed of operation
read-write, read only, or write only
13.14 Silberschatz, Galvin and GagneOperating System Concepts
A Kernel I/O StructureA Kernel I/O Structure
13.15 Silberschatz, Galvin and GagneOperating System Concepts
Characteristics of I/O DevicesCharacteristics of I/O Devices
13.16 Silberschatz, Galvin and GagneOperating System Concepts
Block and Character DevicesBlock and Character Devices
Block devices include disk drives
Commands include read, write, seek
Raw I/O or file-system access
Memory-mapped file access possible
Character devices include keyboards, mice, serial ports
Commands include get, put
Libraries layered on top allow line editing
13.17 Silberschatz, Galvin and GagneOperating System Concepts
Network DevicesNetwork Devices
Varying enough from block and character to have own interface
Unix and Windows NT/9x/2000 include socket interface
Separates network protocol from network operation
Includes select functionality
Approaches vary widely (pipes, FIFOs, streams, queues,
mailboxes)
13.18 Silberschatz, Galvin and GagneOperating System Concepts
Clocks and TimersClocks and Timers
Provide current time, elapsed time, timer
Programmable interval timer used for timings, periodic
interrupts
ioctl (on UNIX) covers odd aspects of I/O such as clocks and
timers
13.19 Silberschatz, Galvin and GagneOperating System Concepts
Blocking and Nonblocking I/OBlocking and Nonblocking I/O
Blocking - process suspended until I/O completed
Easy to use and understand
Insufficient for some needs
Nonblocking - I/O call returns as much as available
User interface, data copy (buffered I/O)
Implemented via multi-threading
Returns quickly with count of bytes read or written
Asynchronous - process runs while I/O executes
Difficult to use
I/O subsystem signals process when I/O completed
13.20 Silberschatz, Galvin and GagneOperating System Concepts
Two I/O MethodsTwo I/O Methods
Synchronous Asynchronous
13.21 Silberschatz, Galvin and GagneOperating System Concepts
Kernel I/O SubsystemKernel I/O Subsystem
Scheduling
Some I/O request ordering via per-device queue
Some OSs try fairness
Buffering - store data in memory while transferring between devices
To cope with device speed mismatch
To cope with device transfer size mismatch
To maintain “copy semantics”
13.22 Silberschatz, Galvin and GagneOperating System Concepts
Device-status TableDevice-status Table
13.23 Silberschatz, Galvin and GagneOperating System Concepts
Sun Enterprise 6000 Device-TransferSun Enterprise 6000 Device-Transfer
RatesRates
13.24 Silberschatz, Galvin and GagneOperating System Concepts
Kernel I/O SubsystemKernel I/O Subsystem
Caching - fast memory holding copy of data
Always just a copy
Key to performance
Spooling - hold output for a device
If device can serve only one request at a time
i.e., Printing
Device reservation - provides exclusive access to a device
System calls for allocation and deallocation
Watch out for deadlock
13.25 Silberschatz, Galvin and GagneOperating System Concepts
Error HandlingError Handling
OS can recover from disk read, device unavailable, transient write
failures
Most return an error number or code when I/O request fails
System error logs hold problem reports
13.26 Silberschatz, Galvin and GagneOperating System Concepts
I/O ProtectionI/O Protection
User process may accidentally or purposefully attempt to disrupt
normal operation via illegal I/O instructions
All I/O instructions defined to be privileged
I/O must be performed via system calls
 Memory-mapped and I/O port memory locations must be
protected too
13.27 Silberschatz, Galvin and GagneOperating System Concepts
Use of a System Call to Perform I/OUse of a System Call to Perform I/O
13.28 Silberschatz, Galvin and GagneOperating System Concepts
Kernel Data StructuresKernel Data Structures
Kernel keeps state info for I/O components, including open file
tables, network connections, character device state
Many, many complex data structures to track buffers, memory
allocation, “dirty” blocks
Some use object-oriented methods and message passing to
implement I/O
13.29 Silberschatz, Galvin and GagneOperating System Concepts
UNIX I/O Kernel StructureUNIX I/O Kernel Structure
13.30 Silberschatz, Galvin and GagneOperating System Concepts
I/O Requests to HardwareI/O Requests to Hardware
OperationsOperations
Consider reading a file from disk for a process:
Determine device holding file
Translate name to device representation
Physically read data from disk into buffer
Make data available to requesting process
Return control to process
13.31 Silberschatz, Galvin and GagneOperating System Concepts
Life Cycle of An I/O RequestLife Cycle of An I/O Request
13.32 Silberschatz, Galvin and GagneOperating System Concepts
STREAMSSTREAMS
STREAM – a full-duplex communication channel between a user-
level process and a device in Unix System V and beyond
A STREAM consists of:
- STREAM head interfaces with the user process
- driver end interfaces with the device
- zero or more STREAM modules between them.
Each module contains a read queue and a write queue
Message passing is used to communicate between queues
13.33 Silberschatz, Galvin and GagneOperating System Concepts
The STREAMS StructureThe STREAMS Structure
13.34 Silberschatz, Galvin and GagneOperating System Concepts
PerformancePerformance
I/O a major factor in system performance:
Demands CPU to execute device driver, kernel I/O code
Context switches due to interrupts
Data copying
Network traffic especially stressful
13.35 Silberschatz, Galvin and GagneOperating System Concepts
Intercomputer CommunicationsIntercomputer Communications
13.36 Silberschatz, Galvin and GagneOperating System Concepts
Improving PerformanceImproving Performance
Reduce number of context switches
Reduce data copying
Reduce interrupts by using large transfers, smart controllers, polling
Use DMA
Balance CPU, memory, bus, and I/O performance for highest
throughput
13.37 Silberschatz, Galvin and GagneOperating System Concepts
Device-Functionality ProgressionDevice-Functionality Progression
End of Chapter 13End of Chapter 13

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Mother board
Mother boardMother board
Mother board
 
Presentacion pujol
Presentacion pujolPresentacion pujol
Presentacion pujol
 
OSCh13
OSCh13OSCh13
OSCh13
 
Ch09
Ch09Ch09
Ch09
 
AIXpert - AIX Security expert
AIXpert - AIX Security expertAIXpert - AIX Security expert
AIXpert - AIX Security expert
 
Module 4. motherboard.
Module 4. motherboard.Module 4. motherboard.
Module 4. motherboard.
 
Ch05
Ch05Ch05
Ch05
 
Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29
 
Pc installation
Pc installationPc installation
Pc installation
 
P1 – Unit 3
P1 – Unit 3P1 – Unit 3
P1 – Unit 3
 
Mother board
Mother board Mother board
Mother board
 
Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Ch1 Operating System
Ch1 Operating System Ch1 Operating System
Ch1 Operating System
 
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case StudyTraditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
Traditional vs. SoC FPGA Design Flow A Video Pipeline Case Study
 
The Components of The System Unit
The Components of The System UnitThe Components of The System Unit
The Components of The System Unit
 
Cs intro-ca
Cs intro-caCs intro-ca
Cs intro-ca
 
Motherboard
MotherboardMotherboard
Motherboard
 
Computer motherboard
Computer motherboardComputer motherboard
Computer motherboard
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 

Destaque

Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application DevelopmentSenthil Kanth
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSSenthil Kanth
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocolsSenthil Kanth
 
Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2Senthil Kanth
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEESenthil Kanth
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1Senthil Kanth
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O SystemsWayne Jones Jnr
 
The Digital Logic Level
The Digital Logic LevelThe Digital Logic Level
The Digital Logic LevelLiEdo
 
Introduction to Structured Computer Organization
Introduction to  Structured Computer OrganizationIntroduction to  Structured Computer Organization
Introduction to Structured Computer OrganizationLiEdo
 
Linker and loader upload
Linker and loader   uploadLinker and loader   upload
Linker and loader uploadBin Yang
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language ILiEdo
 
Computer Systems Organization
Computer Systems OrganizationComputer Systems Organization
Computer Systems OrganizationLiEdo
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application ProtocolSenthil Kanth
 

Destaque (17)

Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
15.Security
15.Security15.Security
15.Security
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Adhoc routing protocols
Adhoc routing protocolsAdhoc routing protocols
Adhoc routing protocols
 
Wireless Communication and Networking by WilliamStallings Chap2
Wireless Communication and Networking  by WilliamStallings Chap2Wireless Communication and Networking  by WilliamStallings Chap2
Wireless Communication and Networking by WilliamStallings Chap2
 
DSDV VS AODV
DSDV VS AODV DSDV VS AODV
DSDV VS AODV
 
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEEXML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
XML Programming WML by Dickson K.W. Chiu PhD, SMIEEE
 
wireless communication and networking Chapter 1
wireless communication and networking Chapter 1wireless communication and networking Chapter 1
wireless communication and networking Chapter 1
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
The Digital Logic Level
The Digital Logic LevelThe Digital Logic Level
The Digital Logic Level
 
Introduction to Structured Computer Organization
Introduction to  Structured Computer OrganizationIntroduction to  Structured Computer Organization
Introduction to Structured Computer Organization
 
Linker and loader upload
Linker and loader   uploadLinker and loader   upload
Linker and loader upload
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language I
 
Computer Systems Organization
Computer Systems OrganizationComputer Systems Organization
Computer Systems Organization
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
WAP- Wireless Application Protocol
WAP- Wireless Application ProtocolWAP- Wireless Application Protocol
WAP- Wireless Application Protocol
 

Semelhante a OS I/O Systems Chapter Summary

Semelhante a OS I/O Systems Chapter Summary (20)

ch13.ppt
ch13.pptch13.ppt
ch13.ppt
 
Ch13 (1)
Ch13 (1)Ch13 (1)
Ch13 (1)
 
Input output systems ppt - cs2411
Input output systems ppt - cs2411Input output systems ppt - cs2411
Input output systems ppt - cs2411
 
1.introduction
1.introduction1.introduction
1.introduction
 
1.Introduction
1.Introduction1.Introduction
1.Introduction
 
Operating System - Unit I - Introduction
Operating System - Unit I - IntroductionOperating System - Unit I - Introduction
Operating System - Unit I - Introduction
 
Operating System
Operating SystemOperating System
Operating System
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
slide one
slide oneslide one
slide one
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Introduction to OS.
Introduction to OS.Introduction to OS.
Introduction to OS.
 
Introduction_to_OperatingSystems_ch1.ppt
Introduction_to_OperatingSystems_ch1.pptIntroduction_to_OperatingSystems_ch1.ppt
Introduction_to_OperatingSystems_ch1.ppt
 
Chapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptChapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.ppt
 
Chapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptChapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.ppt
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 

Mais de Senthil Kanth

WML Script by Shanti katta
WML Script by Shanti kattaWML Script by Shanti katta
WML Script by Shanti kattaSenthil Kanth
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiSenthil Kanth
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenSenthil Kanth
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSSenthil Kanth
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASenthil Kanth
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Senthil Kanth
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolSenthil Kanth
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System StructureSenthil Kanth
 
12.mass stroage system
12.mass stroage system12.mass stroage system
12.mass stroage systemSenthil Kanth
 
11.file system implementation
11.file system implementation11.file system implementation
11.file system implementationSenthil Kanth
 
10.file system interface
10.file system interface10.file system interface
10.file system interfaceSenthil Kanth
 
6.Process Synchronization
6.Process Synchronization6.Process Synchronization
6.Process SynchronizationSenthil Kanth
 

Mais de Senthil Kanth (20)

WML Script by Shanti katta
WML Script by Shanti kattaWML Script by Shanti katta
WML Script by Shanti katta
 
What is WAP?
What is WAP?What is WAP?
What is WAP?
 
Introduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogiIntroduction to wireless application protocol (wap)ogi
Introduction to wireless application protocol (wap)ogi
 
Wireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by AlvinenWireless Application Protocol WAP by Alvinen
Wireless Application Protocol WAP by Alvinen
 
HR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONSHR QUESTIONS, INTERVIEW QUESTIONS
HR QUESTIONS, INTERVIEW QUESTIONS
 
HR QUESTIONS
HR QUESTIONSHR QUESTIONS
HR QUESTIONS
 
STOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBASTOCK APPLICATION USING CORBA
STOCK APPLICATION USING CORBA
 
RSA alogrithm
RSA alogrithmRSA alogrithm
RSA alogrithm
 
Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)Zone Routing Protocol (ZRP)
Zone Routing Protocol (ZRP)
 
On-Demand Multicast Routing Protocol
On-Demand Multicast Routing ProtocolOn-Demand Multicast Routing Protocol
On-Demand Multicast Routing Protocol
 
16.Distributed System Structure
16.Distributed System Structure16.Distributed System Structure
16.Distributed System Structure
 
14.Protection
14.Protection14.Protection
14.Protection
 
12.mass stroage system
12.mass stroage system12.mass stroage system
12.mass stroage system
 
11.file system implementation
11.file system implementation11.file system implementation
11.file system implementation
 
10.file system interface
10.file system interface10.file system interface
10.file system interface
 
9.Virtual Memory
9.Virtual Memory9.Virtual Memory
9.Virtual Memory
 
7.Dead Locks
7.Dead Locks7.Dead Locks
7.Dead Locks
 
6.Process Synchronization
6.Process Synchronization6.Process Synchronization
6.Process Synchronization
 
5.CPU Scheduling
5.CPU Scheduling5.CPU Scheduling
5.CPU Scheduling
 
4.Threads
4.Threads4.Threads
4.Threads
 

Último

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 

Último (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 

OS I/O Systems Chapter Summary

  • 1. Chapter 13: I/O SystemsChapter 13: I/O Systems
  • 2. 13.2 Silberschatz, Galvin and GagneOperating System Concepts Chapter 13: I/O SystemsChapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance
  • 3. 13.3 Silberschatz, Galvin and GagneOperating System Concepts ObjectivesObjectives Explore the structure of an operating system’s I/O subsystem Discuss the principles of I/O hardware and its complexity Provide details of the performance aspects of I/O hardware and software
  • 4. 13.4 Silberschatz, Galvin and GagneOperating System Concepts I/O HardwareI/O Hardware Incredible variety of I/O devices Common concepts Port Bus (daisy chain or shared direct access) Controller (host adapter) I/O instructions control devices Devices have addresses, used by Direct I/O instructions Memory-mapped I/O
  • 5. 13.5 Silberschatz, Galvin and GagneOperating System Concepts A Typical PC Bus StructureA Typical PC Bus Structure
  • 6. 13.6 Silberschatz, Galvin and GagneOperating System Concepts Device I/O Port Locations on PCs (partial)Device I/O Port Locations on PCs (partial)
  • 7. 13.7 Silberschatz, Galvin and GagneOperating System Concepts PollingPolling Determines state of device command-ready busy Error Busy-wait cycle to wait for I/O from device
  • 8. 13.8 Silberschatz, Galvin and GagneOperating System Concepts InterruptsInterrupts CPU Interrupt-request line triggered by I/O device Interrupt handler receives interrupts Maskable to ignore or delay some interrupts Interrupt vector to dispatch interrupt to correct handler Based on priority Some nonmaskable Interrupt mechanism also used for exceptions
  • 9. 13.9 Silberschatz, Galvin and GagneOperating System Concepts Interrupt-Driven I/O CycleInterrupt-Driven I/O Cycle
  • 10. 13.10 Silberschatz, Galvin and GagneOperating System Concepts Intel Pentium Processor Event-VectorIntel Pentium Processor Event-Vector TableTable
  • 11. 13.11 Silberschatz, Galvin and GagneOperating System Concepts Direct Memory AccessDirect Memory Access Used to avoid programmed I/O for large data movement Requires DMA controller Bypasses CPU to transfer data directly between I/O device and memory
  • 12. 13.12 Silberschatz, Galvin and GagneOperating System Concepts Six Step Process to Perform DMASix Step Process to Perform DMA TransferTransfer
  • 13. 13.13 Silberschatz, Galvin and GagneOperating System Concepts Application I/O InterfaceApplication I/O Interface I/O system calls encapsulate device behaviors in generic classes Device-driver layer hides differences among I/O controllers from kernel Devices vary in many dimensions Character-stream or block Sequential or random-access Sharable or dedicated Speed of operation read-write, read only, or write only
  • 14. 13.14 Silberschatz, Galvin and GagneOperating System Concepts A Kernel I/O StructureA Kernel I/O Structure
  • 15. 13.15 Silberschatz, Galvin and GagneOperating System Concepts Characteristics of I/O DevicesCharacteristics of I/O Devices
  • 16. 13.16 Silberschatz, Galvin and GagneOperating System Concepts Block and Character DevicesBlock and Character Devices Block devices include disk drives Commands include read, write, seek Raw I/O or file-system access Memory-mapped file access possible Character devices include keyboards, mice, serial ports Commands include get, put Libraries layered on top allow line editing
  • 17. 13.17 Silberschatz, Galvin and GagneOperating System Concepts Network DevicesNetwork Devices Varying enough from block and character to have own interface Unix and Windows NT/9x/2000 include socket interface Separates network protocol from network operation Includes select functionality Approaches vary widely (pipes, FIFOs, streams, queues, mailboxes)
  • 18. 13.18 Silberschatz, Galvin and GagneOperating System Concepts Clocks and TimersClocks and Timers Provide current time, elapsed time, timer Programmable interval timer used for timings, periodic interrupts ioctl (on UNIX) covers odd aspects of I/O such as clocks and timers
  • 19. 13.19 Silberschatz, Galvin and GagneOperating System Concepts Blocking and Nonblocking I/OBlocking and Nonblocking I/O Blocking - process suspended until I/O completed Easy to use and understand Insufficient for some needs Nonblocking - I/O call returns as much as available User interface, data copy (buffered I/O) Implemented via multi-threading Returns quickly with count of bytes read or written Asynchronous - process runs while I/O executes Difficult to use I/O subsystem signals process when I/O completed
  • 20. 13.20 Silberschatz, Galvin and GagneOperating System Concepts Two I/O MethodsTwo I/O Methods Synchronous Asynchronous
  • 21. 13.21 Silberschatz, Galvin and GagneOperating System Concepts Kernel I/O SubsystemKernel I/O Subsystem Scheduling Some I/O request ordering via per-device queue Some OSs try fairness Buffering - store data in memory while transferring between devices To cope with device speed mismatch To cope with device transfer size mismatch To maintain “copy semantics”
  • 22. 13.22 Silberschatz, Galvin and GagneOperating System Concepts Device-status TableDevice-status Table
  • 23. 13.23 Silberschatz, Galvin and GagneOperating System Concepts Sun Enterprise 6000 Device-TransferSun Enterprise 6000 Device-Transfer RatesRates
  • 24. 13.24 Silberschatz, Galvin and GagneOperating System Concepts Kernel I/O SubsystemKernel I/O Subsystem Caching - fast memory holding copy of data Always just a copy Key to performance Spooling - hold output for a device If device can serve only one request at a time i.e., Printing Device reservation - provides exclusive access to a device System calls for allocation and deallocation Watch out for deadlock
  • 25. 13.25 Silberschatz, Galvin and GagneOperating System Concepts Error HandlingError Handling OS can recover from disk read, device unavailable, transient write failures Most return an error number or code when I/O request fails System error logs hold problem reports
  • 26. 13.26 Silberschatz, Galvin and GagneOperating System Concepts I/O ProtectionI/O Protection User process may accidentally or purposefully attempt to disrupt normal operation via illegal I/O instructions All I/O instructions defined to be privileged I/O must be performed via system calls  Memory-mapped and I/O port memory locations must be protected too
  • 27. 13.27 Silberschatz, Galvin and GagneOperating System Concepts Use of a System Call to Perform I/OUse of a System Call to Perform I/O
  • 28. 13.28 Silberschatz, Galvin and GagneOperating System Concepts Kernel Data StructuresKernel Data Structures Kernel keeps state info for I/O components, including open file tables, network connections, character device state Many, many complex data structures to track buffers, memory allocation, “dirty” blocks Some use object-oriented methods and message passing to implement I/O
  • 29. 13.29 Silberschatz, Galvin and GagneOperating System Concepts UNIX I/O Kernel StructureUNIX I/O Kernel Structure
  • 30. 13.30 Silberschatz, Galvin and GagneOperating System Concepts I/O Requests to HardwareI/O Requests to Hardware OperationsOperations Consider reading a file from disk for a process: Determine device holding file Translate name to device representation Physically read data from disk into buffer Make data available to requesting process Return control to process
  • 31. 13.31 Silberschatz, Galvin and GagneOperating System Concepts Life Cycle of An I/O RequestLife Cycle of An I/O Request
  • 32. 13.32 Silberschatz, Galvin and GagneOperating System Concepts STREAMSSTREAMS STREAM – a full-duplex communication channel between a user- level process and a device in Unix System V and beyond A STREAM consists of: - STREAM head interfaces with the user process - driver end interfaces with the device - zero or more STREAM modules between them. Each module contains a read queue and a write queue Message passing is used to communicate between queues
  • 33. 13.33 Silberschatz, Galvin and GagneOperating System Concepts The STREAMS StructureThe STREAMS Structure
  • 34. 13.34 Silberschatz, Galvin and GagneOperating System Concepts PerformancePerformance I/O a major factor in system performance: Demands CPU to execute device driver, kernel I/O code Context switches due to interrupts Data copying Network traffic especially stressful
  • 35. 13.35 Silberschatz, Galvin and GagneOperating System Concepts Intercomputer CommunicationsIntercomputer Communications
  • 36. 13.36 Silberschatz, Galvin and GagneOperating System Concepts Improving PerformanceImproving Performance Reduce number of context switches Reduce data copying Reduce interrupts by using large transfers, smart controllers, polling Use DMA Balance CPU, memory, bus, and I/O performance for highest throughput
  • 37. 13.37 Silberschatz, Galvin and GagneOperating System Concepts Device-Functionality ProgressionDevice-Functionality Progression
  • 38. End of Chapter 13End of Chapter 13