存在bug,apu启动后触发异常会Reset

This commit is contained in:
fslongjin
2022-04-06 15:11:14 +08:00
parent a62454587e
commit b7df2805ed
8 changed files with 214 additions and 99 deletions

View File

@ -297,6 +297,8 @@ _start:
add $8, %eax
loop .fill_pt
.global enter_head_from_ap_boot
enter_head_from_ap_boot:
// CR3
mov $pml4, %eax
mov %eax, %cr3
@ -349,8 +351,14 @@ ENTRY(_start64)
mov %ax, %ss
mov %ax, %gs
movq $0x7e00, %rsp
movq _stack_start(%rip), %rsp
// apu
movq $0x1b, %rcx // IA32_APIC_BASE.BSP[8]apu
rdmsr
bt $8, %rax
jnc load_cr3
// 2.
//
mov $__PML4E, %eax
@ -366,6 +374,7 @@ ENTRY(_start64)
// ==== CR3
load_cr3:
movq $__PML4E, %rax //
movq %rax, %cr3