Fix MP table generated by Bochs
This commit is contained in:
parent
5899932f0c
commit
96c074f87b
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: misc_mem.cc,v 1.70 2005-12-27 16:59:27 vruppert Exp $
|
||||
// $Id: misc_mem.cc,v 1.71 2006-01-10 18:33:27 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -37,7 +37,6 @@ Bit32u BX_MEM_C::get_memory_in_k(void)
|
||||
return(BX_MEM_THIS megabytes * 1024);
|
||||
}
|
||||
|
||||
// BX_MEM_C constructor
|
||||
BX_MEM_C::BX_MEM_C(void)
|
||||
{
|
||||
char mem[6];
|
||||
@ -76,7 +75,6 @@ BX_MEM_C::alloc_vector_aligned (size_t bytes, size_t alignment)
|
||||
actual_vector, vector));
|
||||
}
|
||||
|
||||
// BX_MEM_C destructor
|
||||
BX_MEM_C::~BX_MEM_C(void)
|
||||
{
|
||||
if (this-> vector != NULL) {
|
||||
@ -95,7 +93,7 @@ void BX_MEM_C::init_memory(int memsize)
|
||||
{
|
||||
int idx;
|
||||
|
||||
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.70 2005-12-27 16:59:27 vruppert Exp $"));
|
||||
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.71 2006-01-10 18:33:27 sshwarts Exp $"));
|
||||
// you can pass 0 if memory has been allocated already through
|
||||
// the constructor, or the desired size of memory if it hasn't
|
||||
// BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
|
||||
@ -111,10 +109,10 @@ void BX_MEM_C::init_memory(int memsize)
|
||||
memset(BX_MEM_THIS rom, 0xff, BIOSROMSZ + EXROMSIZE);
|
||||
memset(BX_MEM_THIS bogus, 0xff, 4096);
|
||||
for (idx = 0; idx < 1024 * 1024; idx++)
|
||||
BX_MEM_THIS memory_handlers[idx] = NULL;
|
||||
BX_MEM_THIS memory_handlers[idx] = NULL;
|
||||
for (idx = 0; idx < 65; idx++)
|
||||
BX_MEM_THIS rom_present[idx] = 0;
|
||||
BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
|
||||
BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes)));
|
||||
}
|
||||
|
||||
#if BX_DEBUGGER
|
||||
@ -325,13 +323,13 @@ void BX_MEM_C::load_ROM(const char *path, Bit32u romaddress, Bit8u type)
|
||||
for (i = 0; i < BX_SMP_PROCESSORS; i++) {
|
||||
put_8bit(&p, 0); // entry type = processor
|
||||
put_8bit(&p, (Bit8u)i); // APIC id
|
||||
put_8bit(&p, 0x11); // local APIC version number
|
||||
put_8bit(&p, APIC_VERSION_ID & 0xff); // local APIC version number
|
||||
put_8bit(&p, (i==0)?3:1); // cpu flags: enabled, cpu0 = bootstrap cpu
|
||||
put_8bit(&p, 0); // cpu signature
|
||||
put_8bit(&p, 0);
|
||||
put_8bit(&p, 0);
|
||||
put_8bit(&p, 0);
|
||||
put_16bit(&p, 0x201); // feature flags
|
||||
put_16bit(&p, 0x301); // feature flags: FPU, CX8, APIC
|
||||
put_16bit(&p, 0);
|
||||
put_16bit(&p, 0); // reserved
|
||||
put_16bit(&p, 0);
|
||||
@ -344,7 +342,7 @@ void BX_MEM_C::load_ROM(const char *path, Bit32u romaddress, Bit8u type)
|
||||
Bit8u ioapic_id = BX_SMP_PROCESSORS;
|
||||
put_8bit(&p, 2); // entry type = I/O APIC
|
||||
put_8bit(&p, ioapic_id); // apic id
|
||||
put_8bit(&p, 0x11); // I/O APIC version number
|
||||
put_8bit(&p, BX_IOAPIC_VERSION_ID & 0xff); // I/O APIC version number
|
||||
put_8bit(&p, 1); // enabled
|
||||
put_32bit(&p, 0xfec00000); // I/O APIC addr
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user