Unit - 4 - Part 2
Unit - 4 - Part 2
RTOS BASED
EMBEDDED
SYSTEM DESIGN
VX WORKS
OS
VX WORKS RTOS
Popular RTOS for high performance, hard real time and
multitasking operating system.
Supports various types of target processors/controllers
including Intel X-86, ARM, Power PC (PPC).
The kernel of Vx works is known as wind.
It has wider application such as aero space and defense,
robotics & industrial applications, networking &
consumer electronics, car navigation, telemetric
systems.
Follows task based execution model.
It is possible to run even a subroutine as a separate task
with own context and stack.
VX WORKS RTOS (CONTD…..)
Task Creation and Management:
READY -> Task ready for execution & waiting for its
turn to get the CPU.
PEND -> The task is blocked (Pended) state because
of waiting for some resources.
DELAY -> The task is sleeping.
SUSPEND -> The task is unavailable for execution.
This state is used for halting task for
debugging or to change the state of the
task.
VX WORKS RTOS (CONTD…..)
Task Scheduling:
Supports Round Robin and priority based pre-
emption scheduling.
Round Robin scheduling policy is adopted for
priority resolution among equal priority tasks.
Round Robin allows each task to be executed
for specified amount of time. The task
relinquishes the CPU to other task with equal
priority when its time interval is completed.
VX WORKS RTOS (CONTD…..)
Inter Task/Process Communication (IPC):
It is facilitated through shared memory, message
queues, pipes, RPC and sockets and signaling.
Message queue is the primary IPC.
Message queue supports two way messaging of
variable length.
Two way messaging can be implemented using one
message queue for incoming and another one for
outgoing messages.
Message mechanisms can be task-task, task-
interrupt service routine.
VX WORKS RTOS (CONTD…..)
Task Synchronization and Mutual Exclusion:
Data share is one of the inter-task mechanisms
adopted by Vx works.
Mutual exclusion is adopted in different ways:
Memory Management:
Supports run time memory allocation and de-allocation on a need
basis.
The memory is divided into multiple sectors. Each sector is
further divided into blocks. Each block holds fixed bytes of
memory.
Each partition contains a minimum of two memory blocks. The
block size is uniform throughput the partition. Each memory
partition associates a Memory Control Block (MCB) with it.
ΜC / OS-II (CONTD…..)
Interrupt Handling:
Each interrupt is assigned a Interrupt Request (IRQ) number.
The actions corresponding to an interrupt is implemented in a
function called ISR.
IRQ links to corresponding ISR.
ISR containing codes for saving CPU registers & restoring it back
when return back from ISR.
ISR can be implemented in “C” function, provided the cross
complier supports mixing of assembly code with “C”.
Time Management:
“Clock Tick’ acts as time source for providing timing reference
for time delays & time outs.
“Clock Tick” generates periodic interrupt
The Clock Ticker interrupt should be enabled for handling clock
ticks
LINUX
OS
LINUX OS
It is a UNIX like computer OS assembled under the model
of free & open source software development and
distribution.
Originally developed for Intel X86 – based PCs.
Linux also run on embedded system such as mobile
phones, networks, routers, TV etc.
Features:
Multi user OS. Every user is given a user name or login
name.
Heading system is organized hierarchically. At the top
level is root directory under which sub-directories are
placed.
Variety of user interfaces are available.
LINUX OS (CONTD….)
Kernel:
Manages the task to achieve desired
performance by the system.
To manage the task, the tasks are to be
scheduled and IPC are to be facilitated.
Provides memory management, time
management, interrupt handling & Device
management services.
LINUX OS (CONTD….)
RT LINUX:
It is a Hard Real Time OS microkernel that runs entire LINUX
OS as a fully preemptive process.
LINUX kernel has been modified by adding a layer of software
between hardware & LINUX kernel.
This additional layer is called “Virtual machine”
The new layer of RT LINUX has a separate task scheduler.
This task scheduler assigns low priority to standard LINUX
kernel.
Any task that has to met real time constraints will run under
RT LINUX.
Interrupts from LINUX are disabled to achieve real time
performance.
LINUX OS (CONTD….)
RT LINUX modules:
RT LINUX programs are not created as stand alone units,
they are created as modules which are loaded into LINUX
kernel space.
A real time program generally consists of no. of threads.
Each threads shares a common address space.
Time Management:
Number of internal clocks are available in RT LINUX to
manage timers.
The current clock reading is obtained using command: