- All mouse events in the VGA window go to MyPanel::OnMouse. Middle mouse
button and F12 both toggle mouse capture. OnMouse queues an event
for the simulation thread to process. The simulation thread calls
bx_devices.keyboard->mouse_motion() when it sees the event on the queue.
- add IFDBG_VGA around some display debug code. All wx mouse debug code
is controlled by IFDBG_MOUSE.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
the wxwindows thread, it just sets a boolean flag needRefresh. Meanwhile, a
wxTimer running in wall clock time (as opposed to sim time) triggers a
repaint only if the the boolean is true.
- now MyRefresh is implemented by just setting needRefresh=true.
- make graphics_tile_update call MyRefresh.
- make dimension_update call MyRefresh.
to bitfields. bxInstruction_c is now 24 bytes, including 4 for
the memory addr resolution function pointer, and 4 for the
execution function pointer (16 + 4 + 4).
Coded more accessors, to abstract access from most code.
with accessors. Had to touch a number of files to update the
access using the new accessors.
Moved rm_addr to the CPU structure, to slim down bxInstruction_c
and to prevent future instruction caching from getting sprayed
with writes to individual rm_addr fields. There only needs to
be one. Though need to deal with instructions which have
static non-modrm addresses, but which are using rm_addr since
that will change.
bxInstruction_c is down to about 40 bytes now. Trying to
get down to 24 bytes.
read all param values from CPU #0. The only solution I can come up with
is to change the siminterface handler function interface to pass a void*
to the callback function. I'll take care of it eventually.
you can switch on and off using the $TEST_* varables at top.
- when running with --parallel, use "-geom +x+y" argument to xterm
to make the windows appear in a regular pattern.
use accessors. This lets me work on compressing the
size of fetch-decode structure (now called bxInstruction_c).
I've reduced it down to about 76 bytes. We should be able
to do much better soon. I needed the abstraction of the
accessors, so I have a lot of freedom to re-arrange things
without making massive future changes.
Lost a few percent of performance in these mods, but my
main focus was to get the abstraction.
I'm keeping a separate patch in case Christophe wants to make revisions
to his patch without my changes getting in the way.
I have just been working on the configuration interface part, for
example making it so that when you disable the ata[0123] channel, all the
devices controlled by that channel will be disabled as well. I haven't
gotten around to the wxWindows part, but these changes will make the
wxWindows work much easier. I will update this patch as my work progresses.
instead of bx_param_bool_c. There are several cases where I need an
enum to enable/disable some fields, and this change should allow
that.
- modified: gui/siminterface.h gui/siminterface.cc
no longer used. Also rearranged that struct a little
to be more compressed. Over time, I'm going to reduce
it further, for use with future accelerations.
enhancement to bochs. You can now configure with
--enable-guest2host-tlb.
Force the support of big pages (PSE) when x86-64 is configured.
Reverted back to only one kind of TLB entry style, since everything
is ported.
Fixed one bug in io.cc with as_64 and the index registers.
There are others, as noticed by Peter.
wxWindows without debugger, I needed to add some more cases of
#if BX_DEBUGGER to make it work. It is certainly possible to
handle such problems by always compiling in the debug dialogs but
only instantiating them if debug support is compiled in, but I have
chosen (for now) to put #if BX_DEBUGGER around things like this.
- modified: gui/wxdialog.h gui/wxdialog.cc
wxWindows without debugger, I needed to add some more cases of #if
BX_DEBUGGER to make it work. All the problems I found were things like
referencing a debug structure which was never initialized (NULL). It is
possible to handle such problems by always compiling in the debug dialogs but
only instantiating them if debug support is compiled in, but I have chosen
(for now) to put #if BX_DEBUGGER around things like this.
class declaration, for example:
static const unsigned os_64=0, as_64=0;
After reading some suggestions on usenet, I changed these into
enums instead, like this:
enum { os_64=0, as_64=0 };
you have AC_DEFINE(var, value) executed more than once, autoconf is
supposed to use the last AC_DEFINE value, but sometimes it doesn't.
I haven't been able to figure out why, so I've just worked around it
instead.
- for BX_SupportGlobalPages, which could call AC_DEFINE twice, I kept the
value in a shell variable $support_global_pages until the end and then
did one AC_DEFINE after it had reached its final value. Same thing
with BX_USE_CONFIG_INTERFACE.
- also I realized that we are using AC_SUBST() in many cases where it is
not needed. AC_SUBST(name) substitutes the string @name@ with a
value from the configure script. For preprocessor symbols like
BX_SupportPAE, we only need the AC_DEFINE; the AC_SUBST has no effect.
be used at all, and Peter didn't want it. "extdb.o" is compiled
into libcpu.a, if configured for it.
Removed a few #warnings for x86-64 compile, based on Peter's
line-item comments regarding the warnings I inserted during
the port/merge.
- try to find the configure script and set the path correctly, in case
the script is run from the main directory, build, etc.
- name the build directories build-$name so they don't overwrite anything.
Now that I have "rm -rf" in my script I wanted to be a little more careful.
printed to stderr in the text debugger. Also allows the user to
type (text) debugger commands directly, which also appear in the log.
- all text output in the debugger now passes through dbg_printf()
(used to be fprintf to stderr) so that in wxWindows I can redirect
it all to the wxWindows debug log screen. Added debug_fputs to
siminterface which actually sends the text to the GUI by creating
a BX_ASYNC_EVT_DBG_MSG event.
- changed prefix and msg fields of BxLogMsgEvent to const char *,
and also in args of logmsg method of siminterface.
- don't trap SIGINT in wxWindows. There are other ways to stop execution.
Also, signal handling with multiple threads is very strange and different
on different platforms.
- minor changes to fix gcc -Wall warnings in dbg_main.cc
- add a new boolean parameter BXP_DEBUG_RUNNING that tells if the debugger is
running freely or not. This is used by the wxWindows GUI to enable or
disable certain choices.
- CpuRegistersDialog has continue,stop,step buttons. When the sim is running
freely, I disable continue and step, and enable stop. When the sim stops
to wait for the user, I disable stop and enable continue and step. The
change of enables used to be triggered by actually pressing the button,
but then if you started/stopped the simulation in some other way (typing
in debug log window) the enables were never changed. Now the enables are
controlled by the value of BXP_DEBUG_RUNNING, which is set by the debug code
itself, and the buttons are enabled at the right time.
- ParamDialog::Refresh() is now virtual so that child classes can redefine
its refresh behavior.
- in safeWxStrcpy, force the last element of the array to be a 0, since
I noticed that strncpy is not guaranteed to terminate the string!
- modified: debug/dbg_main.cc debug/debug.h gui/siminterface.cc
gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc
gui/wxmain.h
printing a message when a reserved bit was set, but not causing
a #GP(0). As well, I force a new PAE support option to 1 when
Hammer support is enabled.
circular dependencies between 3 cpu related libs that I need
as part of this transition. I changed the "ar rv" to "ld -i -o"
to do an incremental load instead of an archive. Hope this
doesn't break any platforms. We can reset this later.
at the appropriate times. For example, you can't stop when you're
stopped. You can't step when it's running.
- modified: gui/wxdialog.cc gui/wxdialog.h
called cpu_mode. Now there is one for cpu32, but it is declared:
static const unsigned cpu_mode=BX_MODE_IA32;
This way the compiler can compile-out if-then-else clauses based
on it, allowing for easier code sharing.
Bochs debugger. The Bochs debugger calls SIM->debug_get_next_command() which
does not return until a debugger command is found. The siminterface sends an
synchronous event to the wxWindows thread with a blank to be filled in with a
debugger command. wxWindows fills in the blank and sends the synchronous
event back, and the Bochs debugger interprets it as if it was typed on
the command line. For the long term I haven't decided whether to stick with
sending text strings vs. some other method.
- so far the wxWindows debugger consists of one big dialog box that shows
all the standard registers, and a working Continue, Stop, and Step button.
- modify ParamDialog so that it is more useful as a base class, by moving
some things to protected members&fields, separating out functionality
that is most likely to be replaced into virtual functions, and making it
generally more flexible. The new CpuRegistersDialog is based on
ParamDialog.
- in wxdialog.cc, continue the convention of using wxID_HELP, wxID_OK,
wxID_CANCEL, etc. for the id's of buttons, instead of wxHELP, wxOK, etc.
which are intended to be ORred together in a bit field.
- cpu/init.cc: put ifdefs around DEFPARAMs for flags in configurations
where they don't exist. Add an eflags shadow parameter that represents all
of the bits of eflags at once. There are also boolean shadow params for
each bit.
- modified files: cpu/init.cc debug/dbg_main.cc debug/debug.h
gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h
gui/wxmain.cc gui/wxmain.h
member functions are turned on, BX_CPU_C_PREFIX expands to nothing, and any
method that uses BX_CPU_C_PREFIX instead of explictly writing "BX_CPU_C::"
will not be a member function at all. This makes it impossible for code
outside the BX_CPU_C object to call the accessor because sometimes the method
is at ptr_to_cpu->get_EIP() and other times you'd have to do just get_EIP().
The only way I've found to solve this is to remove the BX_CPU_C_PREFIX
and write BX_CPU_C:: instead.
- in debug/dbg_main.cc I removed the EBP, EIP, ESP, SP shortcuts. Now
the accessors are used everywhere. Also I replaced a reference to
the short-lived get_erx() accessor with ones that work: get_EAX(), etc.
- with these changes the current cvs compiles with any combination of
debugger enabled/disabled, SMP enabled/disabled, and x86-64 enabled/disabled.
BX_READ_8BIT_REG() --> BX_READ_8BIT_REGx()
BX_WRITE_8BIT_REG() --> BX_WRITE_8BIT_REGx()
They use an extra parameter "extended". I coded this
as the macro without the "x" for cpu32 compiles. This
allows for ease of merging and code sharing.
to incrementally merge files. For a test, shift16.cc is always
compiled in the cpu/ directory regardless of 32/64-bit configure.
Ultimately, all files will migrate from cpu64 to cpu.