urt: crti: Exit instead of an infinite loop
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -6,10 +6,16 @@
|
|||||||
* Author: Chloe M.
|
* Author: Chloe M.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ptapi/syscall.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.globl _start
|
.globl _start
|
||||||
_start:
|
_start:
|
||||||
xor %rbp, %rbp /* Terminate callstack */
|
xor %rbp, %rbp /* Terminate callstack */
|
||||||
call Main /* Enter program main */
|
call Main /* Enter program main */
|
||||||
1: pause
|
|
||||||
jmp 1b
|
push %rax /* Push the status code */
|
||||||
|
mov $SYS_EXIT, %rax /* Prepare the exit */
|
||||||
|
pop %rdi /* Pop the status code */
|
||||||
|
int $0x2E /* To the reaper queue we go */
|
||||||
|
ud2
|
||||||
|
|||||||
Reference in New Issue
Block a user