/** * @file crt0.S * @brief C runtime startup for user-mode applications. * * Calls the C main() function and then exits with the return value. */ .section .text .global _start .extern main _start: /* Call main() */ call main /* Exit with main's return value (in EAX) */ movl %eax, %ebx /* exit code = return value */ movl $0, %eax /* SYS_EXIT = 0 */ int $0x80 /* Should never reach here */ 1: jmp 1b