3 ms·
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/x
by wallscratch 5y ago
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.
- jackhalford 5y agotransitioning to kernel mode requires a context switch, which is inherently a cpu operation, i.e it works differently on different architectures.
- voxic11 5y agoThe mode is actually tracked/enforced by the CPU but the implementation differs per architecture. For example: > 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#Implementations https://en.wikipedia.org/wiki/Protection_ring#Implementation...