RTOS - M5 - Ktunotes - in
RTOS - M5 - Ktunotes - in
RTOS - M5 - Ktunotes - in
LINUX
Features of Linux
Linux is a free and open-source operating system that has been in use since the early 1990s. It is
known for its stability, security, and flexibility, which have made it the preferred choice for
servers, supercomputers, and other computing systems. The following are some of the key
features that make Linux a popular choice:
1. Open Source: Linux is an open-source operating system, which means that its source
code is available for free and can be modified and redistributed by anyone. This has led
to a large community of developers who work together to improve and enhance the
software.
2. Customizability: One of the key features of Linux is its customizability. Users can
modify the operating system to suit their specific needs and preferences. This can be done
by changing the kernel, installing different desktop environments, or using a different
package manager.
3. Stability: Linux is known for its stability and reliability. It has a reputation for being able
to run for long periods of time without crashing or needing to be rebooted. This is due to
the fact that the operating system is designed to be robust and able to handle a wide range
of workloads.
4. Security: Linux is known for its security features. It is less susceptible to viruses and
malware than other operating systems due to its design and the fact that it is open source.
Security updates are released frequently, and users can configure the system to be as
secure as they need it to be.
6. Multitasking: Linux is designed to support multitasking, which means that it can run
multiple programs simultaneously without affecting performance. This is essential for
servers and other high-performance computing systems.
7. Command Line Interface: Linux has a powerful command line interface that allows users
to perform a wide range of tasks quickly and efficiently. This is essential for system
administrators and developers who need to automate tasks or perform complex
operations.
8. Package Management: Linux has a package management system that makes it easy to
install, update, and remove software. Users can choose from a wide range of software
packages that are available in online repositories.
Linux has several features in its scheduling system that allow it to efficiently allocate CPU
resources among competing processes. Here are some of the key features of Linux in scheduling:
1. Completely Fair Scheduler (CFS): The CFS is the default scheduling algorithm in Linux,
and it provides fair allocation of CPU time among all running processes. The CFS uses a
virtual runtime mechanism to ensure that each process gets its fair share of CPU time.
2. Real-time scheduling: Linux also supports real-time scheduling for processes that require
deterministic timing behavior. The real-time scheduler provides high-priority processes
with guaranteed access to the CPU, even when other processes are running.
3. Process priorities: Linux assigns each process a priority value that determines how much
CPU time it receives. The priority value ranges from -20 to 19, with -20 being the highest
priority and 19 being the lowest.
5. Kernel preemption: Linux has a preemptive kernel that can preempt running processes in
favor of higher-priority processes. This ensures that critical processes get the CPU time
they need.
6. Load balancing: Linux uses load balancing algorithms to distribute processes across CPU
cores, ensuring that each core is utilized efficiently.
Overall, Linux’s scheduling features make it a powerful operating system for multi-tasking and
real-time applications.
about 1982 by Alfred Chao, and developed/marketed for the first part of its life by his
• In the 1980s pSOS rapidly became the RTOS of choice for all embedded systems based
on the Motorola 68000 family architecture, because it was written in 68000 assembler
• It was also modularised, with early support for OS-aware debugging, plug-in device
drivers, TCP/IP stacks, language libraries and disk subsystems. Later came source-
• Since it was establish for use in small to middle sized embedded applications, PSOS Does
not support virtual memory but supports digressive memory superintendence instead
• Hence it defines a memory region as a physically bordering memory block that is designed
• PSOS is widely used in embedded applications and is a host target type of RTOS
• It isused in numerous commercial embedded products like cell phone system base
stations
• . It supports priority ceiling protocols and inheritance for sharing critical resources
• FEATURES
• Preemptive multitasking:pSOS supports preemptive multitasking, which means that the
operating system can switch between different tasks without the need for explicit
cooperation from the tasks themselves. This allows for more efficient use of system
resources and can help ensure that critical tasks are completed on time.
• Memory management:pSOS provides memory management features that allow tasks to
allocate and free memory dynamically. This helps to prevent memory fragmentation and
can improve the reliability and stability of the system.
• Task synchronization:pSOS provides several mechanisms for tasks to synchronize with
each other, such as semaphores, message queues, and event flags. These mechanisms
help to prevent race conditions and ensure that tasks can cooperate effectively.
• Interrupt handling:pSOS provides a flexible interrupt handling mechanism that allows
interrupt service routines (ISRs) to be written in C or assembly language. This allows
developers to write efficient ISRs that can respond quickly to system events.
• Low overhead:pSOS has a small memory footprint and low overhead, making it suitable
for use in resource-constrained embedded systems.
• ARCHITECTURE
• PSOS+ Real-time Multitasking Kernel: A multitasking kernel that provides a
responsive, efficient mechanism for coordinating the activities of your real-time system.
• PSOS+ Multiprocessor Multitasking Kernel: to operate seamlessly across multiple,
tightly-coupled or distributed processors.
•
•
APPLICATION
• As an application example, let's take the pSOS+m operating system-the name denotes
processor.
videophones, video editing system s, digital TV, security systems and set-top boxes to
• The VLIW processor is a fluid computer system controlled by the real-time kernel of the
• Aside from the DSP CPU core, the VLIW processor includes a high-bandwidth internal
• The pSOS+m kernel views applications as a collection of tasks, I/O device drivers
• These system calls provide functionality for task management, semaphores, message
queues, dynamic memory allocation, time management, I/O functions, event macros,
• Services provided by pSOS form the basis of the Trimedia Software Streaming
Architecture.
• The kernel provides the syst em designer with concurrent and independent task execution
by switching between tasks on queues generated by system calls made to the kernel.
Overall, VRTX is a reliable and efficient real-time operating system that provides a range of
features and capabilities for real-time applications. Its ability to multitask, provide memory
protection, and support various hardware platforms makes it a popular choice in many industries.
ARCHITECTURE OF THE VERSATILE REAL-TIME EXECUTIVE
The architecture of the Versatile Real-Time Executive (VRTX) can be divided into two main
components: the kernel and the optional modules.
The VRTX kernel provides the basic services required by real-time applications, including task
scheduling, inter-task communication, synchronization, and interrupt handling. The kernel is
responsible for managing the execution of tasks and ensuring that they have access to the system
resources they need. It does this by maintaining a list of all tasks that are currently active and
scheduling them based on their priority levels.
VRTX also includes a set of device drivers that allow it to interact with external devices such as
disk drives, printers, and displays. These drivers provide an interface between the VRTX kernel
and the hardware, allowing tasks to access external resources as needed.
• Here RTLinux is a Hard Real-Time Operating System Microkernel that runs the
The Real-Time Kernel set the Linux is working on a Linux system. RTLinux is hard
real-time RTOS a microkernel that runs the entire Linux operating system as a fully
preemptive process.
It was developed by Victor Yodaiken, Free version Michael Barabanov and others at the
New Mexico Institute of Mining and Technology and then as a commercial product at
FSMLabs.
FSMLabs has two editions of RTLinux.
RTLinux pro and RTLinux free. RTLinux pro is the priced edition and RTLinux is the
open source release.
RTLinux support hard real time applications, the Linux kernel has been modified by
adding a layer of software between the hardware and the Linux kernel. This additional
layer is called "virtual machine".
A foot print of 4MB is required RTLinux.
The new layer, RTLinux layer has a separate task scheduler. This task scheduler assigns
lowest priority to the standard Linux kernel. Any task that has to met real-time
constraints will run under RTLinux.
Interrupts from Linux are disabled to achieve real-time performance.
The tasks, which do not have any Any task that has real-time
time constraints. constraints will run under RTLinux.
RTLINUX MODULES
RTLinux programs are not created as stand-alone units, they are created as modules,
which are loaded into the Linux kernel space.
Applications of RT Linux:
Industrial automation: RT Linux is widely used in industrial automation systems, where
precise timing and synchronization are critical for controlling machines and processes.
Aerospace and defense: RT Linux is used in aerospace and defense applications for
controlling unmanned aerial vehicles (UAVs), weapons systems, and other critical
equipment.
Medical devices: RT Linux is used in medical devices such as heart monitors and
infusion pumps, where precise timing and synchronization are critical for patient safety.
Automotive: RT Linux is used in automotive systems for controlling engines, brakes, and
other critical systems.
Robotics: RT Linux is used in robotics for controlling the movement of robots and
coordinating multiple robots in real-time.
• Cruise control a system that takes charge of controlling the throttle(engine controlling
fuel or power) from the driver and cruising the vehicle at preset and constant speed
• Controlled cruising of car using adaptive control algorithm for continuous maintaining
When (1) road conditions are suitable (not wet or icy, or (2) there are no strong winds or
fog), or (3) car is cruising at high speed and when there is no heavy traffic.
• Using an adaptive algorithm, ACC system maintains constant speed and can be added
highway.
• An adaptive control─ algorithm used to adapt to the current status of control inputs
respectively
INPUTS
• Delay interval in reflected pulse with respect to transmitted pulse from emitter
• Brake status for brake activities from brake switch and pedal
from task_Align, aligns radar or UVHF transmitting device in the lane of the front-
end car
• Port_ReadRange─ for measuring front end-car range. Time difference deltaT is read
computations of deltaT between the transmission and reception instances. deltaT 1.5
× 105 measures the range rangeNow (=present range or front-car distance d) of the front-
end car.
Port_range rate
and speedNow to all other streaming cars.It sends signal to Port_speed to display
signal.The service routine disables at the beginning and enables the interrupts on exiting
PERIPHERALS
activation
• Alarms and message flashing unit issues appropriate alarms and message flashing
pictograms
FUNCTIONS
• Cruise control system takes charge of controlling the throttle position from the driver
and enables the cruising of the vehicle at the preset constant speed.
situations.
• An alignment circuit aligns the radar emitter.When driving in a hilly area, the emitter
alignment is must. A stepper motor aligns the attachment so that transmitter beam of
radar emits with the required beam alignment for the given driving lane and divergence
so maintain the in-lane line of sight of the front-end car. task_Align does this function.
• Transmit modulated pulses emit at periodic intervals and the delay period in receiving
its reflection from front-end vehicle.The measured delay deltaT at periodic intervals
deltaT multiplied by 1.5 × 108 m/s (half of light velocity) gives the computed distance
• The brake control when the safe distance is not maintained and warning message is
• When battery power becomes low, the ACC system deactivates after issuing alarm
• Get acceleration from engine speed section within the DAS unit
• Send outputs to pedal system for applying emergency brakes and driver non-intervention
• Run an adaptive algorithm to calculate and send the control signals to the stepper motor
• Retreive front end car distance information from a radar or UVHF attacthment at the
HARDWARE
APPLICATIONS
Written in 'C'
Function Description
OSTaskCreate() ---->Create and make a task ready for execution
OSTaskCreateEx() --->Enhanced version of OSTaskCreate()
OSTaskStkCheck()--->Checks stack overflow
OSTimeDly() -------->Delay the task for specific c duration
OSTaskNameGet() --> Returns name associated with a task
OSTaskNameSet() --->Sets the name for a task. Task is identified
using priority
OSTaskQuery()-------->Retrieves information about a task in Task Control Block
OSTaskSuspend()--->Suspends or blocks execution of a task
OSTaskResume()---->Resumes a suspended task
Kernel needs to be initialised and started before executing the user tasks.
Idle task is the lowest priority task under the MicroC/OS-II kernel and is executed to
keep the CPU always busy when there are no user tasks.
Kernel runs a statistical task for computing the percentage of CPU usage
3. Task Scheduling
Four highest priority and four lowest priorities are reserved for the kernel
When kernel starts, it executes the first available highest priority task
▫ Interrupt occurs
Task level shedulingis executed by the kernel service OS_Sched() when a system call
Occurs
ISR level is done by OSIntExit() - notifies kernel that ISR is complete and kernel checks
whether there is any high priority task is ready
'Clock Tick' is the time source for providing timing reference for time delays and timeouts
7. Memory Management
8. Interrupt Handling