So one thing I'm not clear on is why transitioning from user space to kernel space is architecture-dependent. For example, the linux kernel v5.4 code for system calls entering kernel space is different for x86 vs different architectures, and contains architecture-dependent assembly instructions, rather than just C code.
Why is this exactly? Why can't the entire linux kernel just be written in C...?
Any thoughts appreciated.
Thanks.