CS452 - Real-Time Programming - Spring 2008
Lecture 5 - Kernel
Questions & Comments
- Link register
- Lab should be ready Friday: Assignment 2 (aka 1)
Devices
Real-time clock
Usually a count-down timer
Programming
- mode: interrupt, continuous
- clock divisor
- cycle length
- start
Reading
- ready bit means timer reached zero
- latch and read gets where we currently are
USART
Universal Synchronous/Asynchronous Receiver/Transmitter
We load a piece of data, usually a byte. It shifts out the bits on a
time-multiplexed signal
Programming
- Bit-rate
- Synchronous/asynchronous
- Flow control
- 7 or 8 bit ACSII
- Start and stop bits
- Interrupt
- DMA
Using
Kernel of a Real-time Operating System
Diagram
What Does the Kernel Provide
Tasks
- Provide applications with modularity, which is a higher level at which
they can be organized
- Consist of
- instructions, common to all tasks
- global state, common to all tasks
- local state, different state in different tasks
- How tasks work together
- synchronization
- communication
- combined into one mechanism: message passing
Communication
Communication has two sides
- sharing information
- handshaking
We use Send/Receive/Reply (SRR) to do both.
- Send blocks
- Receive blocks: is synchronous with the call to send
- Reply doesn't block: is synchronous with the return from send
Diagram
Synchronization
- Between tasks
- Coordination of execution in co-operating tasks
- Uses SRR
- With internal events
- Real-time by synchronizing with a real-time clock: e.g. clock
server
- Ordering execution: e.g. name server, bounded buffer
- Uses SRR
- With external events
Return to: