RTUComputer ScienceYr 2023 · Sem 52023

Q1Operating System

Question

10 marks

(a) Explain the architecture of Operating System in detail. (b) Discuss the different types of system calls with examples.

Answer

An exhaustive architectural analysis of Operating System design, detailing the Monolithic and Microkernel structures, followed by a rigorous breakdown of how System Calls facilitate the mathematical transition from User Mode to Kernel Mode.

The internal architecture of an Operating System is arguably the most complex software engineering feat in existence. It is not a single script, but a massively layered ecosystem designed to violently protect the physical hardware from malicious software while mathematically allocating resources. OS architecture is fundamentally dictated by how it organizes its core engine: The Kernel.

1. Monolithic Architecture

This is the classic, highly aggressive architecture (utilized by early Unix and MS-DOS).

  • Structure: Every single OS component—CPU scheduling, RAM management, File Systems, and hundreds of Device Drivers—is compiled into one single, massive, contiguous binary file. The entire OS operates strictly in highly privileged "Kernel Mode".
  • Merits: Blisteringly fast execution. Because everything is in the same memory space, internal components communicate using direct memory pointers with zero mathematical overhead.
  • Catastrophic Demerits: A single line of faulty code in a random audio driver can violently crash the entire Kernel, triggering a total system failure (Blue Screen of Death). It is extremely difficult to maintain and mathematically impossible to secure completely.

2. Microkernel Architecture

Engineered specifically to solve the fatal flaws of the Monolithic approach (utilized by macOS/Mach and QNX).

  • Structure: The Kernel is violently stripped down to its absolute bare minimum mathematical components (just basic CPU scheduling and IPC - Inter-Process Communication). Everything else (File Systems, Drivers) is physically ripped out of the Kernel and forced to run in unprivileged "User Mode" as separate, isolated services.
  • Merits: Absolute, unbreakable stability. If a Graphics Driver crashes, it only kills the User Mode graphics process; the core Microkernel survives, and simply restarts the driver. The system mathematically cannot crash.
  • Demerits: Extreme performance degradation. Because services are isolated, they must communicate by continuously passing messages back and forth through the Microkernel, generating catastrophic CPU latency.

Modern CPUs operate in two strict hardware states: User Mode (restricted) and Kernel Mode (absolute power). User applications (like a web browser or a C program) are physically trapped in User Mode. They are mathematically forbidden from directly accessing the Hard Drive, RAM, or CPU registers. To perform any physical I/O, the application must aggressively beg the OS for help using a System Call.

A System Call is a highly secure, mathematically verified software interrupt (a Trap) that forces the CPU to switch from User Mode to Kernel Mode, execute the privileged OS code, and then violently drop back to User Mode.

Types of System Calls

  • 1. Process Control: Used to violently create or terminate running programs. Examples: fork() (clones a process mathematically perfectly), exec() (loads a new binary), exit(), wait().
  • 2. File Management: Used to mathematically manipulate the data on the Hard Drive. Examples: open() (requests access to a file), read(), write(), close().
  • 3. Device Management: Used to aggressively interact with physical hardware peripherals. Examples: ioctl() (sends control signals to a physical device driver), read(), write().
  • 4. Information Maintenance: Used to query the OS Kernel for system data. Examples: getpid() (fetches the process ID), time(), date().
  • 5. Communications: Used for Inter-Process Communication (IPC) across networks or locally. Examples: pipe() (creates a data tunnel between processes), shmget() (requests shared RAM), socket() (opens a network connection).
Back to Paper