加入收藏 | 设为首页 | 会员中心 | 我要投稿 衡阳站长网 (https://www.0734zz.cn/)- 数据集成、设备管理、备份、数据加密、智能搜索!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

ARM系统模式与arm管理员模式有何不同?

发布时间:2020-12-31 15:48:20 所属栏目:Linux 来源:网络整理
导读:为了将ARM处理器模式与x86操作模式(ring0到ring 3)进行比较,用户模式看起来就像ring3,用户空间程序在其中运行. 但是我无法将ring0与系统模式或管理员模式联系起来.根据信息来源,似乎两种模式都可以很好地完成在特权模式下运行内核的工作. 我能找到的两种模式

为了将ARM处理器模式与x86操作模式(ring0到ring 3)进行比较,用户模式看起来就像ring3,用户空间程序在其中运行.
但是我无法将ring0与系统模式或管理员模式联系起来.根据信息来源,似乎两种模式都可以很好地完成在特权模式下运行内核的工作.
我能找到的两种模式之间的唯一区别是:

>寄存器13和14以管理员模式存储,而对于系统模式,所有15个寄存器都相同.
>系统模式不能直接在异常上输入,而管理员模式可以.
>系统模式以某种方式防止链接寄存器的损坏.

你能解释一下这些模式之间的差异吗,来自x86背景的人可以理解吗?

另外,模式之间的细微架构差异(如库存寄存器的数量)如何使一个优于另一个?

解决方法

我认为ARM ARM非常清楚(见下文),不要认为X86只考虑这种处理器模式允许你做什么或不做什么.您需要在操作系统中使用哪些模式以及哪些模式有用.

您有用户和系统,然后是异常模式.他们的限制记录在AFAIK中.较新的ARM具有更多功能/限制/保护等.

来自ARM ARM

Most application programs execute in User mode. When the processor is
in User mode,the program being executed is unable to access some
protected system resources or to change mode,other than by causing an
exception to occur (see Exceptions on page A2-16). This allows a
suitably-written operating system to control the use of system
resources. The modes other than User mode are known as privileged
modes. They have full access to system resources and can change mode
freely. Five of them are known as exception modes:

-FIQ

-IRQ

-Supervisor

-Abort

-Undefined.

These are entered when specific exceptions occur. Each of them has
some additional registers to avoid corrupting User mode state when the
exception occurs (see Registers on page A2-4 for details).

The remaining mode is System mode,which is not entered by any
exception and has exactly the same registers available as User mode.
However,it is a privileged mode and is therefore not subject to the
User mode restrictions. It is intended for use by operating system
tasks that need access to system resources,but wish to avoid using
the additional registers associated with the exception modes. Avoiding
such use ensures that the task state is not corrupted by the
occurrence of any exception.

监督模式是你在进行svc或sys调用时所遇到的(同样的指令我认为他们改变了svc的名称).类似于dos天中的int 21h,这就是你如何从没有任何权限的用户模式,请求操作系统做某事.这会将控制切换到管理员模式,然后一旦处于管理员模式,您可以在那里处理或切换模式等…一旦切换到用户,但您无法切换.因此,例如,如果要设置用户堆栈,则无法在用户模式下轻松执行此操作,然后返回操作系统任务.所以你需要一个特权模式,如果没有别的用户注册访问权限.

(编辑:衡阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读