Unit 1: OS fundamentals and processes
Operating Systems notes · PTU syllabus (BSIT303/BSBC403)
On this page
- Unit summary
- Application vs system programs
- Functions of an operating system
- Classification of operating systems
- OS subsystem layers and structure
- Bootstrapping
- Protection and security
- Program vs process and process states
- Process context, address space and PCB
- Thread management and its benefits
- Key terms
- Quick revision
- Important questions
Unit summary
The operating system manages hardware and provides services so that programs can run safely and efficiently. This unit covers application vs system programs, OS functions and classification, subsystem layers, bootstrapping, protection and security, program vs process, process context, address space and state management, and thread management and synchronisation.
After this unit you can
- Distinguish application and system programs and explain OS functions
- Classify operating systems and explain their layers and bootstrapping
- Explain processes, process states and context
- Explain threads and their benefits
PTU syllabus topics
- Application vs system programs
- OS functions and classification (multi-user, multiprogramming, multiprocessing, time-sharing, multi-threaded)
- subsystem layers
- bootstrap
- protection and security
- program vs process
- process context/address space/state management
- thread management benefits and synchronization
- 1. New: Process is created
- 2. Ready: Waiting for the CPU
- 3. Running: Instructions executing
- 4. Waiting: For I/O or an event
- 5. Terminated: Finished
Topic 1
Application vs system programs
- System programs: manage and support the computer — operating system, compilers, linkers, loaders, utilities, device drivers.
- Application programs: solve user problems — browsers, office suites, games, business software. They request OS services through system calls.
Topic 2
Functions of an operating system
An operating system is system software that acts as an interface between the user and the hardware, and as a resource manager that allocates the CPU, memory, files and devices among programs. Examples: Windows, Linux, macOS, Android.
- Users
People and other computers
- Application programs
Browsers, editors, games
- Operating system
Controls and coordinates hardware use
- Hardware
CPU, memory, I/O devices
Goals: convenience (easy to use) and efficiency (good use of resources).
Topic 3
Classification of operating systems
| Type | Key idea | Drawback or feature |
|---|---|---|
| Batch | Similar jobs grouped and run one after another without user interaction | CPU idle during I/O; no interaction |
| Multiprogramming | Several programs in memory; CPU switches when one waits for I/O | Better CPU use |
| Time-sharing (multitasking) | CPU time shared in small slices among many users | Quick response; interactive |
| Parallel (multiprocessor) | Several CPUs share memory and work together | Higher throughput, reliability |
| Distributed | Many independent computers connected by a network act as one system | Resource sharing, fault tolerance |
| Real-time | Results must arrive within strict time limits | Hard (missile control) vs soft (video streaming) |
Generations: 1st (1945–55) vacuum tubes, no OS; 2nd (1955–65) transistors and batch systems; 3rd (1965–80) ICs, multiprogramming and time-sharing; 4th (1980–present) personal computers, GUIs, networked and mobile OS.
Topic 4
OS subsystem layers and structure
- Simple/monolithic structure: the whole OS runs as one large program in kernel mode (early UNIX, MS-DOS). Fast but hard to maintain.
- Layered structure: OS divided into layers, each using only the layer below. Easy to debug.
- Microkernel: only essential services (IPC, scheduling) in the kernel; others run as user processes. Reliable and extensible.
- Modular: a core kernel with loadable modules (modern Linux).
Topic 5
Bootstrapping
- 1
Power on
- 2
Firmware (BIOS or UEFI) runs POST
- 3
Bootstrap loader in firmware finds the boot device
- 4
Boot loader (GRUB, Windows Boot Manager) loads the kernel
- 5
Kernel initialises devices and memory
- 6
Init or systemd starts services
- 7
Login prompt or desktop
Topic 6
Protection and security
- Protection: mechanisms controlling access of processes and users to resources — memory protection (base and limit registers), CPU protection (timer), I/O protection (privileged instructions in kernel mode), dual-mode operation (user and kernel modes).
- Security: defending the system against internal and external attacks — authentication, encryption, access control, auditing.
Topic 7
Program vs process and process states
A process is a program in execution, with its own code, data, stack and CPU state. A program is passive (a file); a process is active.
- 1. New: Being created
- 2. Ready: Waiting for the CPU
- 3. Running: Executing on the CPU
- 4. Waiting: Blocked for I/O or an event
- 5. Terminated: Finished
Transitions: admit (new → ready), dispatch (ready → running), interrupt/time-out (running → ready), I/O wait (running → waiting), I/O completion (waiting → ready), exit (running → terminated).
Topic 8
Process context, address space and PCB
The Process Control Block (PCB) is the data structure in which the OS stores everything about a process: process ID, state, program counter, CPU registers, scheduling information (priority), memory information, accounting information and I/O status. Context switch: saving the PCB of the running process and loading the PCB of the next one. It is pure overhead.
| Scheduler | Chooses | Frequency |
|---|---|---|
| Long-term (job) | Which jobs enter memory (ready queue) | Infrequent |
| Short-term (CPU) | Which ready process runs next | Very frequent |
| Medium-term | Which processes to swap out and back in | In between |
Topic 9
Thread management and its benefits
A thread is a lightweight unit of execution within a process. Threads of the same process share code, data and files but have their own stack and registers.
- Benefits: responsiveness, resource sharing, economy (cheaper than processes) and use of multiple cores.
- Multithreading models: many-to-one, one-to-one and many-to-many (mapping user threads to kernel threads).
Example
A web browser uses one thread to download a page and another to keep the window responsive.
- Thread synchronisation: threads share data, so access to shared variables must be synchronised with mutex locks, semaphores or monitors to avoid race conditions.
Key terms
- System program
- Software that supports the operation of the computer
- Bootstrap loader
- Program that starts loading the operating system
- Dual-mode operation
- User and kernel modes of execution
- Process
- Program in execution
- Thread
- Lightweight unit of execution within a process
Quick revision
- System vs application programs; OS functions.
- Batch, multiprogramming, multiprocessing, time-sharing, multiuser, multithreaded, real-time, distributed.
- Layered, monolithic, microkernel structures; boot sequence.
- Protection (dual mode, base and limit, timer) vs security.
- Process states, PCB, context; threads, user vs kernel threads, synchronisation.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.Distinguish system and application programs.
- Q2.What is bootstrapping?
- Q3.What is dual-mode operation?
- Q4.Distinguish a program and a process.
- Q5.What does a PCB contain?
- Q6.State two benefits of threads.
Long-answer questions
- Q1.Explain the functions and classification of operating systems.
- Q2.Explain OS layers and the bootstrapping process.
- Q3.Explain process states and the process control block.
- Q4.Explain threads, their benefits and synchronisation.
Stuck on this unit?
Message SBS on WhatsApp for help with Operating Systems, or to ask about studying B.Sc IT at Synetic.
