i'm running minix 3.1.2a ,my goal is to start APs procesoors other than the BSP ,i followed the universal startup algorithm :
- BSP sends AP an INIT IPI
- BSP DELAYs (10mSec)
- BSP sends AP a STARTUP IPI
- BSP DELAYs (200μSEC)
- BSP sends AP a STARTUP IPI
- BSP DELAYs (200μSEC)
here's the Function to do INIT IPI AND STARTUP IPI after reading the ACPI table:
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");
}
}
}
i'd like to note that i run on a core i7 host machine with windows 7 ,64-bit and i have 3 different virtual M/Cs :
- VMWARE WORKSTATION
- VBOX
- QEMU MANAGER
1-on VMWARE:
mainly i run my guest minix on VMWARE ,when i run the previously mentioned code :
- when i choose the number of processors i.e 4 and number of cores 1,and run that code the system will keep in restarting.
- when i choose the number of processors i.e 1 and number of cores 4,and run that code the system will hang.
2-on VBOX:
- when i choose the number of processors 4 and run that code the system will hang.
3-on QEMU: first the acpi checksum is incorrect ,so i enter the CPUAPIC ID manually just to test i.e APIC ID =1 - when i choose the number of cpus 4 ,and run that code the system will hang.
actually i stuck in that problem for more than 10 days and i pull out my all hair ,i can't reconize why is not starting ,so if any one can help i'll be appreciated