Include SDL.h so that the C language prototype can be found. Otherwise
SDL_main() will get its name mangled and not match what the SDL library is
expecting.
restart another one in wxWindows. Fixed that. Also, on restart, the
apic id's left over from the first run were causing panics. Fixed that.
- modified: main.cc cpu/apic.cc cpu/cpu.h cpu/init.cc
- 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
(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.
- Features :
. number of active channels defined at boot-time config
. new options in bochsrc
. up to 8 devices support (disks or cdroms)
. up to 4 cdrom devices can be changed at runtime config
. wxwindows config interface
interface) by using get/set_default_log_action. This has very minimal effect
on the behavior of the text config interface.
- modified: main.cc gui/control.cc
time, so I've tried to improve it. Now the logfunctions class has a
static field default_onoff[] which represents the default actions for
each kind of log message. Default_onoff[] is initialized with static
data so it should be valid by the time it's used. This can be reached by
static accesors logfunctions::set_default_action and
logfunctions::get_default_action. It seemed appropriate to put the defaults
inside the logfunctions class, rather than in bx_options or siminterface.
However, to make them accessible to the config interface, I added similar
methods in siminterface that map to the accessors in logfunctions.
- logio.cc had two different definitions of LOG_THIS for different halves
of the file, which was ugly and confusing. (LOG_THIS is needed for BX_INFO,
BX_DEBUG, etc.) I removed the first definition and fixed the minor compile
problems that ensued. In the initializers for iofunctions, everything
is complicated because of the unpredictable order that constructors get
called. They must use this->log to print things, because genlog hasn't
been initialized yet.
- now if SIM->set_log_action(int mod, int level, int action) is called
with mod<0, it sets the action for all modules/devices instead of just one.
- modified: bochs.h logio.cc main.cc gui/siminterface.cc gui/siminterface.h
delivered to both the GUI and simulator thread, so they both call
bx_signal_handler. This can lead to deadlock as multiple threads enter
BX_PANIC and try to show a dialog box at once. To solve the problem, I made
a function isSimThread() which can be called from anywhere. If the
bx_signal_handler is called from any thread OTHER THAN the simulation thread,
it returns without doing anything. As a result, only one thread is allowed
to enter the signal handler code, and now control-C works correctly.
Bochs to immediately read the bochsrc and start simulating immediately (as
opposed to going into the configuration interface first). Now -q does
the right thing in the wxWindows interface. It behaves as if you selected
Read Configuration and then Simulate:Start.
- modified: main.cc gui/siminterface.cc gui/siminterface.h gui/wxmain.cc
think i is still defined the second time.
- MSVC++: can't use a variable to define another variable's array bounds.
Now I use a #define for the array bounds instead.
to change the enable/disable status of other parameters worked fine for
the text mode interface but poorly for the wxWindows gui. So I
implemented it a different way. Now in every boolean parameter, there is
a field called dependent_list which is a list of parameters which
are enabled/disabled by that boolean. Having this list available
allows both the text mode CI and the wxWindows CI to know which fields
should be enabled and disabled as a result of a boolean changing value.
- I've made this change in many of the parameters, in the init code of
main.cc. When I add a dependent_list, I no longer need the "handler"
so I remove the call to set_handler and the cases in the handler
functions.
- in the process, I also made the serial and parallel port init code
into loops, instead of hardcoded initialization. Now if you change
the number of serial/parallel ports in bochs.h the correct number of
ports will be initialized and the menus will grow/shrink accordingly.
- fixed up a few names to improve the look of ParamDialog generated
dialogs.
access routines in access.cc, completing the upgrade of
those routines. You do need '--enable-guest2host-tlb', before
you get the speedups for now. The guest2host mods seem pretty
solid, though I do need to see what effects the A20 line has
on this cache and the paging TLB in general.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
bx_do_text_config_interface() to make it clear that it's not used
with wxWindows. Before, it was around only the line of that function that
failed to compile.
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
mirrored the use of enable_control_panel exactly. This should not cause
any change in behavior, and it lets me eliminate these methods which
don't make much sense anymore.
- loading default bochsrc for the wx gui no longer necessary
- the wx gui version of bochs now accepts the same command line arguments as
the other guis
to "*_ENABLED"
- bx_serial_options for all 4 ports moved into an array com[4]
- serial port com1 is enabled by default
- detection of com2, com3 and com4 config options disabled for now
- new parameter "enabled" added to the serial bochsrc options
- error handling for serial and parallel bochsrc options changed. The unhandled
BX_PANICs are replaced by BX_ERRORs.
- new function bx_write_serial_options() added
- serial destructor restores original terminal settings only when serial port
is enabled and the tty_id is valid
parport1 with the new option "enabled". The old option "enable" only
controlled the output. The parport1 is enabled with no output by default.
Changes:
* bochrc option "enable" replaced by "enabled"
* parport option "Oenable" replaced by "Opresent"
* bx_parport_options par1 and par2 replaced by an array par[2]
* initialize parport1 resources only when enabled
* renamed variable "parport_init_list" to "par_ser_init_list" since it
contains parport and serial options
* documentation and bochsrc updates
- the parport variables "output" and "initmode" now belong to the bx_par_t
structure
- TODO: add parport2 (disabled by default), parport detection in the bios
installation dependent values in a global configuration file. If you are
including such a file, you only need to define the disk images and other
guest OS dependent stuff.
- new command line option '-q' (quickstart) added (the same as '-nocp')
- new command line option '-qf' (quickstart + config file) added (the same as
'-nocp -f')
- missing initialization of Ouser_shortcut in bx_options added
the guest OS. The shortcut can be defined in the bochsrc or in the config
interface. It is possible to change it at runtime.
These shortcuts are currently recognized:
ctrlaltdel, ctrlaltesc, ctrlaltf1, alttab
Here is the list of changes:
* userbutton.h and userbutton.xpm added in gui/bitmaps
* config options for the userbutton shortcut added
* initialize the new button in the gui.cc
* the new userbutton handler generates keypresses and relaeses depending on
the shortcut keyword
* the gui stops adding buttons to the headerbar if not enough space is left.
This can happen when the screen width is 320 pixels (done for X11 only).
* TODO: build a dialog box for the wxWindows gui
more work in the floppy and bios code.
- floppy and cdrom entries in the runtime config menu can be disabled if the
drive wasn't defined in bochsrc or start menu
- floppy variable "initial_status" and cdrom variable "inserted" renamed to
"status"
- unused variable *ips in function build_runtime_options_prompt() disabled
* new floppy type 360k can be used in .bochsrc and the config interface
* media type and geometry can be set for the floppy type
* BIOS changes to make 360k floppy drives work
* bximage can create 360k images now