PadhaikoAll subjects

Overview of Contemporary OS

Operating System (ENCT 254)

Open in the Padhaiko app

8.1 Windows and Linux-based OS

Contemporary general-purpose desktop and server operating systems are dominated by Microsoft Windows and Linux-based operating systems. Although both support preemptive multitasking, virtual memory, graphical and CLI interfaces, and multi-user security, they differ markedly in kernel architecture, configuration model, and licensing.

Microsoft Windows

Modern Windows (Windows 10, Windows 11, Windows Server) is built on the Windows NT architecture:

Linux-Based Operating Systems

A Linux-based OS (such as Ubuntu, Debian, Fedora, RHEL, or Arch) combines the Linux kernel with GNU system utilities, an init/service manager (systemd), a windowing system (Wayland/X11), and a package manager (apt, dnf, pacman):

AspectMicrosoft WindowsLinux-Based OS
Kernel ArchitectureHybrid (NT kernel + Executive + HAL)Monolithic modular (with dynamic LKMs)
Source & LicensingProprietary / closed-sourceOpen-source (GPLv2 kernel + MIT/GPL userland)
File System & HierarchyNTFS; drive-letter roots (C:\, D:\)EXT4 / XFS / Btrfs via VFS; single unified / root
Configuration StoreCentral binary Windows RegistryPlain-text files in /etc and ~/.config
Primary ShellsPowerShell (object pipeline), Command PromptBash / Zsh (POSIX text pipelines)
Dominant StrengthsDesktop ecosystem, enterprise Active Directory, PC gamingCloud servers, supercomputers, containers, embedded systems

8.2 Embedded and mobile OS

Unlike desktop OSs designed to run arbitrary user software on abundant RAM and AC power, embedded and mobile operating systems target dedicated or battery-powered hardware with tight power, thermal, and memory budgets.

Embedded Operating Systems

Definition

Characteristics of an Embedded OS

An embedded OS controls dedicated microprocessor/microcontroller devices (routers, medical monitors, automotive ECUs, industrial PLCs, smart appliances):

Mobile Operating Systems (Android and iOS)

Smartphones and tablets bridge embedded constraints and desktop capability, adding cellular/Wi-Fi/GPS radios, touch sensors, GPU compositing, and strict app-store security.

Mobile OS Architectures: Android vs. iOS
Layer / FeatureAndroid (Google / AOSP)iOS (Apple)
KernelModified Linux kernel (adds Binder IPC, ashmem, wakelocks, Low Memory Killer)XNU hybrid kernel (Mach microkernel + BSD subsystem + I/O Kit)
App RuntimeAndroid Runtime (ART) with Ahead-of-Time (AOT) & JIT compilation of DEX bytecodeNative ARM64 machine code compiled from Swift / Objective-C
Sandboxing & SecurityEach app runs under a unique Linux UID with SELinux MAC enforcement and runtime permissionsStrict seatbelt sandbox, mandatory Apple code signing, Secure Enclave
Power & LifecycleOS aggressively suspends/kills background apps (Doze mode, App Standby) to preserve batteryTight background execution budgets (APNs push, BackgroundTasks)

8.3 IoT and RT operating system

IoT Operating Systems

Internet of Things (IoT) edge devices (smart agricultural sensors, wearables, smart meters) sit at the extreme low-power end of computing—often running on -bit/-bit/-bit MCUs with – RAM, tiny batteries expected to last years, and lossy wireless links.

Definition

Core Features of IoT Operating Systems

Real-Time Operating Systems (RTOS)

In a Real-Time Operating System (RTOS), correctness depends not only on computing the right logical value, but also on delivering it before a strict timing deadline.

AspectHard Real-Time OSSoft Real-Time OS
Deadline SemanticsMissing even a single deadline constitutes total system failureOccasional missed deadlines degrade quality of service without catastrophic failure
Latency GuaranteesStrictly bounded worst-case interrupt and dispatch latency ()Probabilistic / best-effort low latency
ExamplesAirbag controller, cardiac pacemaker, avionics flight controlLive audio/video streaming, VoIP, gaming consoles
Definition

RTOS Scheduling and Synchronization Guarantees

Notable RTOS examples: FreeRTOS (microcontrollers), QNX Neutrino (microkernel RTOS used in automotive/medical systems), VxWorks (aerospace/Mars rovers), and Zephyr.


8.4 Robot and smart card operating system

Robot Operating System (ROS / ROS 2)

Despite its name, ROS (Robot Operating System) is not a standalone bare-metal kernel; it is a robotics middleware framework (meta-operating system) that runs on top of an existing host OS (commonly Ubuntu Linux or an RTOS) to coordinate distributed sensors, control loops, perception pipelines, and actuators.

Definition

ROS / ROS 2 Core Architecture

Smart Card Operating System

A smart card OS runs inside an ultra-constrained, tamper-resistant microcontroller embedded in bank EMV chips, SIM/eSIM cards, electronic passports, and hardware security tokens. Typical hardware resources are – RAM, – EEPROM/Flash, no secondary disk, no MMU, and an -bit/-bit/-bit CPU often paired with a hardware cryptographic coprocessor (AES, RSA, ECC) and true random number generator.


Worked Out Examples

Example 8.1

8.1

An RTOS schedules three independent periodic tasks using Rate Monotonic Scheduling (RMS):

Assign RMS priorities, compute the total CPU utilization , and check schedulability against the Liu & Layland bound.

Assigning static RMS priorities (shorter period higher priority): Since :

Computing total CPU utilization :

Evaluating the Liu & Layland RMS bound for :

Because , all three tasks are guaranteed to meet every deadline under RMS.

Answer:

RMS priorities are . Total utilization is (), which is well below the RMS bound of (), so the task set is schedulable.

Example 8.2

8.2

An IoT wireless environmental node uses an ARM Cortex-M4 microcontroller with Flash and SRAM running Zephyr OS:

Compute the total Flash and SRAM used and the remaining free headroom in each memory.

Computing Flash memory consumption and headroom:

Computing SRAM consumption and headroom:

  • Packet buffers: .
  • Thread stacks: .

Static pre-allocation avoids dynamic malloc heap fragmentation on the MCU.

Answer:

The firmware uses of Flash ( free) and of SRAM ( free).

Example 8.3

8.3

A point-of-sale terminal sends an ISO/IEC 7816 SELECT Command APDU to a Java Card smart card OS to activate a payment applet whose Application Identifier (AID) is long (A0 00 00 00 04 10 10):

Trace the APDU structure, calculate the total command frame length in bytes, and state what status word indicates success.

Constructing the Command APDU byte layout:

  • CLA INS P1 P2: 00 A4 04 00 ()
  • Lc: 07 (, length of AID payload)
  • Data: A0 00 00 00 04 10 10 ()
  • Le: 00 (, accept up to response bytes)
ISO/IEC 7816 SELECT Command and Response APDUText
Command APDU  : 00 A4 04 00 | 07 | A0 00 00 00 04 10 10 | 00
Response APDU : [FCI Template Data ...] | 90 00

Computing total Command APDU size and interpreting the response:

The Java Card OS routes the APDU to the Card Manager, activates the matching applet inside its isolated firewall, and returns file-control metadata followed by status word 90 00 (normal completion).

Answer:

The Command APDU is long (00 A4 04 00 07 A0 00 00 00 04 10 10 00), and status word 90 00 indicates successful applet selection.


Exercises

Exercise — Overview of Contemporary OS

Question 1

Compare Windows and Linux-based operating systems across four dimensions: kernel architecture, file system/path hierarchy, system configuration mechanism, and shell/automation model.

Kernel and file system comparison:

  • Kernel: Windows uses a hybrid NT kernel (Kernel + Executive + HAL), whereas Linux uses a monolithic modular kernel with loadable kernel modules.
  • File system & hierarchy: Windows uses NTFS with per-drive roots (C:\, D:\), whereas Linux uses EXT4/XFS/Btrfs behind a VFS under a single / root.

Configuration and shell comparison:

  • Configuration: Windows stores settings in the binary Registry, whereas Linux stores plain-text configuration files in /etc.
  • Shell: Windows uses PowerShell (passing structured .NET objects), whereas Linux uses POSIX shells like Bash (passing text streams across /proc//dev and standard utilities).
Answer:

Windows uses a hybrid NT kernel, NTFS with drive letters, the binary Registry, and object-based PowerShell; Linux uses a modular monolithic kernel, VFS with a unified / tree, /etc text configs, and POSIX text-stream shells.

Question 2

Define an Embedded OS and list three key design constraints it faces. Compare the architectures of Android and iOS with respect to kernel, application runtime, and security isolation.

Embedded OS definition and constraints: An embedded OS controls dedicated hardware devices (routers, medical instruments, automotive ECUs) under tight constraints: (1) very small RAM/flash footprint, (2) high unattended reliability (watchdog recovery, headless operation), and (3) strict power efficiency.

Android vs. iOS architectures:

  • Android: Runs a modified Linux kernel (Binder IPC, wakelocks), Android Runtime (ART) compiling DEX bytecode, and isolates every app under a separate Linux UID with SELinux MAC rules.
  • iOS: Runs Apple's XNU hybrid kernel (Mach + BSD), executes natively compiled ARM64 Swift/Objective-C binaries, and enforces strict seatbelt sandboxing and mandatory code signing.
Answer:

Embedded OSs target dedicated hardware with minimal footprint, high reliability, and low power. Android pairs a modified Linux kernel with ART and per-UID SELinux isolation, while iOS pairs the XNU hybrid kernel with native ARM64 binaries and strict sandboxed code signing.

Question 3

Differentiate between hard real-time and soft real-time operating systems with one example of each. Explain priority inversion in an RTOS and how priority inheritance solves it.

Hard vs. soft real-time systems:

  • Hard RTOS: Every timing deadline must be met deterministically; a single missed deadline is a critical failure (e.g., automotive airbag controller or avionics control).
  • Soft RTOS: Deadlines are important for quality, but occasional misses degrade output smoothly rather than causing failure (e.g., live video streaming).

Priority inversion and priority inheritance: Suppose low-priority task holds mutex , high-priority task blocks waiting for , and medium-priority task preempts repeatedly—forcing to wait behind (priority inversion). With Priority Inheritance, the RTOS temporarily elevates 's priority to 's priority while holds , preventing from preempting until is released.

Answer:

Hard RTOS (e.g., airbag ECU) cannot tolerate any missed deadline, whereas Soft RTOS (e.g., video streaming) degrades gracefully. Priority inheritance prevents unbounded priority inversion by temporarily raising a mutex-holding low-priority task's priority to that of the blocked high-priority waiter.

Question 4

An RTOS executes four independent periodic tasks with pairs: , , , and (in milliseconds). Compute the total CPU utilization , compare it with the Liu & Layland RMS bound and the EDF bound, and determine schedulability under both algorithms.

Calculating total CPU utilization :

Comparing against RMS and EDF bounds ():

Since , the task set is guaranteed schedulable under both RMS and EDF.

Answer:

Total utilization (), which is below both the RMS bound () and EDF bound (); therefore, the tasks are schedulable under both RMS and EDF.

Question 5

Why can a standard desktop OS not run on a typical IoT sensor node? Describe the key architectural features of an IoT operating system (such as Contiki-NG, RIOT OS, or Zephyr).

Why desktop OSs do not fit IoT nodes: IoT sensor motes typically have – of SRAM, no MMU or disk, and small batteries expected to last months or years—whereas desktop OSs require gigabytes of RAM, MMU-backed virtual memory, and continuous high-power background services.

Core IoT OS features:

  • Minimal static footprint & event-driven/lightweight threads: Contiki-NG uses stackless protothreads, while RIOT/Zephyr use lightweight static threads to fit in tens of kilobytes.
  • Tickless power management: Sleeps the MCU and radio aggressively between sensor readings.
  • Built-in low-power protocols: Native support for IEEE 802.15.4, 6LoWPAN, BLE, CoAP, and MQTT.
Answer:

Desktop OSs exceed IoT RAM, MMU, and power budgets by orders of magnitude. IoT OSs (Contiki-NG, RIOT, Zephyr) use kilobyte static footprints, protothreads/lightweight threads, tickless deep sleep, and native 6LoWPAN/BLE/MQTT stacks.

Question 6

Explain why ROS / ROS 2 is called a meta-operating system and describe its Nodes, Topics, Services, and Actions (plus the shift from roscore to DDS in ROS 2). Also describe the hardware constraints, APDU communication model, and security design of a Smart Card OS.

ROS / ROS 2 architecture: ROS runs over a host OS (usually Linux) to coordinate distributed robotics software: Nodes (modular processes) exchange continuous streams over Topics (pub/sub), synchronous requests over Services, and long-running preemptible tasks over Actions. ROS 2 replaces ROS 1's single-point-of-failure roscore with decentralized DDS middleware providing real-time QoS and security.

Smart Card OS architecture: Running inside tamper-resistant chips with kilobytes of RAM/EEPROM and no MMU or disk, a Smart Card OS operates passively via half-duplex APDU command-response packets (ISO/IEC 7816/14443). Multi-application cards (Java Card) isolate applets behind VM firewalls and protect keys using hardware crypto engines, tamper sensors, and side-channel-resistant execution.

Answer:

ROS 2 is robotics middleware over Linux/RTOS connecting Nodes via Topics, Services, and Actions over decentralized DDS. A Smart Card OS runs in kilobytes of tamper-resistant memory using passive APDU command-response exchanges and Java Card applet firewalls.

Past exam questions for Operating System

← Hypervisors and Virtual Systems