Unit 1 of 4 · B.Sc IT Sem 3

Unit 1: OS fundamentals and processes

Operating Systems notes · PTU syllabus (BSIT303/BSBC403)

6 min read9 topics10 exam questions
On this page
  1. Unit summary
  2. Application vs system programs
  3. Functions of an operating system
  4. Classification of operating systems
  5. OS subsystem layers and structure
  6. Bootstrapping
  7. Protection and security
  8. Program vs process and process states
  9. Process context, address space and PCB
  10. Thread management and its benefits
  11. Key terms
  12. Quick revision
  13. 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

Topic 1

Application vs system programs

Application programs help users do their own tasks — word processors, browsers, games and accounting packages.

  • 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.

Example

On one laptop: the operating system, compiler, linker and loader are system programs; a spreadsheet, a video player and a web browser are application programs that depend on them.

Exam tip

System programs serve the computer; application programs serve the user.

2

Topic 2

Functions of an operating system

Its main functions are process management, memory management, file management, device (I/O) management, security and protection, and providing a user interface. 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.

HierarchyLayers of a computer system
  1. Users

    People and other computers

  2. Application programs

    Browsers, editors, games

  3. Operating system

    Controls and coordinates hardware use

  4. Hardware

    CPU, memory, I/O devices

Goals: convenience (easy to use) and efficiency (good use of resources).

Example

The OS at work: when you open a browser while music plays, the OS schedules both processes on the CPU, gives each its own memory, reads files from disk, sends sound to speakers and checks that the browser cannot read other users' files.

Exam tip

List the functions with one example each.

3

Topic 3

Classification of operating systems

TypeKey ideaDrawback or feature
BatchSimilar jobs grouped and run one after another without user interactionCPU idle during I/O; no interaction
MultiprogrammingSeveral programs in memory; CPU switches when one waits for I/OBetter CPU use
Time-sharing (multitasking)CPU time shared in small slices among many usersQuick response; interactive
Parallel (multiprocessor)Several CPUs share memory and work togetherHigher throughput, reliability
DistributedMany independent computers connected by a network act as one systemResource sharing, fault tolerance
Real-timeResults must arrive within strict time limitsHard (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.

Example

Matching OS to use: payroll processing at month-end runs as batch jobs; a university server with many logged-in users is time-sharing; a car's airbag controller needs a hard real-time OS; Android is a mobile OS.

Exam tip

Distinguish hard real-time (deadlines must never be missed) from soft real-time (occasional misses are tolerable).

4

Topic 4

OS subsystem layers and structure

Common structures are monolithic, layered (each layer uses only the services of lower layers), microkernel (only essential services in the kernel) and modular (loadable kernel modules, as in Linux).

  • 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).

Example

Microkernel vs monolithic: in a microkernel, a crashing device driver runs in user space and can be restarted without crashing the system; in a monolithic kernel, a bad driver can crash the whole OS but the system usually runs faster.

Exam tip

Compare structures on speed, reliability and ease of modification.

5

Topic 5

Bootstrapping

Bootstrapping is the process of starting a computer and loading the operating system into memory.

ProcessBoot process
  1. 1

    Power on

  2. 2

    Firmware (BIOS or UEFI) runs POST

  3. 3

    Bootstrap loader in firmware finds the boot device

  4. 4

    Boot loader (GRUB, Windows Boot Manager) loads the kernel

  5. 5

    Kernel initialises devices and memory

  6. 6

    Init or systemd starts services

  7. 7

    Login prompt or desktop

Example

Booting a PC: on power-on, the firmware runs the power-on self-test, finds the boot device, loads the boot loader (such as GRUB or Windows Boot Manager), which loads the kernel; the kernel then starts system services and the login screen.

Exam tip

Remember the order: POST → boot loader → kernel → init/system services → login.

6

Topic 6

Protection and security

Protection is an internal problem — controlling which processes and users can access which resources. Security deals with external threats such as intruders and malware.

  • 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.

Example

Protection in Linux: a file with permissions rw-r----- can be read and written by its owner, only read by the group, and not accessed at all by others. Memory protection stops one program from overwriting another's memory.

Exam tip

Protection = mechanism; security = policy and defence against attacks.

7

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.

CycleProcess state diagram
Process state diagram
1New
2Ready
3Running
4Waiting
5Terminated
  1. 1. New: Being created
  2. 2. Ready: Waiting for the CPU
  3. 3. Running: Executing on the CPU
  4. 4. Waiting: Blocked for I/O or an event
  5. 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).

Example

One process's life: you open a text editor — the process is created (new) and admitted to the ready queue. The scheduler dispatches it (running). It asks to read a file from disk, so it moves to waiting. When the disk finishes, it returns to ready (not straight to running), and runs again when dispatched. If its time slice ends, it is interrupted back to ready. When you close the editor it terminates.

Exam tip

A process never goes directly from waiting to running — it must first return to the ready queue and be dispatched by the scheduler.

8

Topic 8

Process context, address space and PCB

A process is a program in execution. Its context includes the program counter, registers and memory state; its address space contains code, data, heap and stack. The PCB holds the process ID, state, PC, registers, scheduling information, memory information and open files. 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.

SchedulerChoosesFrequency
Long-term (job)Which jobs enter memory (ready queue)Infrequent
Short-term (CPU)Which ready process runs nextVery frequent
Medium-termWhich processes to swap out and back inIn between

Example

Using the PCB: when a running process is interrupted, the OS saves its program counter and registers in its PCB. Later, it reloads them from the PCB so the process continues exactly where it stopped.

Exam tip

Draw the process states: new → ready → running → waiting → terminated.

9

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

  1. Q1.Distinguish system and application programs.
  2. Q2.What is bootstrapping?
  3. Q3.What is dual-mode operation?
  4. Q4.Distinguish a program and a process.
  5. Q5.What does a PCB contain?
  6. Q6.State two benefits of threads.

Long-answer questions

  1. Q1.Explain the functions and classification of operating systems.
  2. Q2.Explain OS layers and the bootstrapping process.
  3. Q3.Explain process states and the process control block.
  4. 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.

WhatsApp us