Real Time Systems Ques & Ans
Real Time Systems Ques & Ans
Ans: - Real-time operating systems are used in environments where a large number of events, mostly
external to the computer system, must be accepted and processed in a short time or within certain
deadlines. Such applications are industrial control, telephone switching equipment, flight control, and
real-time simulations. With an RTOS, the processing time is measured in tenths of seconds. This system
is time-bound and has a fixed deadline. The processing in this type of system must occur within the
specified constraints. Otherwise, this will lead to system failure. Examples of real-time operating
systems are airline traffic control systems, Command Control Systems, airline reservation systems, Heart
pacemakers, Network Multimedia Systems, robots, etc.
Hard real time operating system: A hard real-time system has absolute deadlines, and if those
allotted time spans are missed, a system failure will occur. For example a robot is hired to weld a
car body. If the robot welds too early or too late, the car cannot be sold, so it is a hard real-time
system that requires complete car welding by the robot hardly on time., scientific experiments,
medical imaging systems, industrial control systems, weapon systems, robots, air traffic control
systems, etc.
Soft real time operating system: Soft real-time is when a system continues to function even if
it's unable to execute within an allotted time. If the system has missed its deadline, it will not
result in critical consequences. The system can continue to function, though with undesirable
lower quality of output. For example Multimedia systems, digital audio systems etc.
Firm real time operating system: RTOS of this type have to follow deadlines as well. In spite of
its small impact, missing a deadline can have unintended consequences, including a reduction in
the quality of the product. Example: Multimedia applications.
Q3) what is the primary difference between a general purpose and real time operating system?
Ans: - RTOS and GPOS serve different purposes in computing. While GPOS is designed to handle a wide
range of tasks for multiple applications, RTOS focuses on real-time responses and precise timing. One
key difference between RTOS and GPOS lies in their scheduling algorithms. RTOS prioritizes time-critical
tasks to ensure they are executed within strict deadlines, while GPOS uses preemptive multitasking to
allocate processor time among various processes. Another distinction is that RTOS offers deterministic
behavior, meaning it guarantees predictable response times. In contrast, GPOS may experience
occasional delays due to its focus on optimizing resource utilization across multiple applications.
Q4) what are the characteristics of real time operating system?
Time Constraints: Time constraints related with real-time systems simply means that time
interval allotted for the response of the ongoing program. This deadline means that the task
should be completed within this time interval. Real-time system is responsible for the
completion of all tasks within their time intervals.
Correctness: Correctness is one of the prominent parts of real-time systems. Real-time systems
produce correct result within the given time interval. If the result is not obtained within the
given time interval then also result is not considered correct. In real-time systems, correctness
of result is to obtain correct result in time constraint.
Embedded: All the real-time systems are embedded now-a-days. Embedded system means that
combination of hardware and software designed for a specific purpose. Real-time systems
collect the data from the environment and passes to other components of the system for
processing.
Safety: Safety is necessary for any system but real-time systems provide critical safety. Real-
time systems also can perform for a long time without failures. It also recovers very soon when
failure occurs in the system and it does not cause any harm to the data and information.
Concurrency: Real-time systems are concurrent that means it can respond to a several number
of processes at a time. There are several different tasks going on within the system and it
responds accordingly to every task in short intervals. This makes the real-time systems
concurrent systems.
Distributed: In various real-time systems, all the components of the systems are connected in a
distributed way. The real-time systems are connected in such a way that different components
are at different geographical locations. Thus all the operations of real-time systems are operated
in distributed ways.
Stability: Even when the load is very heavy, real-time systems respond in the time constraint i.e.
real-time systems does not delay the result of tasks even when there are several task going on a
same time. This brings the stability in real-time systems.
Fault tolerance: Real-time systems must be designed to tolerate and recover from faults or
errors. The system should be able to detect errors and recover from them without affecting the
system’s performance or output.
Determinism: Real-time systems must exhibit deterministic behavior, which means that the
system’s behavior must be predictable and repeatable for a given input. The system must
always produce the same output for a given input, regardless of the load or other factors.
Real time communication: Real-time systems often require real-time communication between
different components or devices. The system must ensure that communication is reliable, fast,
and secure.
Resource management: Real-time systems must manage their resources efficiently, including
processing power, memory, and input/output devices. The system must ensure that resources
are used optimally to meet the time constraints and produce correct results.
Heterogeneous environment: Real-time systems may operate in a heterogeneous environment,
where different components or devices have different characteristics or capabilities. The system
must be designed to handle these differences and ensure that all components work together
seamlessly.
Scalability: Real-time systems must be scalable, which means that the system must be able to
handle varying workloads and increase or decrease its resources as needed.
Security: Real-time systems may handle sensitive data or operate in critical environments, which
make security a crucial aspect. The system must ensure that data is protected and access is
restricted to authorized users only.
Ans: - A real-time system means that the system is subjected to real-time, i.e., the response should be
guaranteed within a specified timing constraint or the system should meet the specified deadline. For
example flight control systems, real-time monitors, etc.
Ans: - Priority inversion is a bug that occurs when a high priority task is indirectly preempted by a low
priority task. For example, the low priority task holds a mutex that the high priority task must wait for to
continue executing. In the simple case, the high priority task (Task H) would be blocked as long as the
low priority task (Task L) held the lock. This is known as “bounded priority inversion,” as the length of
time of the inversion is bounded by however long the low priority task is in the critical section (holding
the lock).
Ans: - In computer programming, a mutual exclusion (mutex) is a program object that prevents multiple
threads from accessing the same shared resource simultaneously.
Q8) how does real time operating system handle interrupt service routines?
Ans: - On a microprocessor system, an interrupt is a signal from hardware or software that needs
immediate attention. The Task that is running must save its state on its stack and control passes to an
Interrupt Service Routine (ISR) to handle the interrupt. Once the ISR is completed the state that was
saved on the stack is used to resume normal operations.
Q9) describe the term jitter in context of real time operating system.
Ans: - The amount of error in the timing of a task over subsequent iterations of a program or loop is
referred to as jitter. Real-time operating systems are optimized to provide a low amount of jitter when
programmed correctly; a task will take very close to the same amount of time to execute each time it is
run.
Q10) explain the term context switch in real time operating system.
Ans: - Context Switching involves storing the context or state of a process so that it can be reloaded
when required and execution can be resumed from the same point as earlier. This is a feature of a
multitasking operating system and allows a single CPU to be shared by multiple processes.
Q11) explain the architecture of real time operating system. Discuss its main components and how
they interact to manage real time task.
Ans: - A real-time operating system (RTOS) is designed to handle tasks with specific timing constraints.
Its architecture is tailored to prioritize tasks based on their deadlines and ensure that they meet real-
time requirements. Here's a breakdown of its main components and how they interact:
1. Kernel: The core component of an RTOS is the kernel, which provides essential services such as
task scheduling, interrupts handling, and resource management. The kernel manages the
execution of tasks and ensures that they meet their deadlines.
2. Task Management: RTOS supports multiple tasks, each with its own priority and execution
requirements. Task management involves creating, scheduling, and controlling tasks. Tasks are
typically represented as threads, which are units of execution that can run concurrently.
3. Scheduler: The scheduler determines which task to execute next based on their priorities and
deadlines. There are different scheduling algorithms such as rate monotonic scheduling (RMS)
or earliest deadline first (EDF), which prioritize tasks according to their deadlines.
4. Interrupt Handling: Interrupts are signals generated by hardware devices to request attention
from the processor. In an RTOS, interrupt handling is crucial for responding to time-sensitive
events promptly. The kernel must handle interrupts efficiently to minimize the delay in servicing
critical tasks.
5. Resource Management: RTOS manages system resources such as memory, CPU time, and
peripherals. It ensures that tasks have access to the resources they need while preventing
conflicts and resource contention.
6. Clock Management: Real-time tasks often rely on precise timing. The RTOS provides
mechanisms for managing system time and providing accurate timestamps for scheduling and
synchronization.
These components interact closely to manage real-time tasks effectively. The kernel schedules tasks
based on their priorities and deadlines, ensuring that critical tasks are executed on time. Interrupts are
handled promptly to respond to time-sensitive events, and resources are managed efficiently to prevent
bottlenecks. Communication mechanisms allow tasks to coordinate their actions and exchange data in a
real-time manner, enabling the system to meet its timing requirements. Overall, the architecture of an
RTOS is designed to provide a predictable and deterministic execution environment for real-time
applications.
Q12) discuss the different types of scheduling algorithm use in real time operating system. Provide
example of each and explain their advantage and disadvantage.
Q13) analyze the impact of context switching affects system performance. What strategy to be used
to minimize its overload.
Ans: - Context Switching involves storing the context or state of a process so that it can be reloaded
when required and execution can be resumed from the same point as earlier. This is a feature of a
multitasking operating system and allows a single CPU to be shared by multiple processes.
The whole process is computationally intensive, and the more context switches that occur, the slower
the system becomes. This is because each context switch involves saving the current state of the CPU,
loading the state of the new process or thread, and then resuming execution of the new process or
thread.
To minimize its overload facilitate using of "Do Not Disturb" modes during meetings and deep work
periods and batch process notifications at specific times of the day. This allows for extended periods of
uninterrupted work. Reducing notifications will result in improved concentration and longer periods of
deep work.
Q14) discuss the role and importance of interrupt handling in real time operating system. How a real
time operating system insures that critical interrupt is handled in timely manner and what are the
challenges.
Ans: - An operating system usually has some code that is called an interrupt handler. The interrupt
handler prioritizes the interrupts and saves them in a queue if more than one is waiting to be handled.
The operating system has another little program called a scheduler that figures out which program to
control next. The system prioritizes critical tasks over non-critical ones and employs mechanisms
like priority inversion avoidance and deadline monitoring. This ensures that time-critical operations
receive the necessary resources and are executed without delays or interruptions.
Interrupt handling is critical for the real-time responsiveness and deterministic behavior of RTOS.
Ensuring timely handling of critical interrupts involves prioritization, efficient interrupt service routines,
latency analysis, and addressing various challenges related to interrupt handling overhead, priority
inversion, and concurrency management.