multiboot1: When on BIOS, set IDTR to BIOS defaults before handoff

This commit is contained in:
mintsuki 2021-08-26 01:41:13 +02:00
parent 605623bd05
commit 0562c8ef70

View File

@ -2,9 +2,26 @@
#include <stddef.h>
#include <stdbool.h>
#include <mm/vmm.h>
#if bios == 1
# include <sys/idt.h>
#endif
__attribute__((noreturn)) void multiboot1_spinup_32(
uint32_t entry_point, uint32_t multiboot1_info) {
#if bios == 1
struct idtr idtr;
idtr.limit = 0x3ff;
idtr.ptr = 0;
asm volatile (
"lidt %0"
:
: "m" (idtr)
: "memory"
);
#endif
asm volatile (
"cld\n\t"