Process execution steps
To have a process executed from an executable file, the user space and the kernel space take some general steps in most operating systems. As we noted in the previous section, executable files are mostly executable object files, for example, ELF, Mach, or script files that need an interpreter to execute them.
From the user ring's point of view, a system call like exec
should be invoked. Note that we don't explain the fork
system call here because it is not actually an execution. It is more of a cloning operation of the currently running process.
When the user space invokes the exec
system call, a new request for the execution of the executable file is created within the kernel. The kernel tries to find a handler for the specified executable file based on its type and according to that handler, it uses a loader program to load the contents of the executable file.
Note that for the script files, the executable binary of the interpreter...