Académique Documents
Professionnel Documents
Culture Documents
UNIT IV
Introduction
What is RTOS?
A Real-Time Operating System (RTOS) is a computing environment that reacts to input within a specific time period
Purpose?
To handle the Deadline Time Constraints
TASK
a task is a basic unit of programming that an operating system control Depending on how the operating system defines a task in its design, this unit of programming may be an entire program or each successive invocation of a program
THREADS
A thread is a single sequence stream within in a process they are sometimes called lightweight processes
Processes Vs Threads
Similarities
Like processes threads share CPU and only one thread active (running) at a time. Like processes, threads within a processes, threads within a processes execute sequentially. Like processes, thread can create children. And like process, if one thread is blocked, another thread can run
Differences
Unlike processes, threads are not independent of one another. Unlike processes, all threads can access every address in the task . Unlike processes, thread are design to assist one other. Note that processes might or might not assist one another because processes may originate from different users.
int input;
Resources
Monitor
Keyboard buffer
Process
Thread
cout:you entered cin: input
cout: enter a number
Critical region
ISRs have the higher priorities over the RTOS functions and the tasks. An ISR should not wait for a semaphore, mailbox, message or queue message An ISR should not also wait for mutex else it has to wait for other critical section code to finish before the critical codes in the ISR can run.
ISRs in RTOS
Three alternative ways systems to respond to hardware source calls from the interrupts
- Direct Call to an ISR by interrupting - Event Message (IPC) from the ISEvent ISR Direct Call to an ISR and ISR Enter Direct Enter message
Providing easy interfacing and management functions for the network protocols Providing portability for hardware configurations Providing interoperability of applications on different networks Providing a common set of interfaces that integrates various applications and open systems
Structure of RTOS
Top-down Layers Application software Application Program Interface System software other than the one provided at the OS Hardware-OS Interface Hardware
Kernel
The OS includes certain structural units.
Kernel is also one of the structural unit It is the secured unit of an OS It operates under the supervisory mode But the application software operates in the user mode
Kernel Services in OS
Process Management
Process Creation Management of the created process(creation, activation, running, blocking, resumption, deactivation, deletion)
Memory Management
Memory Allocation Memory Management after initial allocation Managing Strategy(Fixed blocks, Dynamic Blocks, Dynamic page, Data Memory Allocation, Address relocation, Multiprocessor Memory Allocation)
Device Management
It manages physical as well as virtual devices like pipes and sockets Device mgmt. has three approaches to 3 types of drivers
Programmed I/Os by polling Interrupts from the device drivers ISR DMA operation
It has certain functions like Device detection, addtion, deletion, allocation, registration, detaching, deregistration, queue,etc
I/O Subsystems
They are the subsystems of OS device management systems It is used for the drivers to communicate with many devices which is present in the system
RTOS inserts a list of ready tasks for sequential execution Program counter changes whenever the CPU starts executing another process Worst case latency is same for each task It is calculated by summing up detection time, switching time, execution time
The Cooperative Round Robin Scheduling Using a circular queue of Ready Tasks
The RTOS defines a time slice for each task to finish If the process is not executed within the time then it is executed in the next cycle
Preemptive scheduling
In the cooperative scheduling the low priority job is executed for long time and thus making a high priority job to wait for execution Preemptive scheduling lets a pending highpriority job take resources away from a running job of lower priority.