Information Technology Reference
In-Depth Information
operating system memory heap. These algorithms are a necessary part of dynamic
memory allocation because as memory is requested and released, it becomes frag-
mented. Because the defragmentation algorithm is not deterministic, it is not suitable
for real-time systems and usually pointless to offer such a service in the operating
system.
However, some real-time kernels do provide dynamic memory allocation services,
and there are a couple of allocation algorithms that maintain that their allocation
and deallocation times are constant. These algorithms are called half-fit and two-
level segregated fit (TLSF). But equally important to consistent allocation and de-
allocation times is keeping fragmentation to a minimum. An independent analysis
was performed on these two allocations algorithms, and it was found that although
both half-fit and TLSF have consistent upper bound response times, only TSLF had
minimal fragmentation. Although dynamic memory allocation is not recommended
for use with real-time systems, if it is necessary, TLSF may offer a possible solution
(Masmano et al., 2006).
The physical memory of system refers to the actual memory that exists in a
system. Each physical memory address represents a real location in memory. This
memory can include RAM, ROM, EEPROM, flash, and cache. The operating system
is responsible for managing the memory for use by the application. The application
needs access to memory to read program instructions and variables.
An operating system may have virtual memory. Virtual memory, like its name
suggests, is not physical memory, but it instead is a technique an operating systems
uses to give the illusion to a process or task that there is more memory than actually
exists in the system and that the memory is contiguous. The purpose of this was
to take off the burden of addressing memory from the programmer and have the
operating system provide a way so that the memory locations are adjacent and
easier for programmers (D'Souza, 2007). Virtual memory usually is not supported or
recommended for use in real-time operating systems because a real-time system needs
predictable data return times, and with virtual memory, the time can vary depending
on the actual location of the data. However, some new embedded operating systems,
such as Windows CE, support virtual memory (Wang et al., 2001). But it is still not
recommended for use with hard real-time systems because if a page fault occurs, the
memory access time is nondeterministic.
However, significant research has been done on this topic in recent years, and some
real-time applications would like to realize the benefit of using virtual memory. In
desktop systems that use virtual memory, they typically use a translation look-aside
buffer (TLB). The TLB maps the virtual address used by the program to a physical
address in memory. Most real-time systems do not have the option of including a TLB
in their architecture. One new method of using virtual memory in real-time systems
proposes a way to calculate the physical address by simple arithmetic computation,
thus replacing the need for a TLB (Zhou & Petrov, 2005).
Another area in memory that is often considered separate from both program
memory and RAM is called the run-time stack. The run-time stack maintained by the
operating system is responsible for keeping track of routines and subroutines that have
been interrupted and still need to complete execution. When a program is executing,
Search WWH ::




Custom Search