我正在运行minix 3.1.2a,我的目标是在BSP以外的地方启动AP,我遵循通用启动算法:
这是在读取ACPI表后执行INIT IPI和STARTUP IPI的功能:
void START_APs2()
{
u32_t trampoline_addr;
int UseCPU = 1;
u32_t reg;
/* Try to allocate the trampoline for APs to start */
if ((trampoline_addr=find_trampoline()))
{
reg = LOCAL_APIC_READ(LOCAL_APIC_SPIV);
reg |= 0x1FF; /* Disable apic */
LOCAL_APIC_WRITE(LOCAL_APIC_SPIV, reg);
/*======================== INIT IPI==============================*/
CLI();
/*LOCAL_APIC_WRITE(LOCAL_APIC_ICR_HIGH, (unsigned long)cpus[UseCPU].ApicID << 24);*/
LOCAL_APIC_WRITE(LOCAL_APIC_ICR_LOW, (unsigned long) (0x4500) | (trampoline_addr>>12)|(DEST_OTHERS << DEST_SHORT_SHIFT));
/*wait_for_ipi_completion();*/
VerifyLoop();
/*Some delay ...*/
milli_delay(100);
/*=============================STARTUP IPI==============================*/
/* LOCAL_APIC_WRITE(LOCAL_APIC_ICR_HIGH, (unsigned long)cpus[UseCPU].ApicID <<24);*/
LOCAL_APIC_WRITE(LOCAL_APIC_ICR_LOW, (unsigned long) (0x5600) | (trampoline_addr>>12)|(DEST_OTHERS << DEST_SHORT_SHIFT));
VerifyLoop();
/*Some delay ...*/
milli_delay(200);
/* send the IPI */
/*LOCAL_APIC_WRITE(LOCAL_APIC_ICR_HIGH, (unsigned long)cpus[UseCPU].ApicID <<24);*/
LOCAL_APIC_WRITE(LOCAL_APIC_ICR_LOW, (unsigned long) (0x5600) | (trampoline_addr>>12)|(DEST_OTHERS << DEST_SHORT_SHIFT));
VerifyLoop();
/*Some delay ...*/
milli_delay(200);
STI();
/* enable_cpu(this_cpu, WITHOUT_ECHO);*/
if (! AP_running())
{
Aprintf(("\n\n*** WARNING! AP# %d is not running ***\n\n",(unsigned long)cpus[UseCPU].ApicID));
}
else
{
Aprintf("\n\n***AP RUNNING SUCCESSFULLY");
}
}
}
我想要注意的是,我运行的是具有Windows 7,64位的核心i7主机 我有3种不同的虚拟M / C:
1-on VMWARE:
主要是我在VMWARE上运行我的guest minix,当我运行前面提到的代码时:
2-on VBOX:
3-on QEMU: 首先acpi校验和不正确,所以我手动输入CPUAPIC ID只是为了测试APIC ID = 1 - 当我选择cpus 4的数量,并运行该代码时系统将挂起。
实际上我在这个问题上停留了超过10天而且我拔掉了我的所有头发,我无法重新解释为什么不开始,所以如果有人能帮助我会受到赞赏