Information Technology Reference
In-Depth Information
A third method for peripherals to communicate with the system is through direct
memory access or DMA. DMA usually is supported through the hardware, not the
operating system. But it can alleviate some overhead in an operating system by pro-
viding a means to transfer data from device memory to system memory or RAM.
Typically DMA requires a separate hardware controller that handles the memory
transfer. The CPU does not perform the transfer; instead it hands control over to the
DMA controller. A common use for DMA is transferring data to and from periph-
eral memory, such as analog-to-digital converters or digital-to-analog converters. A
benefit of DMA is that the CPU does not need to handle the data transfer, allowing
it to execute code. However, because DMA is using the data lines, if the CPU needs
to transfer data to memory, it must wait for the DMA transfer to complete. Because
DMA frees up the CPU, it can add efficiency to the system, but it also adds cost
because additional hardware is required. Most cheap real-time systems cannot afford
this luxury so it is up to the operating system to manage the peripheral data transfer.
Table 3.2 shows peripheral communication design options and comparison for some
input/output (I/O) synchronizing methods.
3.3.3
Task Management
A real-time system has tasks that are time sensitive, meaning they must be completed
by a certain predetermined time in order for the system to be correct. Some real-
time systems support tasks that are both real-time and non-real-time and the systems
resources must be shared between both task types. Most importantly to hard real-time
systems is that the task deadlines are satisfied and that they meet the requirements of
the system.
In real-time systems, tasks may have different priorities assigned to them and a
task that has a higher priority may preempt a running task with a lower priority. A task
may be preempted when its time quantum has expired and the next task is scheduled
to run. Because tasks in real-time systems are usually time sensitive, the operating
system must be designed to allow for preemption of tasks. It must have a method to
arbitrate between tasks that want to run at the same time. This is usually handled by
assigning priorities to each of the tasks and the priorities may be static, meaning they
never change. Or they may be dynamic, meaning they may change based on the state
of the system.
In addition to priorities, tasks are usually in one of the following states: running
(executing), ready, and suspended (blocked). An operating system puts tasks in certain
states to organize them and let the scheduler know which tasks are ready to run on the
processor. A task that is “running” means that its code is currently being executed on
the CPU. In a single processor system, only one task at a time can be in the “running”
state. A task in the “ready” state is a task that is ready to run on the CPU but is not
currently running. Tasks in the “suspended” state are waiting for something external
to occur, many times related to peripheral communication, such as disk read/write or
memory access (Rizzo, et al., 2006). Also, when a task completes, it also moves to
the suspended state until it is time for it to run again. A task is considered “dormant”
if it exists in a system that has a fixed number of task control blocks (TCBs) and
Search WWH ::




Custom Search