0% found this document useful (0 votes)
32 views20 pages

Unit - 4 - Part 2

The document discusses several real-time operating systems (RTOSes) used in embedded systems, including VxWorks, μC/OS-II, and Linux. VxWorks is a popular RTOS that supports various processor architectures and has applications in fields like aerospace, robotics, and networking. It uses task-based scheduling and supports inter-task communication through methods like shared memory and message queues. μC/OS-II is a free, portable RTOS that can manage up to 64 tasks and has been ported to over 100 microprocessors. Linux can also be used in embedded systems and has a variant called RT Linux that modifies the kernel to better support real-time constraints.

Uploaded by

balasrb2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views20 pages

Unit - 4 - Part 2

The document discusses several real-time operating systems (RTOSes) used in embedded systems, including VxWorks, μC/OS-II, and Linux. VxWorks is a popular RTOS that supports various processor architectures and has applications in fields like aerospace, robotics, and networking. It uses task-based scheduling and supports inter-task communication through methods like shared memory and message queues. μC/OS-II is a free, portable RTOS that can manage up to 64 tasks and has been ported to over 100 microprocessors. Linux can also be used in embedded systems and has a variant called RT Linux that modifies the kernel to better support real-time constraints.

Uploaded by

balasrb2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

UNIT - 4

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:

1. Task Locking -> Provides restriction access to


shared resources. But it does not prevent
execution of ISR.
2. Disable Interrupts -> Interlock based mutual
exclusion implementation disables interrupts.
The system will not respond to interrupts when
the task is executing critical section code.
3. Locking resources with semaphores.
VX WORKS RTOS (CONTD…..)

Features of ISR in VX works:


 ISRs have highest priorities and can pre-empt
any running task.
 ISR should not use mutex semaphore.
 ISR should write the required data at the
memory or buffer.
 ISR should not use floating point functions as
these take longer time to execute.
VX WORKS RTOS (CONTD…..)
Features of Vx Works:
 Multitasking environment using standard POSIX scheduler.
 Ability to run two concurrent OS on single processing
layer.
 Different context saving mechanisms for tasks & ISRs.
 Virtual IO devices including pipes and sockets.
 Power management functions to enhance the ability to
control power consumption.
 Interconnecting functions that support large no. of
protocols.
 Network drivers for shared memory & Ethernet.
 Virtual memory management functions.
µC / OS - II
ΜC / OS-II
 It is a freeware OS.
 Micro Controller Operating System.
 Popularly known as MUCOS or Micro OS.
 Portable, ROMable, Scalable, Preemptive, real-time and
multitasking kernel.
 Used in automotive, avionics, consumer electronics,
medical devices, military, aerospace & networking &
System on Chip (SoC) development.
 Manage up to 64 tasks
 Ported to more than 100µp & µc.
 Supports all types of processor from 8 bit to 64 bit.
ΜC / OS-II (CONTD…..)
Task Creation & Management:
DORMANT -> State where a task is created but no
resources are allotted to it.
READY -> State where the task is awaiting for CPU for its
turn of execution.
RUNNING -> State where the task is being executed by
CPU.
WAITING -> State where the running task is temporarily
suspended from execution and does not have
immediate access to the resources.
INTERRUPTED -> A task enters the ISR state when a
interrupt is occurred & CPU executers the
ISR.
ΜC / OS-II (CONTD…..)
Task Scheduling:
 Support Preemptive based scheduling.
 Each task must be assigned priority ranging from
0 to 63 with 0 being highest priority level.
 Four Highest priorities (0 to 3) & four lowest
priorities (60 to 63) are reserved for kernel.
 Task rescheduling happens in the following
situation:
 Whenever high priority task becomes

“READY” to run or when a task enters


“WAITING” state.
 Whenever interrupts occur, the tasks are

rescheduled upon return from ISR.


ΜC / OS-II (CONTD…..)
Inter Task / Process (IPC) Communication:
 Supports mail box and message queue IPC communication
techniques.
Mutual Exclusion & Task Synchronization:
 Disabling interrupts

 Semaphores for mutual exclusion

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:

clock_set time ( ) function


 Clock_id gives the identification of the clock to be read.

You might also like