From 2bab877a7d37b92a3fee3e327ed3213640336f35 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Wed, 24 Sep 2025 00:53:43 +0200 Subject: [PATCH] Not sure why this was necessary... --- crt0.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crt0.c b/crt0.c index d8acec6..a5b7580 100644 --- a/crt0.c +++ b/crt0.c @@ -4,10 +4,18 @@ int main(); asm ( - ".section .init \n" - ".global _start \n" - "_start: \n" - " jmp main \n" + ".section .init \n" + ".global _start \n" + "_start: \n\t" + "mov %cs, %ax \n\t" + "mov %ax, %ds \n\t" + "mov %ax, %es \n\t" + "cli \n\t" + "mov %ax, %ss \n\t" + "mov $0x1000, %ax \n\t" + "mov %ax, %sp \n\t" + "sti \n\t" + "jmp main" ); void* memset(void* ptr, int val, size_t len) {