book "Embedded Systems - Architecture, Programming and Design" by Raj Kamal
Size: 522.9 KB
Language: en
Added: Sep 24, 2024
Slides: 14 pages
Slide Content
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
1
REAL TIME OPERATING SYSTEMS
Lesson-8:
I/O Subsystems
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
2
1. I/O Subsystem
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
3
I/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 sub-systems differ in different OSes.
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
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
at in an OS
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
5
2. I/O Operations
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
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 operations
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
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 operations
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
8
Synchronous 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
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
9
Variable data transfer rates
Permits that a process of high priority to run
and should not block during the IOs
Asynchronous IO operations
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
10
2. POSIX asynchronous functions for
IOs
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
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
IOs
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
12
Summary
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
13
We 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
2015
Chapter-10 L8: "Embedded Systems - Architecture, Programming and Design" ,
Raj Kamal, Publs.: McGraw-Hill Education
14
End of Lesson 8 of Chapter 10