Describe the transition from user space to kernel space when the `execve()` system call is triggered by `execl()`. What is the role of the `syscall` instruction in this transition?
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.