Operating System Structures & Processes
Study Notes based on the provided OS slides and PDF
OS services, system calls, structures, process concept,
Focus
scheduling
Use Midterm review, quick revision, and exam writing practice
1. Executive Summary
• An operating system is the core system software that acts as the interface between users and hardware while
managing resources fairly and efficiently.
• It offers services such as program execution, I/O, file management, communication, protection, error handling, and
accounting.
• Modern operating systems are usually hybrid in structure and manage work through processes, process states, PCB
information, context switching, and scheduling.
2. Operating System Services
• User interface: CLI, GUI, and batch-style interaction
• Program execution: load a program, run it, and terminate it normally or abnormally
• I/O operations: interact with files and devices safely through the kernel
• File-system manipulation: create, delete, read, write, search, and protect files/directories
• Communication: shared memory or message passing between processes
• Error detection: detect hardware, software, and device errors and respond properly
• Resource allocation, accounting, protection, and security
3. Operating System Structure
• Simple structure
• Small and fast, but weakly separated; example: MS-DOS
• Layered approach
• Each layer uses services of lower layers; improves clarity and modularity
• Microkernel
• Moves services to user space and uses message passing; more secure but slower
• Modules
• Loadable kernel modules with clean interfaces; flexible and modern
• Hybrid systems
• Combine several models to balance performance, reliability, and usability
4. System Calls and Mode Switching
• System calls are the programming interface used by applications to request kernel services.
• APIs such as POSIX, Win32, or Java often wrap system calls so programmers do not deal with low-level details
directly.
• User mode protects ordinary applications; kernel mode allows privileged OS operations.
• A system call triggers a transition from user mode to kernel mode and later returns control to user mode.
5. Process Concept
• A program is passive data stored on disk; a process is the active execution of that program in memory.
• A single program can create multiple processes, especially when many users run the same software.
• A process contains code, current execution state, stack, data section, and heap.
6. Process Memory Layout
Top of memory
+---------------------------+
| Stack | calls, local |
+---------------------------+
| Heap | dynamic mem |
+---------------------------+
| Data | globals |
+---------------------------+
| Text | code |
+---------------------------+
Bottom of memory
7. Process States and PCB
• Process states: new, ready, running, waiting, terminated
• State transitions: admitted, scheduler dispatch, interrupt, I/O wait, I/O completion, exit
• PCB (Process Control Block): process state, program counter, CPU registers, scheduling info, memory info,
accounting info, and I/O status
• Why PCB is essential
• When the CPU switches processes, the OS saves the current process state into its PCB.
• The OS later restores another process from its PCB so execution can continue exactly where it stopped.
• This is the basis of multitasking and time sharing.
8. Process Scheduling
• The scheduler improves CPU utilization and responsiveness by choosing which ready process runs next.
• Queues used by the OS include the job queue, ready queue, and device queues.
• Schedulers: long-term scheduler admits jobs to memory; short-term scheduler selects the next CPU process;
medium-term scheduler swaps processes in and out of memory.
• Process types: CPU-bound processes need long CPU bursts, while I/O-bound processes spend more time waiting for
devices.
• Scheduling logic in simple steps
• New jobs enter the system.
• The long-term scheduler may admit them to memory.
• The short-term scheduler chooses one ready process for CPU execution.
• If it requests I/O, it moves to a device queue and later returns to the ready queue.
• If memory pressure is high, the medium-term scheduler may swap it out and bring it back later.
9. Spooling, Interrupts, and Booting
• Spooling stores I/O jobs in a buffer so slow devices can catch up while the CPU continues other work.
• Hardware interrupts come from devices such as keyboards and mice; software interrupts are caused by system calls
or exceptions.
• Booting starts with firmware/BIOS, POST, boot loader, and kernel initialization.
10. Structural Diagram
User / App
|
v
API / System Call Interface
|
v
Kernel
|- Scheduler
|- Memory Manager
|- File System
`- I/O & Device Drivers
|
v
Hardware
11. Real-World Engineering Examples
• Printing system: spooling lets many print jobs wait in a queue while the printer works at its own pace.
• Desktop multitasking: a code editor, browser, and terminal run as separate processes with their own PCB entries
and scheduled CPU time.
• Mobile OS apps: background services, foreground apps, and device drivers rely on process management, system
calls, and resource protection.
12. Quick Revision Table
Topic Core idea Exam keyword
System call Request to kernel service user mode -> kernel mode
PCB Process information storage context switch
Ready queue Processes waiting for CPU short-term scheduler
Spooling Buffering slow I/O jobs parallel I/O
End of notes. Use this as a clean study handout for revision and exam writing.