From 1cc98d32bf344691c73fcc7b64e2ed2755f17ede Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 10 Jul 2021 16:17:07 +0200 Subject: update all segment registers when setting the GDT not doing that caused interrupts to break on Bochs --- platform/boot.s | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'platform') diff --git a/platform/boot.s b/platform/boot.s index c2a06c3..d5bfda5 100644 --- a/platform/boot.s +++ b/platform/boot.s @@ -34,4 +34,14 @@ halt_cpu: 1: hlt jmp 1b +// temporary, will be moved to another file soon +.global change_cs +.type change_cs, @function +change_cs: + /* retf pops off the return address and code segment off the stack. + * it turns out that in the i386 cdecl calling convention they're in + * the correct place already. + */ + retf + .size _start, . - _start -- cgit v1.2.3