Operating Systems Level 1
PART 1 • EXECUTION FOUNDATIONS

Meet the Software That Runs the Whole Computer

An operating system turns raw processors, memory and devices into a safe, usable environment where many programs can run. In this lesson, you will follow real requests across that boundary.

Level 01 of 15 Beginner 75–100 minutes No prerequisite
BY THE END, YOU CAN

Explain the OS as a working system

  • Describe the OS without memorised wording.
  • Trace an application request into the kernel.
  • Distinguish interrupts, exceptions and system calls.
  • Explain user mode, kernel mode and booting.
  • Compare major operating-system types.
01 • BEGIN WITH THE PROBLEM

Why Does a Computer Need an Operating System?

Hardware offers power, but it does not by itself provide a convenient or safe place for applications.

A

Abstraction provider

Applications use files, processes and sockets instead of controlling disk sectors, CPU registers and network devices directly.

R

Resource manager

The OS decides which program receives CPU time, memory, storage and device access—and for how long.

C

Control program

It supervises execution, handles errors and prevents one program from damaging another program or the system.

P

Platform

It gives programs stable services and interfaces so developers do not rewrite hardware-control code for every machine.

02 • SEE THE WHOLE STACK

From a User Action to Physical Hardware

Each layer hides lower-level detail while relying on the layer below it.

USER

Expresses an intention: save a file, open a website or run a program.

APPLICATION & LIBRARY

Turns that intention into API calls such as a C library fopen() or browser network request.

SYSTEM-CALL INTERFACE

Provides the controlled entry point through which a program asks the kernel for a protected service.

KERNEL

Validates the request and coordinates process, memory, file, network and device subsystems.

HARDWARE

CPU, RAM, storage, controllers and devices perform the physical operations.

User intention API System call Kernel service Hardware Result
03 • MAP THE RESPONSIBILITIES

Services an Operating System Provides

These services explain what the OS actually does during normal execution.

Program execution

Loads a program, creates its execution context, schedules it and handles normal or abnormal termination.

I/O operations

Offers controlled access to keyboards, displays, disks, networks and other devices through drivers.

File management

Creates, opens, reads, writes, names, protects and removes persistent data.

Communication

Lets processes exchange data through shared memory, pipes, messages or network sockets.

!

Error handling

Detects CPU, memory, device and application errors and takes a controlled action.

Resource allocation

Shares CPU time, memory pages, files and devices among competing processes.

Accounting

Records resource consumption for monitoring, limits, performance analysis or billing.

Protection

Separates users and processes and checks whether each requested operation is permitted.

Convenient interface

Provides command-line, graphical and programmatic interfaces for controlling the system.

04 • PROTECT THE MACHINE

User Mode and Kernel Mode Create a Safety Boundary

A CPU privilege level determines which instructions the currently executing code is allowed to perform.

RESTRICTED EXECUTION

User mode

  • Applications normally run here.
  • Cannot directly reconfigure hardware.
  • Cannot access arbitrary physical memory.
  • Requests protected work through system calls.

Controlled transition

PRIVILEGED EXECUTION

Kernel mode

  • Core OS code and many drivers run here.
  • Can execute privileged instructions.
  • Can manage page tables, interrupts and devices.
  • A bug can affect the entire system.
05 • INTERACTIVE LAB

Trace a Request through the Operating System

Choose an everyday action, then move one step at a time to see the responsible layer and processor mode.

An editor needs bytes from notes.txt.
STEP 1 OF 7 USER MODE
APPLICATION

The application identifies the work

The editor decides that it needs data stored in a named file. It does not know the disk location or control the storage device directly.

Notice where the mode changes and where control returns to the application.

06 • DISTINGUISH CONTROL EVENTS

Interrupt, Exception, Trap and System Call

All can transfer control to an OS handler, but their source and timing differ.

Event Where it originates Timing Example
Hardware interrupt External hardware or a device controller Asynchronous to the current instruction Keyboard input, disk completion or timer tick
Exception The CPU while executing the current instruction Synchronous Divide by zero, invalid opcode or page fault
Trap Intentional or exceptional software-triggered transfer Synchronous Breakpoint or system-call instruction
System call A program deliberately requesting an OS service Synchronous to the request read, write, fork or mmap
07 • INTERACTIVE LAB

Classify the Control Transfer

Read the situation, choose the best category, and learn why the tempting alternatives do not fit.

CASE 1 OF 6

A storage controller reports that a disk read has finished.

What caused the CPU to enter the handler?

YOUR REASONING

Choose a category

Use the source and timing of the event, not only the fact that kernel code eventually runs.

08 • START THE MACHINE

How the Operating System Begins Running

The boot sequence builds a working environment in stages; the OS is not already active when power first arrives.

STEP 1

Firmware

UEFI or BIOS checks essential hardware and selects a boot device.

STEP 2

Bootloader

Finds the kernel, loads it into memory and transfers control.

STEP 3

Kernel init

Initializes memory management, scheduling, interrupts and drivers.

STEP 4

First user process

The kernel starts the system’s initial user-space process.

STEP 5

Services & login

Background services start and a command-line or graphical session becomes available.

09 • COMPARE DESIGNS

Operating Systems Are Shaped by Their Workload

The categories overlap; one modern system can support time sharing, multiprocessing and real-time features.

Batch OS

Collects jobs and executes them with little or no interactive user involvement.

GOAL: THROUGHPUT

Multiprogramming OS

Keeps several jobs in memory so the CPU can run another when one waits for I/O.

GOAL: CPU UTILIZATION

Time-sharing OS

Switches rapidly among interactive tasks to provide responsive access for users.

GOAL: RESPONSE TIME & FAIRNESS

Real-time OS

Provides predictable timing; correctness includes meeting deadlines.

GOAL: DETERMINISM

Distributed OS

Coordinates networked computers and may present resources as one integrated system.

GOAL: SHARING & TRANSPARENCY

Embedded/mobile OS

Balances constrained resources, power, responsiveness, sensors and device-specific needs.

GOAL: EFFICIENCY & RELIABILITY
10 • CHECK YOUR UNDERSTANDING

Ten Formative Concept Checks

These are untimed learning checks. Feedback explains the exact misconception behind every answer.

Answered correctly: 0 of 10
11 • EXPLAIN & PREPARE

University and Placement Questions

First answer aloud from memory. Then use the frameworks to identify missing reasoning.

2-MARK QUESTIONS
  1. Define an operating system.
  2. What is a system call?
  3. Define a privileged instruction.
  4. What is booting?
  5. State one difference between interrupt and exception.
5-MARK QUESTIONS
  1. Explain the major services of an OS.
  2. Compare user mode and kernel mode.
  3. Describe the boot sequence.
  4. Compare batch, time-sharing and real-time systems.
  5. Explain how a file-read request reaches hardware.
INTERVIEW QUESTIONS
  1. What would happen if every program ran in kernel mode?
  2. Is every library call a system call?
  3. Why can a page fault be normal?
  4. How does a timer interrupt help multitasking?
  5. Kernel versus operating system—are they identical?
Show a strong answer: “What happens during a system call?”
  1. The application prepares the request, arguments and system-call identifier, usually through an API wrapper.
  2. A special instruction transfers control through a defined entry point and the CPU begins privileged kernel execution.
  3. The kernel validates arguments and permissions before dispatching the responsible subsystem.
  4. The service may finish, block the calling process or ask a device driver to begin I/O.
  5. The kernel stores a result or error code, restores user context and returns execution to user mode.

Strong finish: A system call is therefore a controlled privilege transition, not an unrestricted jump into arbitrary kernel code.

Show a strong answer: “Kernel versus operating system”

The kernel is the privileged core that directly manages fundamental resources and hardware interactions. The operating system is broader: it includes the kernel plus system libraries, utilities, services and often a user interface. In casual usage the terms may be blurred, but they are not strictly identical.

LEVEL 1 SUMMARY

You Can Now Follow Work across the OS Boundary

  • The OS provides useful abstractions while managing and protecting hardware resources.
  • Applications normally run with restricted privilege and request protected services using system calls.
  • Hardware interrupts are asynchronous; instruction-caused exceptions and deliberate traps are synchronous.
  • Booting progresses from firmware and a bootloader to kernel initialization and user-space services.
  • OS designs differ because throughput, responsiveness, deadlines, power and scale demand different trade-offs.
COURSE CHECKPOINT

Complete the checks and mark this level when you can explain one request path without reading.

Saved only in this browser.