← 返回资讯屏轩教育 · 行业资讯

System Software, Application Software and Interrupt Handling | 系统软件、应用软件与中断处理

2026-08-30 14:27 · 本文部分内容由AI辅助创作

📚 System Software, Application Software and Interrupt Handling | 系统软件、应用软件与中断处理

In the study of computer science, software is generally divided into two broad categories: system software and application software. System software manages the hardware and provides a platform for applications, while application software helps users perform specific tasks. Interrupt handling is a core mechanism that allows the operating system to respond to events quickly and efficiently.

在计算机科学的学习中,软件通常被分为两大类:系统软件和应用软件。系统软件管理硬件并为应用程序提供运行平台,而应用软件帮助用户完成特定任务。中断处理是操作系统能够快速、高效响应事件的核心机制。


1. Classification of Software | 软件分类

Software can be classified according to its purpose and level of interaction with hardware. The two main categories are system software and application software. System software includes the operating system and utility programs, while application software includes word processors, web browsers, spreadsheets, and many other user-facing programs.

软件可以根据其用途以及与硬件交互的层次进行分类。两大主要类别是系统软件和应用软件。系统软件包括操作系统和实用程序,应用软件则包括文字处理器、网页浏览器、电子表格以及许多其他面向用户的程序。

System software is essential for the computer to function, as it controls the hardware and provides an interface for application software. Application software, on the other hand, is not essential for the computer to boot, but it is what makes the computer useful for everyday tasks.

系统软件对于计算机的运行至关重要,因为它控制硬件并为应用软件提供接口。另一方面,应用软件对于计算机启动并非必需,但它使计算机在日常任务中变得有用。


2. System Software | 系统软件

System software is a collection of programs designed to operate and control the hardware of a computer. It provides a platform for running application software and manages system resources such as memory, processors, storage, and input/output devices. The most important type of system software is the operating system (OS).

系统软件是一组旨在操作和控制计算机硬件的程序集合。它提供了运行应用软件的平台,并管理系统资源,如内存、处理器、存储以及输入/输出设备。最重要的系统软件类型是操作系统(OS)。

Besides the operating system, system software also includes device drivers, firmware, and utility programs. Device drivers enable the OS to communicate with specific hardware, while firmware is software stored in read-only memory that provides low-level control for hardware components.

除操作系统外,系统软件还包括设备驱动程序、固件和实用程序。设备驱动程序使操作系统能够与特定硬件通信,而固件是存储在只读存储器中的软件,为硬件组件提供低级控制。


3. Functions of an Operating System | 操作系统的功能

The operating system performs several critical functions. It manages the processor by scheduling processes, manages memory by allocating and freeing memory space, manages files by organising data on storage devices, and manages input/output devices by controlling data transfer.

操作系统执行多项关键功能。它通过调度进程来管理处理器,通过分配和释放内存空间来管理内存,通过在存储设备上组织数据来管理文件,并通过控制数据传输来管理输入/输出设备。

Additionally, the OS provides a user interface, which may be command-line based or graphical. It also handles security by protecting files and processes from unauthorised access, and it provides error-handling routines for detecting and responding to hardware and software errors.

此外,操作系统提供用户界面,可以是基于命令行或图形化的。它还通过保护文件和进程免受未授权访问来处理安全性,并提供错误处理例程用于检测和响应硬件与软件错误。

Operating system = resource manager + user interface + security manager

操作系统 = 资源管理器 + 用户界面 + 安全管理器


4. Utility Software | 实用程序

Utility software is a type of system software that helps maintain, optimise, and configure the computer system. Examples include antivirus programs, disk defragmenters, backup tools, compression tools, and file management utilities.

实用程序是一种帮助维护、优化和配置计算机系统的系统软件。常见的例子包括防病毒程序、磁盘碎片整理工具、备份工具、压缩工具和文件管理实用程序。

Utilities are usually smaller than the operating system and focus on a specific task. For example, a disk defragmenter rearranges fragmented data on a hard disk to improve read/write speed, while a backup utility copies important data to another location for safety.

实用程序通常比操作系统小,并且专注于特定任务。例如,磁盘碎片整理程序重新排列硬盘上的碎片数据以提高读写速度,而备份工具则将重要数据复制到另一位置以确保安全。


5. Application Software | 应用软件

Application software is designed to help users perform specific tasks such as writing documents, creating spreadsheets, editing images, browsing the internet, or managing databases. Applications rely on the operating system to access hardware and system resources.

应用软件旨在帮助用户执行特定任务,例如撰写文档、创建电子表格、编辑图像、浏览互联网或管理数据库。应用程序依赖操作系统来访问硬件和系统资源。

Application software can be divided into general-purpose software and bespoke software. General-purpose software, such as office suites, is widely used across many organisations. Bespoke software, such as a hospital patient management system, is written specifically for one client or purpose.

应用软件可以分为通用软件和定制软件。通用软件如办公套件,广泛应用于许多组织。定制软件如医院患者管理系统,是专门为某一客户或用途编写的。

Unlike system software, application software is not required for the computer to boot. However, without application software, users would be unable to carry out productive or recreational tasks easily.

与系统软件不同,应用软件不是计算机启动所必需的。但是,如果没有应用软件,用户将难以轻松完成生产性或娱乐性任务。


6. Interaction between Software and Hardware | 软件与硬件的交互

When an application program needs to access hardware, it makes a request to the operating system rather than directly controlling the hardware. This is known as a system call. The OS then translates the request into low-level instructions that the hardware can understand.

当应用程序需要访问硬件时,它向操作系统发出请求,而不是直接控制硬件。这称为系统调用。操作系统随后将该请求转换为硬件能够理解的低级指令。

For example, when a user clicks "Save" in a word processor, the application sends a system call to the OS. The OS checks file permissions, manages the storage device, and writes the data. This protects the hardware from misuse and ensures that multiple applications can share resources safely.

例如,当用户在文字处理器中点击“保存”时,应用程序向操作系统发送系统调用。操作系统检查文件权限、管理存储设备并写入数据。这保护了硬件免遭误用,并确保多个应用程序可以安全地共享资源。

Interrupts are critical in this interaction. They allow hardware to signal the CPU when an event occurs, such as a key press or a disk operation completing, without the CPU needing to constantly check for such events.

中断在这种交互中至关重要。它们允许硬件在事件发生时向CPU发出信号,例如按键或磁盘操作完成,而无需CPU不断轮询这些事件。


7. Concept of Interrupts | 中断的概念

An interrupt is a signal sent to the processor that indicates an event requiring immediate attention. It causes the CPU to temporarily suspend its current execution, save the current state, and transfer control to an interrupt service routine (ISR) that handles the event.

中断是发送给处理器的信号,表示有需要立即处理的事件。它使CPU暂时挂起当前执行,保存当前状态,并将控制权转移到处理该事件的中断服务例程(ISR)。

Interrupts can be generated by hardware devices, such as a keyboard or network adapter, or by software, such as a division by zero error or a system call. They provide an efficient way for the CPU to respond to asynchronous events.

中断可以由硬件设备生成,例如键盘或网络适配器,也可以由软件生成,例如除零错误或系统调用。它们为CPU响应异步事件提供了一种高效的方式。

Interrupt → CPU saves context → executes ISR → restores context → resumes original program

中断 → CPU保存上下文 → 执行ISR → 恢复上下文 → 继续原程序


广告 / Sponsored

8. Types of Interrupts | 中断类型

Interrupts are commonly classified into hardware interrupts and software interrupts. Hardware interrupts are generated by external devices, such as a mouse click, a timer expiring, or a data packet arriving. Software interrupts are generated by programs, often for system calls or to handle exceptions.

中断通常分为硬件中断和软件中断。硬件中断由外部设备产生,例如鼠标点击、定时器超时或数据包到达。软件中断由程序产生,通常用于系统调用或处理异常。

Interrupts can also be classified as maskable and non-maskable. Maskable interrupts can be temporarily ignored by the CPU, whereas non-maskable interrupts, such as a power failure or a hardware malfunction, must always be processed immediately.

中断还可以分为可屏蔽中断和不可屏蔽中断。可屏蔽中断可以被CPU暂时忽略,而不可屏蔽中断,例如电源故障或硬件故障,必须始终立即处理。


9. Interrupt Handling Process | 中断处理过程

The process of handling an interrupt follows a standard sequence. First, the CPU finishes the current instruction and checks for pending interrupts. If an interrupt is present and it has higher priority than the current task, the CPU acknowledges it.

处理中断的过程遵循标准顺序。首先,CPU完成当前指令并检查是否有待处理的中断。如果存在中断且其优先级高于当前任务,CPU则确认该中断。

Next, the CPU saves the current program counter and the processor status register onto the stack or into a reserved area. This saved state is called the context. The CPU then loads the address of the relevant interrupt service routine and executes it.

接下来,CPU将当前程序计数器和处理器状态寄存器保存到堆栈或保留区域。保存的状态称为上下文。然后CPU加载相应中断服务例程的地址并执行它。

Finally, after the ISR completes, the CPU restores the saved context and continues executing the original program from the point where it was interrupted. The entire sequence is very fast and occurs transparently to the user.

最后,在ISR完成后,CPU恢复保存的上下文,并从被中断的位置继续执行原程序。整个过程速度非常快,对用户来说是透明的。

Step Action 说明
1 Complete current instruction 完成当前指令
2 Save context (PC, status registers) 保存上下文(PC、状态寄存器)
3 Load ISR address 加载ISR地址
4 Execute ISR 执行ISR
5 Restore context and resume original program 恢复上下文并继续原程序

10. Priority and Nested Interrupts | 优先级与中断嵌套

Multiple interrupts can occur at the same time. To handle this fairly, each interrupt source is assigned a priority level. The CPU will typically process the highest-priority interrupt first. If a higher-priority interrupt arrives while a lower-priority ISR is being executed, the CPU may preempt the lower-priority ISR.

多个中断可能同时发生。为了公平处理,每个中断源被分配一个优先级。CPU通常会先处理优先级最高的中断。如果在执行较低优先级ISR期间到达了一个更高优先级的中断,CPU可能会抢占该较低优先级的ISR。

This ability is called nested interrupt handling. It requires the ISR to save the current context again, so that after servicing the higher-priority interrupt, the CPU can return to the previous ISR. Non-nested systems complete one ISR before accepting another interrupt.

这种能力称为中断嵌套处理。它要求ISR再次保存当前上下文,以便在处理完高优先级中断后,CPU能够返回到之前的ISR。非嵌套系统则在接受另一个中断之前完成一个ISR。

Priority order: hardware error > timer > I/O device > software interrupt

优先级顺序:硬件错误 > 定时器 > I/O设备 > 软件中断


11. Role of Interrupts in System Software | 中断在系统软件中的作用

Interrupts are fundamental to the operation of modern system software. They allow the operating system to manage multiple processes by using timer interrupts to switch between tasks. Each time the timer interrupt fires, the OS can decide whether to give the CPU to another process.

中断是现代系统软件运行的基础。它们允许操作系统使用定时器中断来切换多个进程。每次定时器中断触发时,操作系统可以决定是否将CPU交给另一个进程。

Interrupts also allow input/output devices to operate efficiently. Instead of the CPU waiting for a keyboard key or a network packet in a busy loop, the device can send an interrupt when it has data ready. This is known as interrupt-driven I/O.

中断还使输入/输出设备能够高效运行。CPU无需在忙循环中等待键盘按键或网络数据包,设备可以在数据准备好时发送中断。这称为中断驱动I/O。

System calls are implemented using software interrupts. When an application needs an operating system service, it triggers a software interrupt, causing the CPU to switch into kernel mode and run the appropriate OS routine. This ensures controlled access to hardware resources.

系统调用通过软件中断实现。当应用程序需要操作系统服务时,它会触发软件中断,使CPU切换到内核模式并运行相应的操作系统例程。这确保了硬件资源的受控访问。


12. Summary | 总结

In summary, software is divided into system software and application software. System software includes the operating system, device drivers, and utilities, while application software serves user-specific needs. The operating system acts as an intermediary between applications and hardware.

总之,软件分为系统软件和应用软件。系统软件包括操作系统、设备驱动程序和实用程序,而应用软件满足用户的特定需求。操作系统充当应用程序与硬件之间的中介。

Interrupt handling is a crucial mechanism that makes operating systems responsive and efficient. By allowing hardware and software to signal the CPU, interrupts enable multitasking, event-driven I/O, and reliable system control. Understanding interrupts is therefore essential for any computer science student.

中断处理是使操作系统响应迅速且高效的关键机制。通过允许硬件和软件向CPU发出信号,中断实现了多任务、事件驱动I/O和可靠的系统控制。因此,理解中断对任何计算机科学学生都至关重要。


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

广告 / Sponsored
现货 Cambridge International AS & ALevel IT Coursebook剑桥国际IGC…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥467.0

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

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao