on the wxWindows interface. There are many more changes here than
absolutely required to fix the memory leaks. Instead, I've tried to
clean things up so that it does the right thing, and is easier to
read and maintain.
- For events that the text mode interface is going to ignore anyway, I #ifdefed
the event creation code instead of calling new and then delete.
- now all synchronous events in siminterface.cc are created as local variables
on the stack. Some of them were allocated with new before, and yes some of
them leaked.
- now I ignore the result of sim_to_ci_event (&event). It was always
returning a pointer to the input event anyway. This makes the event
sending code simpler.
- wxmain.cc:
- in the BxEvent handling functions, now all cases "break" down to common
code at the end which deletes async events. This is easier to read than
having each case handle the delete individually.
- in OnLogMsg, do not delete the event here because it is now handled
in the common code of OnSim2CIEvent instead.
- thanks to Christophe for pointing out the location of the worst
memory leak.
- make bx_init_main return -1 if any parse errors occur.
- wxWindows: if bx_init_main returns -1, don't even show the application
window. You'll get an error dialog and then it exits. So far this
only happens if you run with -q and the parse fails.
- non-wxWindows: if bx_init_main returns -1, just exit. So far this
only happens if you run with -q and the parse fails.
- with these changes, handling of bochsrc parse errors seems to work
as you would expect. And it certainly doesn't go into an infinite
recursive loop, as it used to!
- a little more testing and I can close
bug 614175: infinite panic loop if bochsrc buggy
- modified: main.cc gui/siminterface.h gui/wxmain.cc
and into wxmain.cc, like other actions.
- set a default siminterface callback for the whole application, which is used
whenever the simulator is not running. This is important when the wx code
calls simulator or param code and triggers a BX_PANIC or something.
The default callback is responsible for displaying error messages which
appear while reading the bochsrc, for example.
- move the implementation of BX_SYNC_EVT_LOG_ASK and BX_ASYNC_EVT_LOG_MSG
into a separate function OnLogMsg(). In the future, OnLogMsg() may be called
from the application default callback on errors.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
wx behavior worked out, I'll take out the ifdef and settle on something.
- use new enums BX_LOG_ASK_CHOICE_CONTINUE, BX_LOG_ASK_CHOICE_DIE, etc.
- do not use BX_PANIC inside fatal function! it is very likely to reenter,
causing infinite recursion. Use fprintf instead.
(0=success, -1=failure). If parse_line_unformatted returns failure, I
stop parsing the bochsrc.
- implement all parsing BX_PANICs with new PARSE_ERR macro, so that we can
easily change the behavior of all parse errors at once. For now, I want
it to BX_PANIC and then return -1 (case panic continues). Eventually I
might turn it into BX_ERROR and return -1.
- moved cpu_online_map into the BX_CPU_C structure as a static member
(there is only one per bochs, not one per CPU)
- reduced the diffs in several places to make it more clear what had changed
- removed lots of whitespace diffs
Since the SYSCALL replaces the LOADALL instruction, it is incompatible with
earlier CPU types.
At moment, the SYSCALL is only enabled by x86-64 emulation, but the code
can be incorporated in IA32 only emulations.
Instructions added:
0F 05 SYSCALL (replaces LOADALL)
0F 07 SYSRET (new)
TODO: restructure #if ... so that it can be used by non x86-64 emulations.
smarter. If you use --enable-x86-64, it has the following side
effects on other options:
- cpu level defaults to 6 instead of 5
- ignore bad msr defaults to on (Peter T. requested this)
- if cpu level is 6 or greater, these options are enabled by default.
- 4meg pages (PSE)
- physical address extensions (PAE)
- global pages (PGE)
- apic support
- a few weeks ago I changed the gui code so that it always made a copy
of the clipboard data using new Bit8u[] and passed it into the keyboard
code. But I didn't get the keyboard code quite right, and Christophe
noticed the incorrect malloc that I had forgotten to remove. I changed
it to work as I intended:
1. gui code allocates paste buffer (new), copies clipboard data in
2. gui code passes the buffer to the keyboard code, and forgets about it
3. keyboard code uses the buffer, then frees it when finished (delete)
- modified: iodev/keyboard.h iodev/keyboard.cc
. 4 ata interfaces support
. devices auto-detection
. 16bits/32bits device access
. EDD3.0 support
. ata/atapi layer rewrite
. added verious DEBUG_XXX to debug only parts of the bios, because we're running low on data space in debug mode
. moved ata data at offset 0x121 in EBDA. Previously, data was being overwritten by keyboard.sys
. added jump to [0x40:0x67] after reset if shutdown status is 0x05. Fixes bug [ 601166 ] CMOS Problem @ "0x0F Index 0x05 data"
. DMA controller init on POST entry
configuring for a different machine. This is used to short-circuit
certain sanity checks, such as existence of certain required libraries.
- in --with-wx configuration, when $cross_configure=1, do not abort
configure if library is not found.
- if wxWindows version not found, print "not_found" instead of nothing
From his patch file text:
> This patch adds Promise DC2300 VLB IDE Support.
> You may find msdos and win95 drivers on the net. Look for
> P2300W95.ZIP and DC2300VLBIDEver260b.ZIP.
>
> The good news is that now win95 natively sees my cdrom,
> and that the disks are not in msdos compatibility mode any more.
>
> The bad news is that it works only for the first ata interface.
>
> I tested that patch on msdos and win95 only.
>
> Some info on VLB IDE can be found at http://ryston.cz/petr/vlb/
I got Win95 running with 32-bit paging/filesystem using the
recommended driver and these patches. Since the patches did
such a good job bracketing code modifications with a #define,
they might as well become part of the current CVS code.
use getB_CF() etc. getB_CF() and friends are only for a relatively
small number of cases where a true boolean/binary number (0 or 1) is required
rather than 0 or non-0 as is returned by get_CF().