Page 256 - Embedded Microprocessor Systems Real World Design
P. 256
NO
Figure 9.1
Communication System with Scheduling Implemented.
returns to the receive-output sequence. If the output code empties the FIFO buffer,
sending the last byte to the output device, the output code deactivates itself until
more data are available. Figure 9.1 illustrates this process.
Suppose that the system were more complicated and the return link to the host
were used to send other data in addition to the XON/XOFF flow control. Since
sending XOFF is a high priority (failing to do so risks buffer overflow and missed
data), XOFF may be activated as a higher priority than any other serial output task.
This ensures that the XOFF code gets the next available transmit slot on the serial
interface.
Although this example illustrates the concept of scheduling, the protocol
converter is much too simple to benefit from such a scheduling system. The code
to handle scheduling would be longer than the code to do just a sequential loop.
However, in complex systems, using an RTOS provides just this type of scheduling
capability.
Like the operating system in your PC, an RTOS (sometimes called a real-time
executive or real-time bnel) manages the limited resources of an embedded system.
Your PC does not keep every program on the disk in memory at once. Programs
are loaded and executed only when you select them. RTOSs have one characteris-
tic that is key to use in real-time designs: They are deterministic. That is, the
vendor supplies you with information as to how long it takes to perform specific
Real-Time Operating Systems 237