1.
Brief History of OS
Early OS Development: Initially, computers ran with no OS; programs were manually
loaded and executed. Early operating systems were developed in the 1950s for batch
processing.
Time-Sharing Systems (1960s): Allowed multiple users to interact with the computer at
once, leading to the concept of multi-user systems.
Personal Computers (1970s-80s): OSs like UNIX, MS-DOS, and early versions of
Windows introduced personal and commercial users to computing.
Modern OS (1990s-Present): Advanced OSs like Linux, macOS, and modern Windows
versions provide GUI, multitasking, and strong networking capabilities. Mobile OSs like
Android and iOS have expanded the landscape.
2. Defining RTOS (Real-Time Operating System)
Purpose: An RTOS is designed to handle real-time applications where tasks must be
executed within strict timing constraints.
Examples: Used in embedded systems, automotive control, medical devices, and
telecommunications.
Key Feature: Deterministic scheduling—ensuring tasks complete within defined
timeframes (hard real-time) or with minimized latency (soft real-time).
3. The Scheduler
Role: The scheduler is the core of the OS that decides the execution order of tasks.
Types of Scheduling:
o Preemptive Scheduling: Tasks can be interrupted to allow higher-priority tasks
to run.
o Non-Preemptive Scheduling: Tasks run to completion before the next task starts.
In RTOS: Priority-based scheduling is often used to ensure real-time tasks meet
deadlines.
4. Objects in RTOS
Definition: RTOS objects are system-level components like tasks, semaphores, queues,
and timers that the OS manages to coordinate processes.
Purpose: These objects help manage task states, synchronization, and inter-process
communication (IPC) in real-time systems.
5. Services in RTOS
Definition: RTOS services are the set of functions provided to manage tasks, memory,
timing, and communication.
Examples: Task creation, task synchronization, memory allocation, and message
passing.
6. Characteristics of RTOS
Determinism: Predictable response times.
Reliability: Essential in safety-critical systems.
Minimal Latency: Fast context switching.
Prioritization: Real-time tasks often run based on priority.
7. Defining a Task in RTOS
Definition: A task is a basic unit of execution in RTOS, representing a specific function
or job.
Attributes: Each task has an execution state, priority level, and stack.
8. Task States and Scheduling
States: Common states include Ready, Running, Blocked, and Suspended.
Scheduling: The RTOS scheduler manages transitions between states based on priority,
time, and resource availability.
9. Task Operations
Creation: Defines and allocates resources for a task.
Suspension/Resumption: Pauses or resumes a task as needed.
Deletion: Frees resources associated with a task.
10. Structure of RTOS
Components: Typically includes a scheduler, interrupt handler, memory management,
IPC mechanisms, and timing services.
Layered Architecture: Helps organize kernel functions, drivers, and applications.
11. Synchronization in RTOS
Purpose: Coordinates tasks to avoid conflicts and ensure data integrity when accessing
shared resources.
Methods: Semaphores, mutexes, and event flags.
12. Communication and Concurrency in RTOS
Communication: Inter-process communication (IPC) mechanisms like message queues,
mailboxes, and shared memory enable task interaction.
Concurrency: Manages simultaneous task execution, enabling real-time responsiveness.
13. Defining Semaphores
Definition: A semaphore is a signaling mechanism to control access to a resource,
allowing only a specified number of tasks to access it concurrently.
Types:
o Binary Semaphore: Only two states, 0 and 1, often used as a lock.
o Counting Semaphore: Allows a set number of tasks to access a resource.
Operations:
o Wait (P Operation): Decreases the semaphore value and may block the task if
the resource is unavailable.
o Signal (V Operation): Increases the semaphore value, signaling that the resource
is available.
Use: Manages shared resources, prevents race conditions.
14. Defining Message Queue
Definition: A message queue is an IPC mechanism that stores and forwards messages
between tasks in a first-in, first-out (FIFO) manner.
States:
o Empty: No messages in the queue.
o Non-Empty: Contains one or more messages waiting to be processed.
Content and Storage: Messages are stored in the queue buffer with headers indicating
message length, type, or priority.
Operations:
o Send: Places a message in the queue.
o Receive: Retrieves a message from the queue.
Use: Message queues help decouple tasks, allowing them to communicate
asynchronously.