Introduction To Real-Time Operating Systems
Introduction To Real-Time Operating Systems
• Over the years, many OS evolved ranging from GPOS such as UNIX,
WINDOWS to smaller and more compact RTOS such as VXWorks
• In 60s, 70s when mainframe computing was in its prime, UNIX was
facilitating multi-users to access expensive and limited available computing
systems
• Processes are similar to tasks in a way that they can also independently
compete for execution time, with better memory protection feature at the
expense of performance and memory overhead
• Tasks follow kernel’s scheduling algorithms, while ISRs are triggered to run
because of hardware interrupts
Context Switch
• Each task has its own context
• State of CPU registers required each time it is schedule to run
• Context switch occur when the scheduler switches from one task to
another
• Every time a new task is created, kernel also creates and maintains its
task control block (TCB)
• TCB contains everything a kernel needs to know about a particular task
• When task is running its context is highly dynamic, and maintained in TCB
• When task is not running, context is frozen inside its TCB
• When the kernel’s schedular determines that it needs to stop running
task1 and start running task2, it takes the following steps
• At any time RTOS is running, flow of control is passing through these three areas
• Through an application task
• Through ISR
• Through Kernel
• When a task or ISR makes a system call, flow of control passes to kernel to execute one of the system routine
provided by the kernel
• When it is time to leave the kernel, dispatcher is responsible for passing control to one of the task in user’s
application
• When a task makes a system call, dispatcher is used to exit the kernel after system calls complete
• When an ISR makes system call, dispatcher is bypassed until the ISR fully completes its execution