7 Linux Case Study

Operating Systems · Unit 7 · 5 hrs

Linux Case Study

Exam-focused notes for Linux Case Study (Operating Systems, CSC264): what the TU syllabus asks and how it has actually been tested, with 2 solved past questions from this unit.

Linux Case Study in short

This chapter closes the subject with a case study of Linux, showing how the general concepts developed in earlier chapters (processes, scheduling, IPC, memory and file management) are realized in one widely used, real-world monolithic kernel.

Linux Case Study: notes

History

Linux began in 1991 as a personal project by the Finnish student Linus Torvalds, who set out to build a free, UNIX-like operating system kernel; the Linux kernel he started has grown continuously ever since. Key milestones include Red Hat Linux in 1994, the first stable Linux 2.4 kernel series released by Torvalds in 2001, the arrival of Ubuntu in 2004, and the Linux kernel 3.0 series in 2011. Linux has since become the kernel underneath the great majority of the world's servers and, through Android, the majority of the world's smartphones. Because its source code is freely available and free to modify, Linux is also considered one of the more reliable and secure general-purpose operating systems, since vulnerabilities can be found and patched by a very wide community rather than a single vendor; well known distributions built on the Linux kernel include Linux Mint, Manjaro, Debian and Ubuntu.

Kernel Modules

The Linux kernel is a monolithic kernel: it is built as one large program in which every part has direct access to all of the kernel's internal data structures and routines, rather than being split into isolated, message-passing services. A kernel module is an object file containing code that can extend the kernel's functionality at run time, loaded into the running kernel and unloaded again once it is no longer needed, without requiring a reboot; most device drivers are implemented and distributed as kernel modules, and modules are conventionally stored under the /lib/modules subdirectories. Conceptually, a Linux system is layered into applications and OS services (user programs together with system utilities such as shells, libraries and compilers), the Linux kernel itself (which abstracts the underlying hardware and mediates and controls access to system resources), and the hardware (the physical CPU, disk, RAM and other devices that ultimately do the work).

Process Management

A process in Linux is a running instance of a program, taking input, processing it, and producing output; managing and controlling processes is called process management. Every Linux process carries two vectors describing it: the argument vector, holding the command line arguments it was started with, and the environment vector, holding a list of (name, value) pairs describing its environment variables. Processes fall into two categories.

  • A foreground process is, by default, what every process is when started: it takes its input from the terminal (stdin) and sends its output to the terminal (stdout), and no other process can use that same terminal until the foreground process finishes or is killed.
  • A background process is created by appending & to a command; it runs without needing keyboard input while the user's terminal is free to run other foreground processes. If a background process does need input, it remains stopped until it is brought to the foreground (with the shell's fg command, conventionally triggered by pressing Enter at the terminal), completes only once it is running in the foreground, and otherwise stays in a stopped state indefinitely.

What this unit covers

  • History
  • Kernel Modules
  • Process Management
  • Scheduling
  • Inter-process Communication
  • Memory Management
  • File System Management Approaches
  • Device Management Approaches

Inter-process Communication

2081 · 5 marks

Explain Inter-Process Communication in Linux. [5]

Inter-Process Communication (IPC) refers to a mechanism where the operating system allows various processes to communicate with each other, synchronize their actions, and manage shared data. It allows a specific program to handle many user requests at the same time. --- IPC addresses three fundam...

Open this answer on its own page →

2078 · 5 marks

Write short notes on: a. IPC in Linux b. Disk access [5]

Show solved answer

Short Notes: IPC in Linux and Disk Access


a. IPC in Linux (Inter-Process Communication)

Inter-Process Communication (IPC) refers to the mechanisms that allow processes running in Linux to communicate and synchronize with each other.

In Linux, processes are independent units of execution. However, many applications require processes to share data or coordinate their activities. Linux provides several IPC mechanisms:

Key IPC Mechanisms in Linux:

MechanismDescription
PipesAllow one-way communication between related processes (parent-child). Data flows in a single direction.
Named Pipes (FIFOs)Similar to pipes but allow communication between unrelated processes using a file name in the filesystem.
SignalsUsed to notify a process that a particular event has occurred (e.g., SIGKILL, SIGTERM).
Message QueuesAllow processes to send and receive messages in a queue format, managed by the kernel.
Shared MemoryAllows multiple processes to access the same region of memory, providing the fastest form of IPC.
SemaphoresUsed for synchronization between processes to avoid race conditions when accessing shared resources.
SocketsAllow communication between processes on the same machine or across a network.

Key Points:

  • Linux processes run in foreground or background mode
  • The Linux kernel mediates and controls access to system resources including IPC facilities
  • IPC mechanisms are managed through kernel modules stored in /lib/modules subdirectories
  • Proper synchronization is essential to prevent data corruption when multiple processes share resources

b. Disk Access

Disk access refers to the process of reading from or writing data to a hard disk drive. Understanding disk access is important for optimizing I/O performance.

Disk Structure (from notes):

A disk is divided into:

  • Tracks: Concentric circles on each platter surface
  • Cylinders: The same track across all platters
  • Sectors: Subdivisions of each track

Each platter has 2 surfaces with read/write heads for each surface.


Disk Access Time Formula:

Disk Access Time = Seek Time + Rotational Latency + Transfer Time

Components Explained:

ComponentDefinition
Seek TimeTime taken to move the disk arm to the specified track where the read/write request will be satisfied
Rotational LatencyTime taken for the desired sector to rotate into position under the read/write head
Transfer TimeTime to actually transfer the data; depends on rotating speed and number of bytes to be transferred

Additional Terms:

  • Random Access Time = Seek Time + Rotational Latency
  • Disk Response Time: Average time spent by a request waiting to perform its I/O operation
  • Transmission Time: Total time taken to access the whole record
  • Transfer Rate: Rate at which data moves from disk to the computer

Example:

If Seek Time = 5 ms, Rotational Latency = 3 ms, Transfer Time = 2 ms:

Disk Access Time = 5 + 3 + 2 = 10 ms

Optimization:

  • RAID (Redundant Array of Independent Disks) improves disk performance by striping data across multiple disks, allowing overlapping I/O operations
  • Virtual Memory uses disk as an extension of RAM (swap space), though disk access is slower than RAM access

Both topics are core components of Operating System I/O and process management as covered in the Linux OS architecture.

Open this answer on its own page →