Can anyone help me understand why transitioning to kernel mode is architecture-dependent? I’m not clear on why the linux system call kernel entry code in arch/x86/entry/common.c has to be in assembly, instead of C.
> The hardware severely restricts the ways in which control can be passed from one ring to another, and also enforces restrictions on the types of memory access that can be performed across rings. Using x86 as an example, there is a special gate structure which is referenced by the call instruction that transfers control in a secure way.
https://en.wikipedia.org/wiki/Protection_ring#Implementation...