Bladeren bron

[contrib] Add patch to enable writable ROM images in bochs

Some of the gPXE romprefix.S code attempts to write to the ROM image,
as allowed by the PCI spec.  We do gracefully handle the case of
read-only ROM images (for ISA ROMs and for normal bochs/qemu
operation), but it can be handy to be able to use bochs to debug the
code paths that depend on writable ROM images.
tags/v0.9.6
Michael Brown 15 jaren geleden
bovenliggende
commit
22979c511e
1 gewijzigde bestanden met toevoegingen van 20 en 0 verwijderingen
  1. 20
    0
      contrib/bochs/bochs-writable-ROM-patch

+ 20
- 0
contrib/bochs/bochs-writable-ROM-patch Bestand weergeven

@@ -0,0 +1,20 @@
1
+Index: memory/memory.cc
2
+===================================================================
3
+RCS file: /cvsroot/bochs/bochs/memory/memory.cc,v
4
+retrieving revision 1.71
5
+diff -u -r1.71 memory.cc
6
+--- memory/memory.cc	18 Oct 2008 18:10:14 -0000	1.71
7
++++ memory/memory.cc	21 Oct 2008 19:47:07 -0000
8
+@@ -172,7 +172,11 @@
9
+             break;
10
+ 
11
+           case 0x0:   // Writes to ROM, Inhibit
12
+-            BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr));
13
++            if ((a20addr & 0xfffe0000) == 0x000e0000) {
14
++	      BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr));
15
++	    } else {
16
++	      BX_MEM_THIS rom[(a20addr & EXROM_MASK) + BIOSROMSZ] = *data_ptr;
17
++            }
18
+             break;
19
+ 
20
+           default:

Laden…
Annuleren
Opslaan