Skip to content

Commit

Permalink
mark places what have to be fixed to enable 2M BIOS ROM images
Browse files Browse the repository at this point in the history
  • Loading branch information
sshwarts committed May 18, 2010
1 parent a9626b9 commit 45e4470
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion memory/memory.cc
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: memory.cc,v 1.82 2009/12/04 16:53:12 sshwarts Exp $
// $Id: memory.cc,v 1.83 2010/05/18 07:44:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
Expand Down Expand Up @@ -290,6 +290,7 @@ void BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, bx_phy_address addr, unsigned len
switch (DEV_pci_rd_memtype(a20addr)) {
case 0x0: // Read from ROM
if ((a20addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
*data_ptr = BX_MEM_THIS rom[a20addr & BIOS_MASK];
}
else {
Expand All @@ -310,6 +311,7 @@ void BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, bx_phy_address addr, unsigned len
*data_ptr = *(BX_MEM_THIS get_vector(a20addr));
}
else if ((a20addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
*data_ptr = BX_MEM_THIS rom[a20addr & BIOS_MASK];
}
else {
Expand Down
8 changes: 6 additions & 2 deletions memory/misc_mem.cc
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: misc_mem.cc,v 1.145 2010/05/17 19:42:30 sshwarts Exp $
// $Id: misc_mem.cc,v 1.146 2010/05/18 07:44:37 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
Expand Down Expand Up @@ -73,7 +73,7 @@ void BX_MEM_C::init_memory(Bit64u guest, Bit64u host)
{
unsigned idx;

BX_DEBUG(("Init $Id: misc_mem.cc,v 1.145 2010/05/17 19:42:30 sshwarts Exp $"));
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.146 2010/05/18 07:44:37 sshwarts Exp $"));

// accept only memory size which is multiply of 1M
BX_ASSERT((host & 0xfffff) == 0);
Expand Down Expand Up @@ -430,6 +430,7 @@ bx_bool BX_MEM_C::dbg_fetch_mem(BX_CPU_C *cpu, bx_phy_address addr, unsigned len
switch (DEV_pci_rd_memtype (addr)) {
case 0x0: // Read from ROM
if ((addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
*buf = BX_MEM_THIS rom[addr & BIOS_MASK];
}
else {
Expand All @@ -451,6 +452,7 @@ bx_bool BX_MEM_C::dbg_fetch_mem(BX_CPU_C *cpu, bx_phy_address addr, unsigned len
}
// must be in C0000 - FFFFF range
else if ((addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
*buf = BX_MEM_THIS rom[addr & BIOS_MASK];
}
else {
Expand Down Expand Up @@ -609,6 +611,7 @@ Bit8u *BX_MEM_C::getHostMemAddr(BX_CPU_C *cpu, bx_phy_address addr, unsigned rw)
switch (DEV_pci_rd_memtype (a20addr)) {
case 0x0: // Read from ROM
if ((a20addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
return (Bit8u *) &BX_MEM_THIS rom[a20addr & BIOS_MASK];
}
else {
Expand All @@ -630,6 +633,7 @@ Bit8u *BX_MEM_C::getHostMemAddr(BX_CPU_C *cpu, bx_phy_address addr, unsigned rw)
}
// must be in C0000 - FFFFF range
else if ((a20addr & 0xfffe0000) == 0x000e0000) {
// last 128K of BIOS ROM mapped to 0xE0000-0xFFFFF
return (Bit8u *) &BX_MEM_THIS rom[a20addr & BIOS_MASK];
}
else {
Expand Down

0 comments on commit 45e4470

Please sign in to comment.