- this is the equivalent of main.cc revision 1.34

This commit is contained in:
Bryce Denney 2001-06-07 02:21:55 +00:00
parent 815a86e06b
commit 017691abdc

View File

@ -362,18 +362,29 @@ process_sim2:
#if BX_APIC_SUPPORT
memset(apic_index, 0, sizeof(apic_index[0]) * APIC_MAX_ID);
#endif
BX_MEM(0) = new BX_MEM_C ();
#if BX_SMP_PROCESSORS==1
BX_MEM(0)->init_memory(bx_options.memory.megs * 1024*1024);
BX_MEM(0)->load_ROM(bx_options.rom.path, bx_options.rom.address);
BX_MEM(0)->load_ROM(bx_options.vgarom.path, 0xc0000);
BX_CPU(0)->init (BX_MEM(0));
BX_CPU(0)->reset(BX_RESET_HARDWARE);
#else
// SMP initialization
bx_mem_array[0] = new BX_MEM_C ();
bx_mem_array[0]->init_memory(bx_options.memory.megs * 1024*1024);
bx_mem_array[0]->load_ROM(bx_options.rom.path, bx_options.rom.address);
bx_mem_array[0]->load_ROM(bx_options.vgarom.path, 0xc0000);
for (int i=0; i<BX_SMP_PROCESSORS; i++) {
BX_CPU(i) = new BX_CPU_C ();
BX_CPU(i)->init (BX_MEM(0));
#if BX_APIC_SUPPORT
// assign apic ID from the index of this loop
// if !BX_APIC_SUPPORT, this will not compile.
BX_CPU(i)->local_apic.set_id (i);
#endif
BX_CPU(i)->reset(BX_RESET_HARDWARE);
}
#endif
#if BX_NUM_SIMULATORS > 1
#error cosimulation not supported until SMP stuff settles
BX_MEM(1) = new BX_MEM_C ();