Embedded Systems • Unit V

RTOS, Supporting Technologies and Case Studies

Complete RGPV exam-oriented notes on normal OS versus RTOS, scheduling algorithms, TinyOS, VxWorks, QNX, VLSI technology, device drivers and practical embedded-system case studies.

Start Unit 5 Notes

1. Embedded System Supporting Technologies

Supporting technologies are the hardware and software technologies that help an embedded system perform real-time control, communication, computation, interfacing and application-specific functions.

Main Supporting Technologies

  • Real-Time Operating Systems
  • Task scheduling
  • VLSI and integrated-circuit technology
  • Device drivers
  • Embedded software development tools
  • Communication interfaces
  • Application-specific hardware

2. Operating System in Embedded Systems 7 Marks

An operating system is system software that manages processor time, memory, devices, files and program execution.

Major Functions

  • Process and task management
  • Memory management
  • Device management
  • Interrupt handling
  • Resource sharing
  • Communication and synchronization
  • File management where required
Applications / Tasks | v +----------------------+ | Operating System | | Scheduler | | Memory Manager | | Device Manager | | Interrupt Handling | +----------+-----------+ | v Hardware Resources

3. Real-Time Operating System 14 Marks

A Real-Time Operating System is an operating system designed to provide predictable and bounded response times so that time-critical tasks can meet their deadlines.

Main Characteristics

  • Deterministic behavior
  • Fast interrupt response
  • Priority-based scheduling
  • Low context-switch time
  • Predictable latency
  • Task synchronization
  • Reliable inter-task communication
  • Small memory footprint in embedded systems

Types of Real-Time Systems

  • Hard real-time: Missing a deadline may cause system failure.
  • Firm real-time: A late result has no useful value, though occasional misses may be tolerated.
  • Soft real-time: Deadline misses reduce quality but do not cause total failure.
Airbag control is hard real-time, industrial inspection may be firm real-time, and multimedia playback is usually soft real-time.

4. Difference Between Normal OS and RTOS 14 Marks

FeatureNormal Operating SystemRTOS
Main objectiveHigh throughput and user conveniencePredictable timing and deadline satisfaction
Response timeMay varyBounded and deterministic
SchedulingFairness and throughput orientedPriority and deadline oriented
Interrupt latencyMay be comparatively higherLow and predictable
Context switchingNot always time criticalFast and bounded
Deadline guaranteeNot guaranteedDesigned to meet deadlines
Memory usageUsually largerOften optimized for small systems
ApplicationsDesktop, office and general computingAutomotive, medical, industrial and aerospace systems
ExamplesDesktop-oriented operating systemsVxWorks, QNX and other embedded RTOS products
The main difference is that a normal operating system aims to provide good average performance, while an RTOS aims to guarantee correct operation within specified time limits.

5. Important Real-Time Terms 7 Marks

  • Deadline: Latest time by which a task must finish.
  • Release time: Time at which a task becomes ready.
  • Execution time: Processor time required by a task.
  • Period: Time interval between repeated releases of a periodic task.
  • Response time: Time from task release to task completion.
  • Latency: Delay before the system responds to an event.
  • Jitter: Variation in timing or response delay.
  • Determinism: Ability to predict maximum timing behavior.
Response Time = Completion Time − Release Time

6. Tasks, Threads and Task States 14 Marks

A task is an independently scheduled unit of execution in an RTOS.
dispatch +-------+ -----------> +---------+ | Ready | | Running | +---+---+ <----------- +----+----+ ^ preempt | | | waits for event | event occurs v +------------------- +--------+ |Blocked | +--------+

Common Task States

  • Ready: Waiting for CPU time.
  • Running: Currently executing.
  • Blocked: Waiting for an event or resource.
  • Suspended: Temporarily removed from scheduling.
  • Terminated: Execution has finished.

Context Switch

A context switch saves the state of the current task and restores the state of another task.

7. Scheduling Algorithms 14 Marks

Scheduling is the process of selecting which ready task should execute next on the processor.

Scheduling Objectives

  • Meet task deadlines
  • Reduce response time
  • Improve processor utilization
  • Provide fairness
  • Reduce context-switch overhead
  • Avoid starvation

Classification

  • Preemptive and non-preemptive scheduling
  • Static-priority and dynamic-priority scheduling
  • Time-triggered and event-triggered scheduling

8. First Come First Served Scheduling 7 Marks

FCFS schedules tasks in the order in which they arrive.

Advantages

  • Simple implementation
  • Low scheduling overhead
  • Fair according to arrival order

Disadvantages

  • Poor response for short urgent tasks
  • Convoy effect
  • Not suitable for strict real-time deadlines

9. Shortest Job First Scheduling 7 Marks

SJF selects the task with the smallest expected execution time.

Advantages

  • Low average waiting time under ideal conditions
  • Good throughput for short jobs

Disadvantages

  • Execution time must be known or estimated
  • Long tasks may suffer starvation
  • Not directly deadline oriented

10. Priority Scheduling 14 Marks

In priority scheduling, the highest-priority ready task executes first.

Preemptive Priority Scheduling

A newly arrived higher-priority task can interrupt the currently running lower-priority task.

Advantages

  • Quick response to urgent events
  • Commonly used in RTOS
  • Simple real-time task classification

Disadvantages

  • Low-priority tasks may starve
  • Priority inversion may occur
  • Incorrect priorities can reduce system performance

11. Round Robin Scheduling 7 Marks

Round Robin gives each ready task a fixed time quantum in cyclic order.

Task A -> Task B -> Task C -> Task A -> ... Each task receives one time quantum.

Advantages

  • Fair processor sharing
  • Suitable for equal-priority tasks
  • Prevents one task from holding the CPU indefinitely

Limitations

  • Very small quantum causes high switching overhead
  • Large quantum behaves like FCFS
  • Deadline guarantee is difficult without further control

12. Rate Monotonic Scheduling 14 Marks

Rate Monotonic Scheduling is a fixed-priority real-time scheduling algorithm in which a task with a shorter period receives a higher priority.

Rules

  • Priorities are assigned before execution.
  • Shorter-period task gets higher priority.
  • Tasks are assumed to be periodic.
  • Preemptive execution is commonly used.

Advantages

  • Simple static-priority implementation
  • Predictable behavior
  • Widely studied for periodic tasks

Limitations

  • Less flexible than dynamic-priority methods
  • Assumptions may not match all practical systems
  • Processor utilization must be analyzed

13. Earliest Deadline First Scheduling 14 Marks

Earliest Deadline First is a dynamic-priority algorithm in which the ready task with the nearest absolute deadline executes first.

Working

  1. Each ready task has a deadline.
  2. The scheduler compares current deadlines.
  3. The task with the earliest deadline is selected.
  4. Priorities may change whenever tasks arrive or finish.

Advantages

  • Efficient processor utilization
  • Directly considers deadlines
  • Flexible for different task periods

Limitations

  • More runtime scheduling overhead
  • Behavior can become difficult under overload
  • Requires careful deadline management

14. Priority Inversion 14 Marks

Priority inversion occurs when a high-priority task is forced to wait because a low-priority task holds a required shared resource.
Low Task L holds Resource R | High Task H requests R and blocks | Medium Task M preempts L | H waits indirectly for M and L

Solutions

  • Priority inheritance: Low-priority task temporarily inherits the higher priority.
  • Priority ceiling: Shared resources are assigned a ceiling priority.
  • Short critical sections
  • Careful resource design

15. Case Study: TinyOS 14 Marks

TinyOS is a lightweight operating system designed for resource-constrained wireless sensor-network devices.

Main Features

  • Small memory footprint
  • Event-driven architecture
  • Component-based design
  • Designed for low-power sensor nodes
  • Supports asynchronous events
  • Suitable for distributed sensing applications
Application Components | v +--------------------+ | TinyOS Components | | Events and Tasks | +---------+----------+ | v Sensor Node Hardware

Execution Model

  • Events represent urgent asynchronous occurrences.
  • Tasks are deferred computations.
  • Tasks normally execute to completion.
  • The design helps reduce memory and power usage.

Applications

  • Environmental monitoring
  • Wireless sensor networks
  • Agricultural sensing
  • Building automation

16. Case Study: VxWorks 14 Marks

VxWorks is a commercial real-time operating system used in reliable and time-critical embedded applications.

Main Features

  • Preemptive priority-based scheduling
  • Multitasking
  • Fast interrupt handling
  • Inter-task communication
  • Networking support
  • Device-driver framework
  • Real-time development and debugging support
  • High reliability

Typical Applications

  • Aerospace systems
  • Industrial automation
  • Telecommunication equipment
  • Robotics
  • Safety-critical control systems

Advantages

  • Mature real-time capabilities
  • Strong tool support
  • Suitable for complex embedded products

Limitation

It is a commercial platform and may involve higher cost and complexity than small open-source embedded operating systems.

17. Case Study: QNX 14 Marks

QNX is a real-time operating system based on a microkernel architecture.
Applications | System Services / Drivers | +----------------------+ | QNX Microkernel | | Scheduling | | IPC | | Interrupt Handling | +----------+-----------+ | v Hardware

Microkernel Concept

Only essential services such as scheduling, interrupt handling and inter-process communication run in the kernel. Other services execute as separate processes.

Main Features

  • Microkernel architecture
  • Message-based inter-process communication
  • Process isolation
  • Real-time scheduling
  • Modularity
  • Fault containment
  • Good support for distributed systems

Applications

  • Automotive infotainment
  • Industrial systems
  • Medical systems
  • Transportation systems
  • Networked embedded platforms

18. TinyOS vs VxWorks vs QNX 14 Marks

FeatureTinyOSVxWorksQNX
Main targetSensor nodesComplex real-time embedded systemsReliable modular real-time systems
ArchitectureEvent-driven component modelRTOS kernel with rich servicesMicrokernel
Resource requirementVery lowModerate to high depending on configurationModerate
StrengthLow power and small footprintMature real-time performance and toolsIsolation and fault containment
Typical useWireless sensor networksAerospace, industrial and telecomAutomotive, medical and transportation

19. Overview of VLSI Technology 14 Marks

VLSI stands for Very Large Scale Integration. It is the technology of integrating a very large number of transistors and electronic components onto a single integrated circuit.

Importance in Embedded Systems

  • Reduces system size
  • Improves speed
  • Reduces power consumption
  • Improves reliability
  • Reduces manufacturing cost for large production
  • Enables processors, memory and peripherals on one chip

Levels of Integration

  • SSI – Small Scale Integration
  • MSI – Medium Scale Integration
  • LSI – Large Scale Integration
  • VLSI – Very Large Scale Integration

Applications

  • Microprocessors
  • Microcontrollers
  • System-on-Chip devices
  • DSP processors
  • Memory chips
  • ASICs

20. Basic VLSI Design Flow 14 Marks

System Specification | v Architecture Design | v Logic / RTL Design | v Functional Verification | v Synthesis | v Physical Design | v Fabrication | v Testing and Packaging

Steps

  1. Specification: Define required functions, speed, power and area.
  2. Architecture: Divide the system into hardware blocks.
  3. Logic design: Describe logic behavior.
  4. Verification: Check whether design meets specification.
  5. Synthesis: Convert design into gates.
  6. Physical design: Placement and routing.
  7. Fabrication: Manufacture the chip.
  8. Testing: Check manufactured devices.

ASIC and SoC

  • ASIC: Integrated circuit designed for a specific application.
  • SoC: Processor, memory, peripherals and interfaces integrated on one chip.

21. Introduction to Device Drivers 14 Marks

A device driver is software that controls a hardware device and provides a standard interface between the operating system or application and that device.
Application | v Operating System / RTOS | v Device Driver | v Hardware Device

Functions of a Device Driver

  • Initialize hardware
  • Configure device registers
  • Read and write data
  • Handle interrupts
  • Control DMA transfers
  • Manage device errors
  • Provide application-level functions

Typical Driver Operations

  • Open or initialize
  • Close or shutdown
  • Read
  • Write
  • Control or configure
  • Interrupt service

Advantages

  • Hardware abstraction
  • Code reusability
  • Easy system maintenance
  • Portability of application software

22. Types and Structure of Device Drivers 14 Marks

Driver Types

  • Character driver: Transfers data as a stream of bytes.
  • Block driver: Transfers data in blocks.
  • Network driver: Controls network interfaces.
  • Sensor driver: Reads and configures sensors.
  • Display driver: Controls display hardware.

Driver Development Steps

  1. Study device datasheet.
  2. Identify hardware registers and signals.
  3. Initialize clocks and pins.
  4. Configure the device.
  5. Implement read, write and control functions.
  6. Implement ISR if interrupts are used.
  7. Handle errors and timeouts.
  8. Test normal and failure conditions.
A poorly written driver may cause data loss, incorrect timing, crashes or unsafe hardware operation.

23. Embedded System Case Studies

The following case studies show how sensors, controllers, memory, actuators, communication and software logic work together in practical embedded products.

24. Case Study: Washing Machine 14 Marks

An automatic washing machine is a real-time embedded control system that performs washing, rinsing and spinning according to a selected program.
User Keys / Program Selection | v +--------------------------+ | Embedded Controller | | Program Logic | | Timer | | Safety Monitoring | +----+------+-------+------+ | | | v v v Water Motor Heater Valve Drive ^ | Water Level / Door / Temperature Sensors

Inputs

  • Program selection buttons
  • Door sensor
  • Water-level sensor
  • Temperature sensor
  • Load or imbalance sensor

Outputs

  • Water inlet valve
  • Drain pump
  • Drum motor
  • Heater
  • Display and buzzer
  • Door-lock actuator

Operation Sequence

  1. User selects the washing program.
  2. Controller checks whether the door is closed.
  3. Water inlet opens until required water level is reached.
  4. Heater may warm the water.
  5. Motor rotates the drum according to wash cycle.
  6. Dirty water is drained.
  7. Rinsing cycle is performed.
  8. High-speed spinning removes water.
  9. Buzzer or display indicates completion.

Safety Features

  • Door lock during operation
  • Overflow prevention
  • Motor overload protection
  • Imbalance detection
  • Timeout and fault indication

25. Case Study: Air-Conditioning System 14 Marks

An embedded air-conditioning system senses room conditions and controls cooling components to maintain the selected temperature.
Temperature / Humidity Sensor | v +--------------------------+ | Embedded Controller | | Control Algorithm | | Timer and Protection | +----+--------+--------+---+ | | | v v v Compressor Fan Display | v Cooling System

Inputs

  • Temperature sensor
  • Humidity sensor where available
  • Remote-control receiver
  • User buttons
  • Current and pressure protection sensors

Outputs

  • Compressor relay or inverter drive
  • Indoor and outdoor fans
  • Air-direction motor
  • Display
  • Buzzer

Working

  1. User sets the required temperature and mode.
  2. Sensor measures current room temperature.
  3. Controller compares measured and set temperatures.
  4. Compressor and fan are controlled accordingly.
  5. When the room reaches the desired level, cooling is reduced or stopped.
  6. Protection logic prevents unsafe compressor operation.

Control Considerations

  • Hysteresis prevents frequent ON-OFF switching.
  • Delay protects the compressor during restart.
  • Fan speed may depend on temperature error.
  • Inverter systems vary motor speed for efficient control.

26. Case Study: Autofocus Camera 14 Marks

An autofocus camera uses sensors, image-processing logic and a motorized lens mechanism to automatically obtain a sharp image.
Image / Focus Sensor | v +----------------------+ | Embedded Processor | | Focus Evaluation | | Control Algorithm | +----------+-----------+ | v Lens Motor Driver | v Lens Movement | +---- Feedback Loop ----+

Main Components

  • Image sensor or focus sensor
  • Embedded processor
  • Lens-position sensor
  • Motor driver
  • Lens actuator
  • Memory
  • User shutter input

Working

  1. The user presses the shutter button halfway.
  2. The camera captures focus information.
  3. The processor calculates a focus measure.
  4. The lens motor moves the focusing element.
  5. The sensor checks whether sharpness has improved.
  6. The process repeats until best focus is obtained.
  7. Focus lock is indicated.
  8. The image is captured when the shutter is fully pressed.

Autofocus Methods

  • Contrast detection: Searches for the lens position with maximum image contrast.
  • Phase detection: Estimates direction and amount of focus correction.

Embedded-System Requirements

  • Fast response
  • Accurate motor control
  • Low power consumption
  • Real-time image analysis
  • Reliable feedback

Unit 5 Quick Revision

  • A normal OS focuses on average performance, while an RTOS focuses on predictable deadlines.
  • Hard real-time systems cannot tolerate deadline misses.
  • Priority scheduling is common in RTOS.
  • Rate Monotonic assigns higher priority to shorter-period tasks.
  • EDF selects the task with the nearest deadline.
  • Priority inversion occurs when a high-priority task waits for a lower-priority task.
  • TinyOS is lightweight and event driven.
  • VxWorks is used in complex real-time systems.
  • QNX uses a microkernel architecture.
  • VLSI integrates many transistors on one chip.
  • A device driver connects software with hardware.
  • A washing machine controls water, drum, heater and safety sensors.
  • An air conditioner controls compressor and fan using temperature feedback.
  • An autofocus camera controls lens position using focus feedback.

Important RGPV Exam Questions

Long Answer Questions

  1. Differentiate between a normal operating system and an RTOS.
  2. Explain characteristics and types of real-time systems.
  3. Explain task states and context switching in an RTOS.
  4. Explain scheduling algorithms used in embedded systems.
  5. Explain preemptive priority scheduling and its advantages.
  6. Explain Rate Monotonic Scheduling.
  7. Explain Earliest Deadline First scheduling.
  8. What is priority inversion? Explain methods to solve it.
  9. Explain TinyOS architecture and features.
  10. Write a detailed note on VxWorks.
  11. Explain QNX microkernel architecture.
  12. Compare TinyOS, VxWorks and QNX.
  13. Explain VLSI technology and its importance in embedded systems.
  14. Explain the basic VLSI design flow.
  15. What is a device driver? Explain its functions and structure.
  16. Explain the embedded-system design of an automatic washing machine.
  17. Explain the embedded-system design of an air-conditioning system.
  18. Explain the embedded-system design of an autofocus camera.

Short Answer Questions

  1. Define RTOS.
  2. What is deterministic behavior?
  3. Define response time and jitter.
  4. What is preemptive scheduling?
  5. Define Rate Monotonic Scheduling.
  6. What is EDF scheduling?
  7. Define priority inversion.
  8. State two features of TinyOS.
  9. What is a microkernel?
  10. Define VLSI.
  11. What is a device driver?
  12. List two sensors used in a washing machine.
Exam Tip: For 14-mark answers, always include definition, labeled diagram, working steps, features, advantages, limitations and applications.

Download Study Resources

Unit 5 PDF

Printable detailed notes will be available soon.

Coming Soon

Case Study Diagrams

Exam-ready diagrams will be available soon.

Coming Soon

PYQ Analysis

Repeated Unit 5 questions will be added soon.

Coming Soon

Frequently Asked Questions

A normal OS focuses on good average performance, while an RTOS focuses on predictable response and completion within deadlines.
In a hard real-time system, missing a deadline may cause unacceptable failure or unsafe operation.
A task with a shorter period receives a higher fixed priority.
TinyOS is mainly designed for resource-constrained wireless sensor nodes and low-power sensing applications.
It controls hardware and provides a standard software interface to applications or the operating system.
The camera uses focus or image-sharpness information to decide how the lens motor should move.