Upload
dugguz
View
67
Download
0
Embed Size (px)
Citation preview
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
1
REAL TIME OPERATING SYSTEMS
Lesson-8:I/O Subsystems
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
2
1. I/O Subsystem1. I/O Subsystem
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
3
I/O portsI/O ports
Subsystems of OS device management system─ UART access sub system and the parallel port access sub system .
They are used by drivers to communicate with the many devices that use them
I/O instructions depend on the hardware platform.
I/O systems differ in different OSes.
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
4
Application IO Basic functions IO device driver functions Device Hardware or Port or IO Interface
card
I/O Subsystem in a Typical I/O System I/O Subsystem in a Typical I/O System at in an OSat in an OS
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
5
2. I/O Operations2. I/O Operations
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
6
Traditional OSes Synchronous IO operations─ at a certain fixed data transfer rates.
RTOSes Asynchronous IO operations ─ at the variable data transfer rates.
OSes differing IO operationsOSes differing IO operations
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
7
Are at a certain fixed data transfer rates. Therefore, a task (process) blocks tills till
completion of the IO. For example, a write function, write ( ) for 1
kB data transfer to a buffer.
Synchronous IO operationsSynchronous IO operations
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
8
Synchronous IOSynchronous IO
Synchronous IO operation means once synchronous IO initiates, the data transfer will block the task till 1 kB data gets transferred to the buffer.
Similarly, read ( ) once initiated blocks the task till 1 kB is read
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
9
Variable data transfer rates. Permits that a process of high priority to run
and should not block during the IOs.
Asynchronous IO operationsAsynchronous IO operations
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
10
2. POSIX asynchronous functions for 2. POSIX asynchronous functions for IOsIOs
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
11
• aio_read ( ) • aio_write ( ) • aio_list ( ) • aio_error ( )• aio_cancel, • aio_suspend ( )─ Suspension is till the next
port-device interruption or till a timed out. • aio_return ( ) returns the status of completed
operations.
POSIX asynchronous functions for POSIX asynchronous functions for IOsIOs
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
12
SummarySummary
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
13
We learntWe learnt• I/O subsystems are part of OS services.• Examples are UART access and parallel
port access. • Synchronous and asynchronous IOs. • A task gets blocked during the synchronous
IOs, for example, fread ( ) or write ( ).• RTOSes support asynchronous IOs, for
example, aio_read ( ) and aio_write also in order to not to block a task during the IOs
2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
14
End of Lesson 8 of Chapter 8End of Lesson 8 of Chapter 8