Add a call to BIOS int 15h AX EC00h before entering Long Mode in stivale proto

This commit is contained in:
mintsuki 2020-06-03 13:54:54 +02:00
parent 7336f2b819
commit 3d75644e2c
3 changed files with 10 additions and 2 deletions

Binary file not shown.

View File

@ -99,9 +99,7 @@ __attribute__((used)) static uint32_t int_08_ticks_counter;
__attribute__((naked)) static void int_08_isr(void) { __attribute__((naked)) static void int_08_isr(void) {
asm ( asm (
".code16\n\t" ".code16\n\t"
"pushf\n\t"
"inc dword ptr cs:[int_08_ticks_counter]\n\t" "inc dword ptr cs:[int_08_ticks_counter]\n\t"
"popf\n\t"
"int 0x40\n\t" // call callback "int 0x40\n\t" // call callback
"iret\n\t" "iret\n\t"
".code32\n\t" ".code32\n\t"

View File

@ -227,6 +227,16 @@ void stivale_load(char *cmdline, int boot_drive) {
deinit_vga_textmode(); deinit_vga_textmode();
} }
if (bits == 64) {
// If we're going 64, we might as well call this BIOS interrupt
// to tell the BIOS that we are entering Long Mode, since it is in
// the specification.
struct rm_regs r = {0};
r.eax = 0xec00;
r.ebx = 0x02; // Long mode only
rm_int(0x15, &r, &r);
}
rm_flush_irqs(); rm_flush_irqs();
if (bits == 64) { if (bits == 64) {