Explain the transition from user space to kernel space during the execution of `execl()`. What role does the `syscall` instruction play in this process?
Firstly, a system call is made to request services from the kernel, involving a switch from user space to kernel space.
The execve function triggers a system call using a special instruction that causes a trap to the kernel. On most system, it is done using syscall instruction.
The syscall instruction requires the system call number and arguments to be place in the specific CPU registers.
The system call number for execve is placed in the 'rax' register.
The arguments(path,array and environment array) are stored in registers rdi,rsi and rdx respectively.
When syscall is executed, the CPU switches to kernel mode, and control is transferred to a predefined entry point in the kernel, through an interrupt or a trap handler.