Tue, 15 Nov 2011 10:12:37 +0000
[musashi] Fix handling of bus errors
Patch-Author: Andrew Warkentin <andreww591!gmail>
Patch-MessageID: <4EC200CE.2020304@gmail.com>
I have fixed the first page fault test failure in FreeBee (the page fault test now hangs rather than errors out, because it is trying to read from the hard drive to test DMA page faults).
There were actually two bugs (the first bug was masking the second one).
First, the ancient version of Musashi that you used is unable to properly resume from bus errors that happen in the middle of certain instructions (some instructions are fetched in stages, with the PC being advanced to each part of the instruction, so basically what happens is the CPU core attempts to read the memory location referenced by the first operand, the bus error occurs, causing the PC to jump to the exception vector, but the faulting instruction is still in the middle of being fetched, so the PC is then advanced past the beginning of the exception handler). I fixed this by delaying the jump to the bus error vector until after the faulting instruction finishes.
The second bug is simpler - you had the UDS and LDS bits in BSR0 inverted (they are supposed to be active low).
philpem@0 | 1 | From private email, dated 2010-Nov-26, 20:43 GMT: |
philpem@0 | 2 | |
philpem@0 | 3 | From: Karl Stenerud <kstenerud@gmail.com> |
philpem@0 | 4 | Subject: Re: Musashi 68k emulator |
philpem@0 | 5 | |
philpem@0 | 6 | On 2010-11-26, at 12:36 PM, Philip Pemberton wrote: |
philpem@0 | 7 | |
philpem@0 | 8 | > > I do have one question, though more related to licensing than the core itself... |
philpem@0 | 9 | > > |
philpem@0 | 10 | > > I was planning to release my emulator under an open-source licence, probably the GPL or something along those lines (the worst case scenario IMO would be someone adding a ton of nice features then refusing to release the source). |
philpem@0 | 11 | > > |
philpem@0 | 12 | > > The "non-commercial use only" restriction in the Musashi license would seem to be at odds with the GPL, and would make it somewhat more difficult to tie in GPL-licensed libraries. Is there any possibility of getting v3.31 released under a less restrictive license, maybe GPL or LGPL? |
philpem@0 | 13 | > > |
philpem@0 | 14 | |
philpem@0 | 15 | Sure, no problem. I usually release stuff under an Apache license nowadays, but feel free to pick any FOSS license. |
philpem@0 | 16 |