There’s an interesting history for this post, I gave an interview at IBM for a compiler engineering position. The discussion was so fun and revolved around everything from C to Low level compiler and OS stuff including computer architecture level intricacies. We delved deep into the privilege escalation(user to kernel mode), runtime stack, and eventually syscalls, interrupts/TRAP. Basic question was the difference between an interrupt and a syscall which anyone can answer but it gets interesting when we start looking at the syscall as a main character.

How on earth it even understand that it needs to take these many arguments, it is being called, and the implementation of it. How syscall acts as a jump between user and kernel mode? So, the motivation of the post comes from this experience.