Unit 1 of 4 · B.Sc IT Sem 3

Unit 1: OS fundamentals and processes

Operating Systems notes · PTU syllabus (BSIT303/BSBC403)

3 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
CycleProcess state diagram
Process state diagram
1New
2Ready
3Running
4Waiting
5Terminated
  1. 1. New: Process is created
  2. 2. Ready: Waiting for the CPU
  3. 3. Running: Instructions executing
  4. 4. Waiting: For I/O or an event
  5. 5. Terminated: Finished
1

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

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.

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

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.

4

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

Topic 5

Bootstrapping

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

6

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

8

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.

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