IB AQA Computer Science: Operating Systems Essentials | IB AQA 计算机:操作系统核心考点

📚 IB AQA Computer Science: Operating Systems Essentials | IB AQA 计算机:操作系统核心考点

Operating systems (OS) form the backbone of every computing device, managing hardware resources and providing essential services for application software. This revision guide covers the key concepts required for the IB AQA Computer Science examination, including process management, memory allocation, file systems, and security. Understanding these principles is crucial for answering both theoretical and scenario-based questions.

操作系统(OS)是每台计算设备的骨干,它管理硬件资源并为应用软件提供基本服务。本复习指南涵盖了IB AQA计算机科学考试所需的核心概念,包括进程管理、内存分配、文件系统和安全。理解这些原理对于解答理论题和情境题至关重要。


1. What is an Operating System? | 什么是操作系统?

An operating system is a layer of software that sits between the hardware and the user or application programs. It hides the complexity of the hardware by providing a uniform interface, such as system calls and a graphical user interface (GUI). Common examples include Microsoft Windows, Linux, macOS, and Android.

操作系统是介于硬件与用户或应用程序之间的一层软件。它通过提供统一的接口(如系统调用和图形用户界面)隐藏硬件的复杂性。常见的例子包括微软 Windows、Linux、macOS 和 Android。

The OS kernel is the core component that manages the CPU, memory, and I/O devices. It operates in privileged mode, while user applications run in user mode to prevent direct access to critical hardware resources, thus ensuring system stability and security.

操作系统内核是管理 CPU、内存和 I/O 设备的核心组件。它运行在特权模式下,而用户应用程序运行在用户模式下,以防止直接访问关键的硬件资源,从而确保系统的稳定性和安全性。


2. Functions of an Operating System | 操作系统的主要功能

The OS performs several critical functions: process management, memory management, file system management, I/O device management, security and access control, and providing a user interface. Each function is implemented through specific algorithms and data structures.

操作系统执行多项关键功能:进程管理、内存管理、文件系统管理、I/O 设备管理、安全与访问控制,以及提供用户界面。每项功能都通过特定的算法和数据结构来实现。

  • Process Management: Creates, schedules, and terminates processes; handles inter-process communication (IPC).
  • Memory Management: Allocates RAM to processes, keeps track of used and free memory, and implements virtual memory.
  • File System: Organises data into files and directories, provides read/write operations, and controls access permissions.
  • I/O Management: Manages communication between the CPU and peripheral devices using device drivers.
  • Security: Protects system resources from unauthorised access through authentication and authorisation.
  • 进程管理:创建、调度和终止进程;处理进程间通信(IPC)。
  • 内存管理:为进程分配内存,跟踪已用和空闲内存,并实现虚拟内存。
  • 文件系统:将数据组织成文件和目录,提供读/写操作,并控制访问权限。
  • I/O 管理:利用设备驱动程序管理 CPU 与外围设备之间的通信。
  • 安全:通过身份验证和授权防止未授权访问系统资源。

3. Types of Operating Systems | 操作系统的类型

Operating systems can be classified based on their purpose and architecture: batch, time-sharing, real-time, distributed, and embedded. Each type is optimised for different workloads.

操作系统可以根据其用途和架构进行分类:批处理、分时、实时、分布式和嵌入式。每种类型都为不同的工作负载进行了优化。

In a time-sharing system, the CPU switches rapidly between processes to give the illusion of concurrent execution. This is common in modern desktop OSs. Real-time OS ensures deterministic response times, which is essential for systems like airbags or medical devices.

在分时系统中,CPU 在进程之间快速切换,营造出并发执行的假象。这常见于现代桌面操作系统。实时操作系统确保确定性的响应时间,对于安全气囊或医疗设备等系统至关重要。

Batch systems execute jobs without user interaction, often used in large-scale data processing. Embedded operating systems are compact and designed for specific hardware, such as those found in smartwatches or IoT devices.

批处理系统无需用户交互即可执行作业,常用于大规模数据处理。嵌入式操作系统结构紧凑,专为特定硬件设计,例如智能手表或物联网设备中的系统。


4. Processes and Process States | 进程与进程状态

A process is a program in execution. The OS maintains a process control block (PCB) for each process, storing its state, program counter, register values, and memory allocation. Process states include: new, ready, running, waiting, and terminated.

进程是正在执行的程序。操作系统为每个进程维护一个进程控制块(PCB),存储其状态、程序计数器、寄存器值和内存分配。进程状态包括:新建、就绪、运行、等待和终止。

The state transitions follow specific rules: a process moves from new to ready when admitted, from ready to running when dispatched by the scheduler, from running to waiting if it needs I/O, and back to ready when the I/O completes.

状态转换遵循特定的规则:进程被接纳后从新建变为就绪;被调度器分派时从就绪变为运行;若需要 I/O 则从运行变为等待;I/O 完成后回到就绪状态。

Process State Diagram: New → Ready → Running → Waiting → Ready (or Terminated)

进程状态图:新建 → 就绪 → 运行 → 等待 → 就绪(或终止)


5. Scheduling Algorithms | 调度算法

The CPU scheduler decides which ready process to execute next. Key algorithms include First-Come, First-Served (FCFS), Shortest Job First (SJF), Round Robin (RR), and Priority Scheduling. Each has different performance characteristics in terms of throughput, waiting time, and fairness.

CPU 调度器决定下一个要执行的就绪进程。主要的算法包括先来先服务(FCFS)、最短作业优先(SJF)、轮转调度(RR)和优先级调度。每种算法在吞吐量、等待时间和公平性方面具有不同的性能特点。

Algorithm Key Feature 中文
FCFS Non-preemptive, simple queue 非抢占式,简单队列
SJF Minimises average waiting time; requires prediction of burst time 最小化平均等待时间;需预估运行时间
Round Robin Preemptive, uses time quantum; good for time-sharing 抢占式,使用时间片;适合分时系统
Priority Can be static or dynamic; risk of starvation 可静态或动态;存在饥饿风险

Round Robin is widely used in interactive systems because it prevents starvation and ensures that all processes get regular CPU time. The choice of time quantum is critical: too small leads to excessive context switches; too large degrades to FCFS.

轮转调度广泛用于交互式系统,因为它防止了饥饿现象,并确保所有进程都能定期获得 CPU 时间。时间片的选择至关重要:太小会导致过多的上下文切换;太大则退化为 FCFS。


6. Memory Management | 内存管理

Memory management aims to allocate RAM space to processes efficiently while protecting their address spaces. Early systems used contiguous allocation with partitions, but modern OSs use paging or segmentation.

内存管理旨在高效地为进程分配内存空间,同时保护其地址空间。早期系统使用具有分区的连续分配,但现代操作系统使用分页或分段。

Paging divides physical memory into fixed-size blocks called frames, and logical memory into pages of the same size. A page table maps each virtual page to a physical frame, allowing non-contiguous allocation and eliminating external fragmentation.

分页将物理内存划分为称为帧的固定大小块,并将逻辑内存划分为相同大小的页。页表将每个虚拟页映射到一个物理帧,从而实现非连续分配并消除外部碎片。

Segmentation divides memory into variable-sized segments based on logical units like code, data, and stack. It aligns with the programmer’s view but can cause external fragmentation. Some systems use a combination of paged segmentation.

分段根据逻辑单元(如代码、数据和栈)将内存划分为可变大小的段。它符合程序员的视角,但可能导致外部碎片。有些系统使用段页式结合。


7. Virtual Memory and Page Replacement | 虚拟内存与页面置换

Virtual memory allows execution of processes that are not completely in physical memory. This is achieved by storing parts of the process on disk and loading only the necessary pages when referenced, using demand paging.

虚拟内存允许执行不完全在物理内存中的进程。这是通过将进程的一部分存储在磁盘上,仅在需要引用时才加载必要页面的请求调页实现的。

When a page fault occurs (the required page is not in memory), the OS must load it from disk

Published by TutorHao | IB Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading