How is ARM system mode different from hand manager mode?

To compare ARM processor modes with x86 operating modes (ring0 to ring 3), user mode looks the same as ring3, in which user space programs are run. However, I cannot associate ring0 with system mode or supervisor mode. Depending on the source of information, it seems that both modes can do a very good job of starting the kernel in privileged mode. The only differences between the two modes that I could figure out are as follows:

  • registers 13 and 14 are in supervisor mode, while for system mode all 15 registers are the same.
  • System mode cannot be entered directly into the exception, while supervisor mode can be.
  • System mode somehow prevents link register corruption.

Could you explain to me the differences between the modes that a person from x86 background can understand?

Also, how do subtle architectural differences between modes, such as the number of bank registers, make one better than the other?

+5
source share
1 answer

I think ARM ARM makes this pretty clear (see below), don’t think that the X86 will just think about what the processor modes allow you to do or not to do. And what do you need in the operating system and what modes are useful or not.

You have a user and a system, and then exception modes. Their limitations are documented by AFAIK. New ARMs have even more features / limitations / protection, etc.

From ARM ARM

Most applications run in user mode. When the processor in user mode, the executable program cannot access some protected system resources or to change the mode except for the exception (see Exceptions on page A2-16). This allows a suitable written operating system to manage the use of the system resources. Modes other than user mode are known as privileged modes. They have full access to system resources and can change the mode freely. Five of them are known as exception modes:

-FIQ

-IRQ

-Supervisor

-Abort

-. Undefined

They are introduced when certain exceptions occur. Each of them has some additional registers in order to avoid distortion of the user mode state when an exception occurs (see "Registers" on page A2-4).

The remaining mode is the system mode, which is not introduced by any exception and has exactly the same registers as in user mode. However, this is privileged mode and therefore is not subject to user mode restrictions. It is intended for use by the operating system tasks that require access to system resources, but do not want to use additional registers associated with exception modes. Avoiding such use ensures that the state of the task is not distorted by the occurrence of any exception.

Supervisor mode is what you press when you make an svc or sys call (same instruction, I think they changed the name from svc). Like int 21h on dos days, so you, from user mode without any permissions, ask the operating system to do something. This switches the control to supervisor mode, and then once in supervisor mode you can process it there or switch modes, etc. After you switch to the user, although you cannot disconnect. So, for example, if you want to configure the user stack, you can easily do this in user mode, and then return to the tasks of the operating system. therefore, you need privileged mode, which, if nothing else, has access to the user register.

+2
source

All Articles