32bit stivale was not pushing a return address. (#26)

When trying to boot skift using limine I was still getting an invalid address for the stivale struct.
Pushing an additional 0 where the return address should have been fixed the issue.
This commit is contained in:
マーモット 2020-09-18 10:16:24 +02:00 committed by GitHub
parent 79fb7342ce
commit 8271c0b8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -363,12 +363,13 @@ __attribute__((noreturn)) void stivale_spinup(int bits, bool level5pg,
: "memory"
);
} else if (bits == 32) {
asm volatile (
asm volatile(
"cli\n\t"
"cld\n\t"
"mov esp, dword ptr [esi]\n\t"
"push edi\n\t"
"push 0\n\t"
"pushfd\n\t"
"push 0x18\n\t"
@ -382,10 +383,10 @@ __attribute__((noreturn)) void stivale_spinup(int bits, bool level5pg,
"xor edi, edi\n\t"
"xor ebp, ebp\n\t"
"iret\n\t" :
: "b" (&entry_point), "D" (stivale_struct), "S" (&stack)
: "memory"
);
"iret\n\t"
:
: "b"(&entry_point), "D"(stivale_struct), "S"(&stack)
: "memory");
}
for (;;);
}