Professional Documents
Culture Documents
Operating
System
Memory Aspect
Introduction
An RTOS is a class of operating systems that are
intended for real time-applications.
What is a real time application?
A real time application is an application that
guarantees both correctness of result and the
added constraint of meeting a deadline.
Performance
One common misconception is that real-time
operating systems have better performance than
other general-purpose operating systems.
While real-time operating systems may provide
better performance in some cases due to less
multitasking between applications and services, this
is not a rule.
Actual application performance will depend on CPU
speed,
memory
architecture,
program
characteristics, and more.
facilities
to
guarantee
Aspects of RTOS
Some of the research areas of RTOS are as follows:
Scheduling
Memory Management
Inter-task Communication
Interrupt Handlers
Interrupt Latency
Priority Based Scheduling
Exceptional Handling
Memory Management
In a multiprogramming environment, it is essential for the
operating system to share available memory effectively
among processes.
Memory management policies are directly related to the
amount of memory required to execute those processes.
Memory management algorithms are designed to optimize
the number of runnable processes in primary memory while
avoiding conflicts that adversely affect system performance.
If a process is to remain in memory, the kernel must allocate
adequate units of memory.
If only part of a process needs to be in primary memory at
Memory Locking
Locking memory is one of the most important issues for realtime applications [1].
Under most of the operating system, the memory residency of
a process is determined by its current state, the total available
physical memory, the number of active processes, and the
processes' demand for memory.
This residency is appropriate in a time-share environment.
This residency is often unacceptable for a real-time process.
In a real-time environment, a process must guarantee a
memory residence to reduce the process' memory access and
dispatch latency [2].
Memory Sharing
Like Traditional OS, RTOSs also share memory.
RTOS memory sharing is given in Portable
Operating System Interface (POSIX) standard
of IEEE [4].
ST_MEMMGR [19]
The ST_MEMMGR follows the sequential allocation algorithm
with the first fit allocation policy.
The entire memory is maintained as a singly linked list of
allocated and free blocks.
During the allocation operation, the entire list is searched
sequentially in order to find the first free block large enough
to satisfy the allocation request.
It employs split and coalesce operations to best suite an
allocation request.
The allocation operation takes O(n) execution time since it
requires a sequential scan of the memory descriptors while
ST_COMPACT_MEMMGR [19]
The ST_COMPACT_MEMMGR utilizes memory
compaction in order to eliminate the problem of
external fragmentation leading to suboptimal usage
of memory.
However memory compaction involves reordering of
allocated blocks across the memory and thus a
mechanism is required to update the allocation
references, before any read/write operation is
attempted.
Contiki handles this problem, by introducing a level
of indirection.
ST_COMPACT_MEMMGR (Contd)
However in Contiki the programmer is required to get
an updated reference each time an attempt is made
to access the allocated block.
ST_COMPACT_MEMMGR employs a novel scheme to
automate the process of updating the allocation
references.
To automate the process of updating the allocation
references, the allocation reference pointers are kept
as global variables, and while allocating the
reference to the allocation pointer is passed as an
argument.
Windows CE
LynxOS
VxWorks
Jbed
pSOS
Windows CE
Windows CE [8] is a modular, portable real-time
embedded OS for small memory, mobile 32-bit
devices.
Windows CE slices CPU time among threads and
provides 256 priority levels. To optimize
performance, all threads are enabled to run in
kernel mode.
All kernel objects (such as processes, threads,
critical sections, mutexes, events and
semaphores) are dynamically allocated in virtual
memory.
LynxOS
LynxOS [9] is a POSIX compatible, multithreaded
OS designed for complex real-time applications
that require fast, deterministic response. It is
scalable from large switching systems down to
small-embedded products.
The OS depends upon hardware memory
management units for memory protection, but
does offer optional demand paging.
VxWorks
VxWorks [10] is a widely adopted RTOS in the
embedded industry with a visual development
environment. It is scalable with over 1800 APIs
and is available on popular CPU platforms.
It can be set up so that each task has a private
virtual memory upon request.
Jbed
Jbed [11] is a real-time operating system for
embedded systems. It supports applications and
device drivers written in Java.
It supports real-time memory allocation, exception
handling and automatic object destruction.
pSOS
The objects, in object-oriented pSOS, include
tasks, memory regions, message queues, and
semaphores.
A memory region is a physically contiguous block
of memory, created in response to a call from an
application. pSOS allocates memory regions to
tasks. As other objects, a memory region may be
local or global.
References
1. P.A. Laplante, Real-Time Systems Design and Analysis: An Engineers
Handbook, Second edition, IEEE Press, 1997.
2. Meghanathan, S. Baskiyar N. "A survey of contemporary real-time operating
systems."Informatica29, no. 2 (2005).
3. Oracle Real Time Programming and Administration, Chapter 12.
4. IEEE Information TechnologyPortable Operating System Interface (POSIX)
Part1:
5. C. Walls, RTOS for Microcontroller Applications, Electronic Engineering, vol.
68, no. 831, pp. 57-61, 1996.
6. S.R. Ball, Embedded Microprocessor Systems: Real World Design, Third
edition, Newnes, 2002.
7. P.A. Laplante, Real-Time Systems Design and Analysis: An Engineers
Handbook, Second edition, IEEE Press, 1997.
8. C. Muench, The Windows CE Technology Tutorial: Windows Powered Solutions for the
Developer, First edition, Addison Wesley, 2000.
9. LynxOS, http://www.lynuxworks.com, Accessed Nov 15, 2004.
10.VxWorks, http://www.windriver.com, Accessed Nov 10, 2004
11.System Application Program Interface, ANSI/IEEE Std 1003.1, 1996 Edition. Jbed RTOS,
12.Bohnert, Martin, and Christoph Scholl. "A dynamic virtual memory management under
real-time constraints." InEmbedded and Real-Time Computing Systems and
Applications (RTCSA), 2014 IEEE 20th International Conference on, pp. 1-10. IEEE, 2014.
13.P. R. Wilson, M. S. Johnstone, M. Neely, and D. Boles, Dynamic storage allocation: A
survey and critical review, in Memory Management, International Workshop IWMM 95,
ser. Lecture Notes in Computer Science, H. G. Baker, Ed., vol. 986, 1995, pp. 1116.
14.J. Fotheringham, Dynamic storage allocation in the Atlas computer, including an
automatic use of a backing store, Commun. ACM, vol. 4, no. 10, pp. 435436, 1961.
15.P. J. Denning, Virtual memory, ACM Comput. Surv., vol. 2, no. 3, pp. 153189, 1970.