Zum Inhalt springen

English:Operating Systems

Aus MOOCsWiki Staging
Die Druckversion wird nicht mehr unterstützt und kann Darstellungsfehler aufweisen. Bitte aktualisiere deine Browser-Lesezeichen und verwende stattdessen die Standard-Druckfunktion des Browsers.
aiMOOC-Siegel

Operating Systems



Introduction

An operating system is the foundational software layer that manages a computer's hardware resources and provides services to application programs. It coordinates processors, memory, storage, input and output devices, files, networks, users, and permissions. In everyday computing, you meet operating systems through graphical interfaces and apps, but the most important work happens underneath the interface: the system decides what may run, when it may run, what memory it may use, and how it may communicate with hardware or other programs.

This aiMOOC is designed for Grades 11–13. You will move from everyday observations to concepts used in computer science and information technology. You should finish the course able to explain the role of an operating system, distinguish processes from threads, reason about CPU scheduling and concurrency, describe virtual memory and file systems, analyze booting and security, and compare operating-system architectures.

The diagram above shows the operating system as an active coordinator between applications, users, and hardware. The video below gives a historical and conceptual introduction to why operating systems developed.


Learning Goals

By the end of this aiMOOC, you should be able to explain how an operating system abstracts hardware, describe the relationship among user space, the kernel, and system calls, interpret process-state and virtual-memory diagrams, compare scheduling strategies, explain basic synchronization problems, analyze how files and permissions are managed, describe a modern boot sequence, and evaluate design trade-offs among monolithic kernels, microkernels, virtualization, and containers.

You will also practise technical communication. This includes using precise terms, drawing system diagrams, interpreting command-line evidence, comparing designs, and defending conclusions with observations rather than relying only on memorized definitions.


What an Operating System Does

A computer contains many resources that cannot simply be used by every program at the same time without coordination. The operating system acts as a resource manager and an abstraction layer. As a resource manager, it allocates processor time, memory, storage access, and devices. As an abstraction layer, it gives software convenient concepts such as files, processes, sockets, and windows instead of forcing every application to control hardware directly.

Important operating-system responsibilities include process management, memory management, file and storage management, device and input/output management, security and access control, networking, error handling, and the provision of interfaces for users and programs. Different operating systems organize these responsibilities differently, but the same core problems appear on desktop computers, smartphones, servers, embedded devices, and cloud systems.

A useful distinction is between an interface and an implementation. An application may request that a file be opened without knowing the exact geometry of a storage device. The operating system hides low-level details and presents a stable interface. This separation makes software easier to write and makes it possible for the same application concept to work on many kinds of hardware.


Kernel, User Space, and System Calls

The kernel is the privileged core of an operating system. It manages critical resources and executes operations that ordinary application code is not permitted to perform directly. Most application code runs in user space, where hardware-enforced restrictions reduce the damage that a faulty or malicious program can cause.

When an application needs a protected service, it normally uses a system call. A system call transfers control from user code to the kernel through a defined interface. Typical system-call purposes include reading or writing data, creating a process, allocating memory, communicating over a network, or requesting information about the system. Libraries often provide convenient functions that wrap lower-level system calls.

The boundary between user space and kernel space is central to reliability and security. If every application could directly rewrite memory-management tables or control a storage device, one programming error could corrupt the whole system. Privilege separation therefore limits what ordinary code can do and gives the kernel responsibility for validating sensitive requests.


Kernel Architectures

A monolithic kernel places many core services, such as device drivers, file systems, networking, and memory management, in kernel space. Linux is commonly described as a monolithic but modular kernel because many components can be added or removed as loadable modules. A microkernel keeps a smaller set of mechanisms in privileged space and moves more services into user-space processes. A hybrid kernel combines ideas from both approaches.

No architecture is automatically best in every situation. Moving services into user space can improve fault isolation and modularity, while keeping more services in kernel space can reduce communication overhead. Real designs therefore balance performance, maintainability, security, compatibility, and engineering complexity.


Processes, Threads, and Scheduling

A program is stored code; a process is an executing instance of a program with associated resources. A process normally has its own virtual address space, open resources, security context, and execution state. A thread is a sequence of execution within a process. Threads in the same process can share code, data, and other resources, which makes communication efficient but also creates synchronization challenges.

Operating systems track the state of processes or threads. Simplified state models often include ready, running, and waiting or blocked. A ready task can run but is waiting for processor time. A running task currently has a processor. A waiting task cannot continue until some event occurs, such as the completion of input/output. More detailed models may add new, terminated, suspended, or system-specific states.

The scheduler decides which runnable task should receive processor time. On a multitasking system, the scheduler may interrupt one task and allow another to execute. This change is called a context switch. Context switching is necessary for responsive multitasking, but it has overhead because the system must save and restore execution state.


Scheduling Strategies

Scheduling policies are judged using goals such as response time, waiting time, turnaround time, throughput, fairness, predictability, and meeting deadlines. A simple first-come, first-served policy is easy to understand but can make short tasks wait behind a long one. Round-robin scheduling gives each runnable task a time slice and then rotates among tasks. Priority scheduling favors tasks assigned higher priority, but it needs safeguards against starvation. Real operating systems use more sophisticated schedulers that adapt to multiple processors, interactive workloads, background work, and sometimes real-time constraints.

When you evaluate a scheduler, avoid asking only, "Which algorithm is fastest?" A better question is, "Fast for which workload and according to which metric?" An interactive system may value low response time, while a batch system may prioritize throughput. A safety-critical real-time system may care most about predictable deadlines.


Concurrency, Synchronization, and Deadlock

Concurrency means that multiple tasks make progress during overlapping periods. On a single processor this can occur through rapid switching; on a multicore processor tasks may truly execute at the same time. Concurrency improves responsiveness and resource utilization, but shared data creates the risk of a race condition, where the result depends on the timing of operations.

A critical section is a region of code that accesses shared data and must be coordinated. Operating systems and programming environments provide tools such as mutexes, semaphores, monitors, condition variables, and atomic operations. The goal is not merely to stop tasks from running together; good synchronization protects shared state while allowing as much useful parallelism as possible.

A deadlock occurs when a set of tasks cannot proceed because each is waiting for a resource or event that depends on another task in the set. Classic deadlock reasoning examines conditions such as mutual exclusion, holding resources while waiting, lack of forced resource removal, and circular waiting. Systems may prevent, avoid, detect, or recover from deadlocks depending on the problem domain.


Memory Management and Virtual Memory

Main memory is finite, fast, and shared by many programs. The operating system must allocate memory, protect one process from another, track which regions are in use, and reclaim memory when it is no longer needed. Modern systems usually give each process a virtual address space. The addresses used by a program are translated to physical memory locations by hardware working together with the operating system.

Paging divides virtual memory and physical memory into fixed-size units commonly called pages and frames. Page tables store mappings from virtual pages to physical frames and include protection information. A page fault occurs when a process accesses a page that is not currently mapped in the required way. Some page faults are expected and allow the system to load data on demand; others represent invalid accesses and may cause the process to fail.

Virtual memory provides isolation and flexibility. It can allow processes to use address spaces larger than the amount of physical RAM immediately available, but heavy movement of memory pages between RAM and storage can reduce performance dramatically. Therefore, the existence of virtual memory does not mean that storage is a substitute for adequate RAM.


Locality and Performance

Programs often show locality: they tend to reuse recently accessed instructions and data or access nearby locations. Caches, virtual memory, and storage systems exploit this behavior. If a working set no longer fits well in available memory, the computer may spend excessive time handling page faults and moving data instead of executing useful work. This severe performance collapse is often described as thrashing.

When diagnosing a slow system, you should therefore distinguish high CPU use, insufficient memory, slow storage, and blocked input/output. They can all make a computer feel slow, but they require different explanations and remedies.


Files, Storage, and Input/Output

A file system organizes persistent data and defines structures for files, directories, names, metadata, permissions, and storage allocation. Different file systems make different design choices, but users usually see a hierarchical namespace rather than raw blocks on a disk or solid-state drive.

In Unix-like systems, applications often interact with open files through file descriptors. The operating system maintains internal structures that connect a process's descriptor to information about an open file and ultimately to file-system metadata. The exact implementation differs among systems, but the important idea is that an application uses a managed abstraction rather than addressing storage hardware directly.

Input/output devices vary widely in speed and behavior. Device drivers translate general operating-system requests into device-specific operations. Interrupts allow hardware to signal the processor when attention is needed. Buffers and caches reduce the performance cost of waiting for slower devices, while queues help the system organize competing requests.


Booting: From Power-On to a Running System

Booting is a chain of trust and control transfers. After power-on or reset, firmware initializes essential hardware and identifies a bootable target. On many modern PCs, UEFI firmware can load a boot manager or bootloader from an EFI System Partition. The bootloader then loads the operating-system kernel and any required early-boot data. The kernel initializes memory management, drivers, processors, and core subsystems before starting the first user-space processes or services.

Exact boot details depend on hardware, firmware, and operating system. The important systems-thinking idea is that each stage prepares enough infrastructure for the next stage. Boot failures can therefore be investigated by asking which stage was reached successfully and what responsibility belongs to the next stage.


Security, Permissions, and Isolation

Operating-system security begins with the principle that code should receive only the authority it needs. Modern processors and operating systems support different privilege levels. Kernel code runs with privileges that ordinary applications do not have. User accounts, groups, file permissions, access-control lists, application sandboxes, and process isolation add further layers.

Authentication asks who a user or process is. Authorization asks what that identity is allowed to do. These ideas should not be confused. A system can correctly identify a user and still deny access to a protected file. The operating system also records security-relevant events, applies updates, controls device access, and supports mechanisms that make exploitation more difficult.

Security is not achieved by one feature. It depends on layers: hardware privilege, memory protection, kernel checks, permissions, secure configuration, timely updates, and careful application design. A weakness at one layer can sometimes be contained by another.


Virtualization and Containers

Virtualization allows one physical computer to host multiple isolated computing environments. A hypervisor presents virtual hardware to guest operating systems. In a type-1 design, the hypervisor runs directly on the physical platform; in a type-2 design, virtualization software runs above a host operating system. Virtual machines can provide strong isolation and allow different guest operating systems to share one physical server.

Containers use operating-system mechanisms to isolate groups of processes while sharing the host kernel. Because they do not normally boot a separate guest kernel for every container, containers can be lighter than full virtual machines. However, the shared-kernel model also means that their isolation boundary differs from that of a full virtual machine.

Virtualization is central to cloud computing, testing, server consolidation, and safe experimentation. It also illustrates a recurring operating-system idea: abstract a physical resource, define controlled interfaces, and isolate users of that resource from one another.


Comparing Common Operating-System Families

Windows, macOS, Linux distributions, Android, iOS, and many embedded or real-time systems solve similar resource-management problems but target different hardware, ecosystems, security models, and user needs. Comparing them only by interface appearance misses the important systems questions.

Useful comparison criteria include kernel architecture, supported hardware, process and memory model, file systems, security mechanisms, software-distribution model, update policy, command-line tools, virtualization support, licensing, and intended workload. For example, a desktop operating system may prioritize interactive responsiveness and broad device support, while an embedded real-time system may prioritize predictability and limited resource use.

When comparing systems, distinguish between the kernel and the complete operating-system environment. A kernel is central, but users also depend on system libraries, service managers, shells, graphical components, package managers, utilities, drivers, and applications.


Practical Investigation

You can study operating systems without modifying a kernel. On a school computer or virtual machine, system-monitoring tools can show running processes, CPU load, memory use, open files, storage activity, and network connections. On Unix-like systems, tools such as `ps`, `top`, `free`, `df`, `ls`, and system logs can reveal resource usage. On Windows, Task Manager, Resource Monitor, Event Viewer, and PowerShell provide similar evidence.

Use a virtual machine or a teacher-approved environment for experiments that change system settings. Record what you changed, what you expected, what happened, and how you restored the system. This habit is important in professional system administration because reproducibility and safe rollback matter as much as getting a result once.


Interactive Tasks


Quiz: Test Your Knowledge

What is the main role of an operating system? (To manage hardware resources and provide services to programs) (!To replace all application software) (!To store every file permanently in processor registers) (!To make computer networks unnecessary)




Which component normally runs with the highest operating-system privileges? (The kernel) (!A text editor) (!A web page) (!A user document)




What does a system call provide? (A controlled way for a program to request a kernel service) (!A method for bypassing all operating-system security) (!A permanent copy of every process) (!A replacement for physical memory)




Which statement best describes a process? (An executing program together with its managed resources) (!A file that can never be executed) (!A physical processor core) (!A network cable)




What is the purpose of CPU scheduling? (To choose which runnable task receives processor time) (!To decide the color of application windows) (!To encrypt every file automatically) (!To replace the boot firmware)




What can cause a race condition? (Unsynchronized access to shared state by concurrent tasks) (!Reading a file from permanent storage) (!Using a single process with no shared data) (!Turning off a computer after saving work)




What is virtual memory used to provide? (Protected virtual address spaces mapped to physical memory) (!A second physical processor inside every application) (!Unlimited storage with no performance cost) (!A direct cable between every process and the disk)




What is a page fault? (An event raised when a required virtual-memory page mapping is not currently usable) (!A defect that always means the computer hardware is broken) (!A file-name spelling error) (!A network protocol for printers)




What does a file system primarily organize? (Persistent data as files directories metadata and storage allocations) (!Only processor instructions currently in registers) (!Only wireless network packets) (!Only the graphical desktop background)




How do containers usually differ from full virtual machines? (Containers share the host kernel while isolating groups of processes) (!Containers always include a separate physical computer) (!Containers cannot run applications) (!Containers remove the need for an operating system)





Memory Game

Kernel Privileged core that manages critical system resources
Process Executing program together with operating-system-managed state
Thread Schedulable sequence of execution within a process
Scheduler Component that selects runnable work for processor time
System call Controlled request from a program for a kernel service
Page fault Event triggered when a required virtual-memory mapping needs attention
Filesystem Structure for organizing persistent files directories and metadata
Deadlock Situation in which tasks cannot progress because of circular waiting





Drag and Drop

Match the correct terms. Topic
User space Restricted execution area for ordinary applications
Context switch Change from executing one task to executing another
Virtual address Address used by a process before translation to physical memory
Device driver Software component that controls or communicates with specific hardware
Hypervisor Layer that creates and manages virtual machines






Crossword Puzzle

Kernel What privileged core manages hardware resources and protected services?
Scheduler What chooses which runnable task receives processor time?
Deadlock What term describes circular waiting that prevents progress?
Paging What memory-management technique divides address spaces into fixed-size units?
Filesystem What structure organizes files directories metadata and storage?
Interrupt What signal can make the processor pause normal execution to handle an event?





LearningApps


Cloze Text

Complete the text.
The privileged core of an operating system is the

. A running instance of a program is a

. A schedulable execution sequence inside a process is a

. Programs request protected operating-system services through a

. The component that selects runnable work for processor time is the

. Virtual memory divides address spaces into units that can be managed through

. An event caused by an unavailable or invalid virtual-memory mapping is a

. Persistent files and directories are organized by a

. A circular resource wait that prevents tasks from making progress is a

. Software that creates and manages virtual machines is called a

.




Open-Ended Tasks


Easy

  1. Operating System Inventory: List the operating systems used by devices in your home or classroom and identify one likely resource-management task performed by each.
  2. Task Manager Observation: Open an approved system-monitoring tool, observe CPU and memory use while launching an application, and write a short explanation of what changed.
  3. Process State Diagram: Draw a clear diagram showing ready, running, and waiting states and add one realistic transition example for each arrow.
  4. Operating System Explainer: Create a one-minute audio or video explanation that tells a younger learner why a computer needs an operating system.


Standard

  1. Scheduling Simulation: Simulate first-come first-served and round-robin scheduling with at least four invented tasks, then compare waiting time and responsiveness.
  2. Virtual Memory Investigation: Use an approved monitoring tool or virtual machine to observe memory use while several applications run, then explain which evidence suggests pressure on RAM.
  3. File Permission Study: In a safe test directory, compare read, write, and execute permissions for different users or roles and document the results with screenshots or a table.
  4. Operating System Interview: Interview a system administrator, IT technician, developer, or experienced user about one real operating-system problem and summarize how it was diagnosed.


Advanced

  1. Concurrency Experiment: Write or adapt a small teacher-approved program that demonstrates a race condition, then add synchronization and explain why the behavior changes.
  2. System Call Trace: In a safe Unix-like virtual machine, trace the system calls of a simple command and classify several calls by purpose such as files, processes, or memory.
  3. Virtualization Comparison: Build a comparison of a full virtual machine and a container using the same small workload, then evaluate startup time, isolation, resource use, and management complexity.
  4. Operating System Design Proposal: Design an operating system for a specific scenario such as a medical device, gaming console, school laptop, or sensor network and justify your choices for scheduling, memory, security, storage, and updates.



Learning Assessment

  1. Resource Management Analysis: Given a scenario in which several applications compete for CPU, memory, and storage, explain which operating-system subsystems are involved and how they interact.
  2. Scheduling Decision: Compare two scheduling strategies for an interactive classroom computer and justify which policy better fits the workload using at least two measurable criteria.
  3. Concurrency Diagnosis: Analyze a short scenario in which two threads update shared data and explain how a race condition could occur and how synchronization could prevent it.
  4. Memory Performance Case: A computer has frequent page faults and high storage activity while many programs are open; explain a likely cause, identify evidence you would collect, and propose a safe response.
  5. Security Transfer Task: Explain how user mode, kernel mode, permissions, and least privilege work together to limit the effect of a faulty or malicious application.
  6. Architecture Evaluation: Compare a monolithic kernel, a microkernel, and a virtualized design for a chosen system and defend your recommendation by discussing performance, isolation, maintainability, and complexity.




Evidence of Learning

  1. Knowledge: You can explain kernels, system calls, processes, threads, scheduling, concurrency, virtual memory, file systems, booting, security, and virtualization using precise terminology.
  2. Analytical skills: You can interpret diagrams and monitoring evidence, trace cause-and-effect relationships among operating-system subsystems, and compare designs using explicit criteria.
  3. Practical skills: You can use approved system-monitoring or virtual-machine tools safely, record observations, and distinguish evidence from assumptions.
  4. Products: You can create diagrams, short technical explanations, comparison tables, experiment reports, interview summaries, or system-design proposals that communicate your reasoning.
  5. Transfer: You can apply operating-system concepts to unfamiliar devices or scenarios and justify why different workloads require different trade-offs.




OERs on the Topic

The English Wikipedia article below provides a broad reference for terminology, history, architecture, process management, memory management, storage, security, and examples of operating systems.

You can also explore kernels, processes, threads, virtual memory, file systems, system calls, computer security, and virtualization as connected learning topics.



Linked Learning Areas

Operating systems connect computer science with computer architecture, software engineering, cybersecurity, networking, cloud computing, and professional fields such as system administration, software development, IT support, embedded systems engineering, and security analysis.


aiMOOC Projects