14
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

6 Input /Output Subsystem

  • Upload
    dugguz

  • View
    67

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 6 Input /Output  Subsystem

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

Page 2: 6 Input /Output  Subsystem

2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

2

1. I/O Subsystem1. I/O Subsystem

Page 3: 6 Input /Output  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.

Page 4: 6 Input /Output  Subsystem

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

Page 5: 6 Input /Output  Subsystem

2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

5

2. I/O Operations2. I/O Operations

Page 6: 6 Input /Output  Subsystem

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

Page 7: 6 Input /Output  Subsystem

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

Page 8: 6 Input /Output  Subsystem

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

Page 9: 6 Input /Output  Subsystem

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

Page 10: 6 Input /Output  Subsystem

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

Page 11: 6 Input /Output  Subsystem

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

Page 12: 6 Input /Output  Subsystem

2008 Chapter-8 L8: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

12

SummarySummary

Page 13: 6 Input /Output  Subsystem

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

Page 14: 6 Input /Output  Subsystem

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