The boot code performs minimum configuration which is required for an application to run starting from processor's reset state. Below is a sequence illustrating what all configuration is performed before control reaches the main function.
- Initialize mtvec CSR for unhandled exceptions and interrupts
- Initialize processor registers to 0
- Program stack pointer
- Initialize floating-point registers to +0.0
- Set the stack top to zero, to ensure that main program argc is zero
- Transfer control to _start, which clears BSS sections and jumps to the main application