From de5b0ddc5d9a8443b11c9d1d24397b3b611a21d1 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Thu, 3 Oct 2024 17:59:29 -0400 Subject: [PATCH] cdecl16 update for EnterUnrealMode --- src/stage2/stage2.nasm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/stage2/stage2.nasm b/src/stage2/stage2.nasm index e459476..caa2606 100755 --- a/src/stage2/stage2.nasm +++ b/src/stage2/stage2.nasm @@ -94,8 +94,6 @@ main: call PrintString add sp, 0x2 - ERROR STEVIA_DEBUG_HALT - ; enter unreal mode call EnterUnrealMode @@ -104,6 +102,7 @@ main: call PrintString add sp, 0x2 + ERROR STEVIA_DEBUG_HALT ; FAT Driver setup push bp @@ -853,10 +852,10 @@ EnableA20: ; TODO: fix the prolog, epilog and stack usage to confirm with cdecl16 EnterUnrealMode: + __CDECL16_ENTRY +.func: cli ; no interrupts - push ds ; save real mode - push bx - + push ds ; save real mode data selector lgdt [unreal_gdt_info] mov eax, cr0 ; switch to pmode @@ -871,10 +870,10 @@ EnterUnrealMode: and al,0xFE ; back to realmode mov cr0, eax ; by toggling bit again - pop bx pop ds ; get back old segment sti .endp: + __CDECL16_EXIT ret ; #############