将内核定位到高地址(存在bug,中断时会访问低地址)

This commit is contained in:
fslongjin
2022-04-10 21:30:16 +08:00
parent 3063a340e2
commit f5f36aafd8
23 changed files with 689 additions and 238 deletions

View File

@ -425,6 +425,19 @@ void apic_init()
apic_io_apic_init();
// get RCBA address
io_out32(0xcf8, 0x8000f8f0);
uint32_t RCBA_phys = io_in32(0xcfc);
// 获取RCBA寄存器的地址
if (RCBA_phys > 0xfec00000 && RCBA_phys < 0xfee00000)
RCBA_vaddr = SPECIAL_MEMOEY_MAPPING_VIRT_ADDR_BASE + RCBA_phys;
else
{
RCBA_vaddr = 0;
kwarn("Cannot get RCBA address. RCBA_phys=%#010lx", RCBA_phys);
}
sti();
}
/**