Introduction to
Operating Systems
Complete exam notes for Nepal Public Service Commission (Loksewa Aayog) Computer Engineer preparation. Covers OS types, structure, system calls, architecture models, evolution, and all service categories.
What Is an Operating System?
"An OS is similar to the government of a country. Like a government, it performs no useful function by itself — it simply provides an environment within which other programs can do useful work."
An operating system is a collection of software that manages computer hardware resources and provides common services for computer programs. It is the most essential component of the system software layer.
Operating systems were developed for two primary purposes: to schedule computational activities for good performance, and to provide a convenient environment for the development and execution of programs.
OS as Resource Manager
Manages CPU time, memory, storage, and I/O devices. Mediates conflicting resource requests across multiple programs and users.
OS as Virtual Machine
Hides hardware complexity behind a clean interface. Programmers write to the abstraction, not the raw silicon.
Time Multiplexing
Multiple processes share the CPU in turns. The OS decides "who goes next and for how long." Classic example: shared printer.
Space Multiplexing
Memory is divided among running programs simultaneously. The OS handles protection, fairness, and isolation. Hard disk is the classic example.
The Kernel & Shell
The OS is split into two key parts. The shell is the interpreter — it translates human commands into machine-readable instructions. The kernel is the heart; it actually processes those instructions and interfaces directly with hardware.
Process state control · Memory allocation & de-allocation · CPU scheduling · Virtual memory management · File system security & permissions
System Calls
A system call is the mechanism by which an application requests a service from the OS kernel. When a user-level process needs hardware access, process creation, or communication, it issues a system call — causing the processor to switch from user mode to kernel (supervisor) mode.
Most operations requiring elevated permissions — I/O with a device, communicating with other processes, accessing protected memory — must go through system calls. User programs cannot do these directly.
System calls are grouped into five major categories:
Process Control
- load / execute
- create process
- terminate process
- get/set attributes
- wait event / signal
- allocate / free memory
File Management
- create / delete file
- open / close
- read / write
- reposition
- get/set attributes
Device Management
- request / release device
- read / write
- reposition
- get/set attributes
- attach / detach devices
Information Maintenance
- get/set time or date
- get/set system data
- process attributes
- file attributes
- device attributes
Communication
- create/delete connection
- send / receive messages
- transfer status info
- attach/detach remote devices
OS Architecture Structures
Operating systems are designed using different structural approaches, each with trade-offs in complexity, modularity, and performance.
The oldest approach. The entire OS runs as a single large process in kernel mode. System calls switch the CPU from user mode to kernel mode, execute the required procedure, then return control. Fast but hard to maintain.
User program issues system call → CPU switches to kernel mode → OS examines parameters → Invokes correct procedure from table → Returns to user mode
The OS is broken into layers. Each layer uses services only from the layer below it. Easier to debug — fix layer by layer. Pioneered by OS/2 and early Windows NT.
Disadvantage: requires careful planning of layer placement and appropriate inter-layer definitions.
Creates the illusion of multiple independent real machines on one physical machine. Each user can run a different OS on their own "virtual" hardware. Best example: IBM 370.
Control Program (CP)
Creates the virtual environment. Gives each user the facilities of a real machine: processor, storage, I/O.
CMS
Conversational Monitor System. Contains editor, language translator, application packages.
RSCS
Remote Spooling Communication System. Enables virtual machines to transmit/receive files in distributed environments.
Modern example: Intel's virtual 8086 mode on the Pentium, allowing old MS-DOS programs to run on modern hardware.
Moves maximum code to user space, minimizing the kernel. The kernel's only job is to handle communication between client and server processes. Highly modular and adaptable to distributed systems.
The OS is split into specialized server processes: file server · process server · terminal server · memory server. A client sends a request → the kernel routes it → the server responds. The client doesn't know or care if the server is local or remote.
Works seamlessly in distributed systems. The client-server model doesn't change whether the server is on the same machine or across a network.
Evolution & Types of Operating Systems
OS history closely tracks the hardware it runs on. Each generation solved the key pain points of the previous one.
Serial Processing (No OS)
Programmers interacted directly with hardware. Scheduling via sign-up sheets. Enormous setup time wasted. One bug meant restarting the entire sequence. Machine idle time was a serious economic problem.
Simple Batch Systems
First OS developed by General Motors for IBM 701. Jobs submitted on cards or tape to an operator who batched them. A resident monitor loaded and ran each job automatically. Problem: CPU still often idle due to slow I/O devices.
Multiprogramming
Multiple jobs loaded simultaneously. While one job waits for I/O, the CPU runs another. CPU utilization skyrocketed. Introduced the concept of time sharing — multiple users interact concurrently via terminals.
CTSS — First Time-Sharing OS
Compatible Time Sharing System, developed at MIT's MAC project for IBM 7090. Each user gets a short "quantum" of CPU time. Foundation for all modern interactive computing.
OS Services & Resource Management
An OS wears many hats. Here are the core services it provides both to users and to the system itself:
User-Facing Services
Program Execution
Loads programs into RAM, handles CPU scheduling, and manages memory allocation/deallocation transparently.
I/O Operations
Abstracts all I/O device interaction. Users never deal with hardware-level I/O details — the OS does.
File System Manipulation
Create, open, save, delete files and directories. Managed by the Secondary Storage Management component.
Communication
Inter-process communication via shared memory or message passing. Parent/child process hierarchies.
Error Detection
Constantly monitors for bad disk sectors, memory overflow, I/O errors. Takes corrective action automatically.
System / Resource Management Services
Process Management
Creation, deletion, synchronization, communication, and deadlock handling for processes.
Memory Management
Tracks free/used memory locations. Decides paging to/from secondary storage (virtual memory).
File Management
Directory organization, file creation/deletion, secondary storage mapping and backup.
I/O Device Management
Device drivers translate OS file abstractions into hardware signals. Interrupt handling included.
Secondary Storage Management
Manages free space, allocates space for new files, and schedules disk access requests.
Network Management
Acts as network resource manager in distributed systems. Handles routing, security, and client-server communication.
Protection & Security
Authentication, file permissions, encryption, software firewalls. Controls access across all concurrent processes.
Command Interpreter
The shell. Separate from the kernel for safety and flexibility. Parses user commands and invokes system calls.
The OS also keeps an account of all resources accessed by each process or user — essential in multi-user environments for fairness, billing, and performance tuning.





Comments
Post a Comment