Menu

#564 Can't replace ROM file while running

Next_release
open
nobody
development (1)
5
2015-01-05
2015-01-05
No

When developing MSX software (e.g. a ROM), it would be useful to keep openMSX running and having the ROM replaced (by the compiler/assembler) without having to restart (or eject/reinsert) the ROM file. This is currently not possible.

On Linux, I did an experiment, replacing a Goonies ROM with a Gradius 1 ROM (with the same filename, just overwriting it while openMSX was running THe Goonies). In most cases, the MSX reset but nothing happened anymore (wrong mapper type).

But in one case I even got a bus error:

#0  0x00000000004bb40a in openmsx::CPUCore<openmsx::Z80TYPE>::executeInstructions (this=0x18f4630) at src/cpu/CPUCore.cc:1186
1186    CASE(C9) { int c = ret();         NEXT; }
(gdb) bt
#0  0x00000000004bb40a in openmsx::CPUCore<openmsx::Z80TYPE>::executeInstructions (this=0x18f4630) at src/cpu/CPUCore.cc:1186
#1  0x00000000004d2131 in openmsx::CPUCore<openmsx::Z80TYPE>::execute2 (
    this=this@entry=0x18f4630, fastForward=<optimized out>)
    at src/cpu/CPUCore.cc:2559
#2  0x00000000004d242e in openmsx::CPUCore<openmsx::Z80TYPE>::execute (
    this=0x18f4630, fastForward=<optimized out>) at src/cpu/CPUCore.cc:2516
#3  0x000000000050f12a in openmsx::MSXCPU::execute (this=<optimized out>, 
    fastForward=fastForward@entry=false) at src/cpu/MSXCPU.cc:153
#4  0x0000000000430271 in openmsx::MSXMotherBoard::execute (
    this=<optimized out>) at src/MSXMotherBoard.cc:477
#5  0x000000000044a331 in openmsx::Reactor::run (
    this=this@entry=0x7fff11284ba0, parser=...) at src/Reactor.cc:538
#6  0x0000000000410eaa in openmsx::main (argc=<optimized out>, 
    argv=<optimized out>) at src/main.cc:152
#7  0x0000000000411139 in main (argc=<optimized out>, argv=<optimized out>)
    at src/main.cc:181

I now tested with a similar 32kB ROM and I got another Bus error:

Program terminated with signal SIGBUS, Bus error.
#0  0x00000000004b641b in RDMEM_impl2<false, false> (cc=<optimized out>, 
    address=<optimized out>, this=<optimized out>) at src/cpu/CPUCore.cc:615
615         return line[address];
(gdb) bt
#0  0x00000000004b641b in RDMEM_impl2<false, false> (cc=<optimized out>, 
    address=<optimized out>, this=<optimized out>) at src/cpu/CPUCore.cc:615
#1  RDMEM_impl<false, false> (cc=<optimized out>, address=<optimized out>, 
    this=<optimized out>) at src/cpu/CPUCore.cc:625
#2  RDMEM_OPCODE (cc=<optimized out>, this=<optimized out>)
    at src/cpu/CPUCore.cc:631
#3  openmsx::CPUCore<openmsx::Z80TYPE>::executeInstructions (this=0x2765720)
    at src/cpu/CPUCore.cc:949
#4  0x00000000004d1b3c in openmsx::CPUCore<openmsx::Z80TYPE>::executeSlow (
    this=this@entry=0x2765720) at src/cpu/CPUCore.cc:2501
#5  0x00000000004d2049 in openmsx::CPUCore<openmsx::Z80TYPE>::execute2 (
    this=this@entry=0x2765720, fastForward=<optimized out>)
    at src/cpu/CPUCore.cc:2551
#6  0x00000000004d242e in openmsx::CPUCore<openmsx::Z80TYPE>::execute (
    this=0x2765720, fastForward=<optimized out>) at src/cpu/CPUCore.cc:2516
#7  0x000000000050f12a in openmsx::MSXCPU::execute (this=<optimized out>, 
    fastForward=fastForward@entry=false) at src/cpu/MSXCPU.cc:153
#8  0x0000000000430271 in openmsx::MSXMotherBoard::execute (
    this=<optimized out>) at src/MSXMotherBoard.cc:477
#9  0x000000000044a331 in openmsx::Reactor::run (
    this=this@entry=0x7fff75497bc0, parser=...) at src/Reactor.cc:538
#10 0x0000000000410eaa in openmsx::main (argc=<optimized out>, 
    argv=<optimized out>) at src/main.cc:152

Tried another time, and now it worked without Bus error.

On Windows, I hear it is not working at all. I guess Windows says the file is in use and cannot be overwritten.

Discussion

  • Manuel Bilderbeek

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,6 +3,8 @@
     On Linux, I did an experiment, replacing a Goonies ROM with a Gradius 1 ROM (with the same filename, just overwriting it while openMSX was running THe Goonies). In most cases, the MSX reset but nothing happened anymore (wrong mapper type).
    
     But in one case I even got a bus error:
    +
    +~~~~
     #0  0x00000000004bb40a in openmsx::CPUCore<openmsx::Z80TYPE>::executeInstructions (this=0x18f4630) at src/cpu/CPUCore.cc:1186
     1186   CASE(C9) { int c = ret();         NEXT; }
     (gdb) bt
    @@ -22,10 +24,11 @@
         argv=<optimized out>) at src/main.cc:152
     #7  0x0000000000411139 in main (argc=<optimized out>, argv=<optimized out>)
         at src/main.cc:181
    -
    +~~~~
    
     I now tested with a similar 32kB ROM and I got another Bus error:
    
    +~~~~
     Program terminated with signal SIGBUS, Bus error.
     #0  0x00000000004b641b in RDMEM_impl2<false, false> (cc=<optimized out>, 
         address=<optimized out>, this=<optimized out>) at src/cpu/CPUCore.cc:615
    @@ -54,7 +57,7 @@
         this=this@entry=0x7fff75497bc0, parser=...) at src/Reactor.cc:538
     #10 0x0000000000410eaa in openmsx::main (argc=<optimized out>, 
         argv=<optimized out>) at src/main.cc:152
    -
    +~~~~
    
     Tried another time, and now it worked without Bus error.
    
     
  • Manuel Bilderbeek

    • labels: --> development