The dynamic loader finds and loads executables and shared libraries when a program is run.
Starting an executable
Read the executable's header to determine data and text segment sizes.
Create address space for these segments plus stack.
Copy data and text segments into created address space.
Copy program arguments onto stack.
Initialize registers. Most of them are just cleared, however, esp is set to point to stack's top.
Jump to a
start up routine (
main?). This routine should call the
exit syscall when the executable is done with its work.