:: commit 37a40880b2eab6207ca18bf60e04b8eaa5c69945

mintsuki <mintsuki@protonmail.com> — 2021-03-17 18:40

parents: 495e1a131c

protos: Fix retf frames for Linux and chainload

diff --git a/stage23/protos/chainload.c b/stage23/protos/chainload.c
index 6e934d7a..c68e8afc 100644
--- a/stage23/protos/chainload.c
+++ b/stage23/protos/chainload.c
@@ -34,8 +34,8 @@ static void spinup(uint8_t drive) {
         "and al, 0xfe\n\t"
         "mov cr0, eax\n\t"
         "mov eax, OFFSET 1f\n\t"
-        "push eax\n\t"
         "push 0\n\t"
+        "push ax\n\t"
         "retf\n\t"
         "1:\n\t"
         "mov ax, 0\n\t"
diff --git a/stage23/protos/linux.c b/stage23/protos/linux.c
index 01dff929..2b380b93 100644
--- a/stage23/protos/linux.c
+++ b/stage23/protos/linux.c
@@ -42,8 +42,8 @@ static void spinup(uint16_t real_mode_code_seg, uint16_t kernel_entry_seg,
         "and al, 0xfe\n\t"
         "mov cr0, eax\n\t"
         "mov eax, OFFSET 1f\n\t"
-        "push eax\n\t"
         "push 0\n\t"
+        "push ax\n\t"
         "retf\n\t"
         "1:\n\t"
         "mov ds, bx\n\t"
tab: 248 wrap: offon