Professional Documents
Culture Documents
RTOS (real time operating system) is an operating system for embedded system
It performs low level operations such as servicing interrupts, managing & servicing
I/O devices (keypad, display, timers, communication ports ..), memory management,
scheduling of tasks (processes) etc.
RTOS hides system hardware from user/application.
Applications use API functions (system calls) to access RTOS services.
RTOS executes system call and return result to User application
Concept of Process & Thread
Process (or Task) :
Embedded application software can be thought of as consisting of many processes
Process is an action of execution of the program.
Process is defined by its own program code, data and stack
Process & Thread
When process is created, RTOS allocates memory space and instantiates data
structure called Process Control Block (PCB)
PCB :- Process Context (Program status word, SP, PC & other CPU registers value),
process ID, Process state, Process priority, pointers to parent and daughter process,
pointer to system resources, pointer to access permission descriptor for sharing
resources globally and with other process
Context switching
User mode (application) and Kernel mode (RTOS) processes
a process can create one or more other processes (referred to as child processes) and
these processes in turn can create child processes to form process tree.
Threads:
Threads are subunits of a process which may execute simultaneously
Process may contain multiple threads. All threads of a process run in address space of
same process.
Have their own PC, stack and registers which are private and never shared
Advantages:- reduces context switching overhead, improves responsiveness
Process & Thread
Concept of Process & Thread
RTOS schedules execution of processes
Switching processes at fast rate gives feeling of multi-processing
Process Status :- ready, running, blocked, terminated, sleeping
[A] Non Preemptive Task(Process) scheduling:
(1)Round Robin (Circular Queue):
Processes are executed sequentially from ready linked list
RTOS keeps track of currently executing process. It updates linked list upon insertion
and removal of a process. New process is inserted at the end of linked list
Circular FIFO buffer can be used to form ready list of processes
Newly ready process is inserted at the end of the queue
Ans:
>slack time of running process remains constant whereas for waiting process it decreases
Commercial RTOS
Study of features of RTOSs is necessary for choosing suitable one for specific system
Many commercial RTOSs come with development tools that facilitate real time
application development