Shashank Jain, Nov 11, 2018. In today’s blog we attempt to write a system call using plain assembly code.
Before that lets understand what a system call is. A system call allows a userspace program to interface with kernel. The protection mechanism provided by Linux doesn’t allow a userspace program to directly invoke the Kernel. Instead it needs cooperation with some hardware via software interrupts to transition from userspace to kernel space. This prevents userspace program to interfere with the kernel protection mechanisms.