mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 12:16:31 +00:00
🆕 AP处理器切换到64位模式
This commit is contained in:
@ -17,4 +17,15 @@ void smp_init()
|
||||
{
|
||||
kdebug("[core %d] acpi processor UID=%d, APIC ID=%d, flags=%#010lx", i, proc_local_apic_structs[i]->ACPI_Processor_UID, proc_local_apic_structs[i]->ACPI_ID, proc_local_apic_structs[i]->flags);
|
||||
}
|
||||
|
||||
//*(uchar *)0x20000 = 0xf4; // 在内存的0x20000处写入HLT指令(AP处理器会执行物理地址0x20000的代码)
|
||||
// 将引导程序复制到物理地址0x20000处
|
||||
memcpy((unsigned char *)0x20000, _apu_boot_start, (unsigned long)&_apu_boot_end - (unsigned long)&_apu_boot_start);
|
||||
|
||||
// 先init ipi, 然后连续发送两次start-up IPI
|
||||
// x2APIC下,ICR寄存器地址为0x830
|
||||
// xAPIC下则为0xfee00300(31-0) 0xfee00310 (63-32)
|
||||
wrmsr(0x830, 0xc4500); // init IPI
|
||||
wrmsr(0x830, 0xc4620); // start-up IPI
|
||||
wrmsr(0x830, 0xc4620); // start-up IPI
|
||||
}
|
Reference in New Issue
Block a user