《操作系统》CPU如何区分正在运行的是内核程序or应用程序? 您所在的位置:网站首页 内核程序如何运行代码 《操作系统》CPU如何区分正在运行的是内核程序or应用程序?

《操作系统》CPU如何区分正在运行的是内核程序or应用程序?

2024-02-03 18:48| 来源: 网络整理| 查看: 265

The running process of a program is actually the process that the CPU executes a machine instruction. 程序的运行过程实际上是CPU执行机器指令的过程。

The CPU is divided into two state: “kernel mode” and “user mode”. CPU分为两种状态:“内核模式”和“用户模式”。

When it is in kernel mode, it means that the kernel program is running and can execute privieged instructions. When in user mode, it means that the application program is running and can only execute non privileged instructions. 当它处于内核模式时,意味着内核程序正在运行并且可以执行特权指令。在用户模式下,这意味着应用程序正在运行,并且只能执行非特权指令。

In fact, there is a register in the CPU called Program Status Word(PSW) register, in which there is a binary bit 1 represents “kernel mode”, 0 represents “user mode”(some operating system are the opposite). 实际上,CPU中有一个寄存器叫做程序状态字(PSW)寄存器,其中有一个二进制位1表示“内核模式”,0表示“用户模式”(有些操作系统则相反)。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有