Commit Graph

60 Commits

Author SHA1 Message Date
Stanislav Shwartsman
2e444bee12 Patch received by e-mail from darkelf 2006-11-19 16:18:41 +00:00
Volker Ruppert
e8cd2052c9 - improved gdbstub network efficiency (SF patch #1149659 by Avi Kivity)
- reimplemented "enter debugger" in ask dialog for gdbstub
- X11 and wxWidgets ask dialog now show "Debugger" button for gdbstub
- indent mode changes
2006-10-29 08:48:30 +00:00
Volker Ruppert
3663992ffd - fixed possible segfault when pressing the power button with debugger enabled
- the textconfig 'quit' option must call bx_dbg_exit() if debugger is present
2006-10-02 17:07:36 +00:00
Volker Ruppert
fdefdc5b9f - remove logfunction from list when device is deleted
- fixed typos in harddrv code
2006-09-17 18:09:33 +00:00
Volker Ruppert
e075c68f78 - close logfile and reset logging to stderr at the end of the simulation
- removed unused code
2006-09-09 11:28:52 +00:00
Stanislav Shwartsman
8ed8916ea9 Break to debugger on triple fault or panic (this time do it correctly)
Indent changes
2006-06-12 19:51:31 +00:00
Stanislav Shwartsman
4b7e7087aa Handle more fields memory management insie the bx_param_c.
Remove more strdups
2006-05-30 17:01:27 +00:00
Stanislav Shwartsman
da0b2ac377 Update dependencies for iodev and root project folders.
Fixed compilation errors for 386 case
Added file header for slowdown_timer.h
2006-03-06 22:32:03 +00:00
Volker Ruppert
7646a3ecbd - siminterface now uses the new value BX_LOG_NOTIFY_FAILED in case of failure
(no notify handler registered). The ask() function doesn't set the variable
  bx_user_quit to 1 in that case. This prevents win32 from closing the console
  window immediately in case of a bochsrc error.
2006-01-31 19:37:56 +00:00
Stanislav Shwartsman
2c8f6f7720 Merged patch: determine number of processors to emulate through .bochsrc 2006-01-18 18:35:38 +00:00
Volker Ruppert
4f0a4f2f8f - enable the ask dialog by default for the win32 and x gui, too 2005-11-12 12:27:40 +00:00
Volker Ruppert
02ae558db8 - removed old unused code designed for a save/restore feature
- fixed pcidev targets in iodev/Makefile.in
- updated all Makefile dependencies using a default setup (.conf.linux).
  TODO: dependencies should be generated at compile time since they depend on
  the config settings
2004-12-13 19:10:38 +00:00
Stanislav Shwartsman
e8c1819842 Fix compilation problem caused by
(Cox's CPU panic debug patch from Oct 2003)
committed by  Daniel Gimpelevich at 17/01/2004
2004-10-05 18:59:20 +00:00
Volker Ruppert
c36d0c38e7 - fixed crash after debugger command 'show "call"' (mingw doesn't like %ll and
%*s in one statement)
- defined platform dependant symbol FMT_TICK for cpu ticks output to logfile and
  debugger console
- fixed indent mode in function bx_dbg_symbolic_output()
2004-09-19 18:38:09 +00:00
Stanislav Shwartsman
5873b26a82 Speed up compilation process.
bochs.h already not include iodev.h which reduces compilation dependences for almost all cpu and fpu files, now cpu files will not be recompiled if iodev includes was changed
2004-06-19 15:20:15 +00:00
Daniel Gimpelevich
69a6ede259 Fixed Mac conflict with softfloat. 2004-02-14 06:33:29 +00:00
Christophe Bothamy
cf17f1387b - replace sprintf by snprintf 2004-02-08 11:02:42 +00:00
Daniel Gimpelevich
ae66bb33c0 Applied Russ Cox's CPU panic debug patch from Oct 2003. 2004-01-17 08:36:29 +00:00
Christophe Bothamy
68f3624f66 - fix compile and segfault problems when configuring debugger and smp 2003-08-24 10:30:07 +00:00
Volker Ruppert
04ad96b585 - don't wait for the 'enter' key on the win32 console if the user has pressed
the power button or has chosen "kill simulation" in the "ask" dialog
2003-05-27 18:19:13 +00:00
Bryce Denney
6a44ca37ed Patch name: patch.carbon-startup
Authors: Br'fin, Bryce

- for MacOSX/Carbon, if you start the app by double clicking in the finder,
  there is no text console.  So in logfunctions::fatal(), display the
  final message in a Carbon dialog instead of using fprintf.
- in the text-mode config interface, return an error code if the
  user tries to use the text menus when there's no text console.
  Back in bxmain() this error code causes a panic
  "Bochs needed the text console, but it was not usable"
- if a config file was not found, normally we turn off quick start
  and drop into the text menus.  However in the no-console case the
  text menus won't work, so we added a panic: Unable to start Bochs
  without a bochsrc.txt and without a text console.  This is a much
  more useful error than the generic one above.
- removed ensure_text_console() which was making matters worse instead
  of better.

Modified Files:
  logio.cc main.cc gui/siminterface.cc gui/siminterface.h gui/textconfig.cc
2002-12-17 05:58:45 +00:00
Gregory Alexander
d90c6636ff Added support for a PASS log level. This probably
isn't complete, but it hopefully will do the job.
2002-12-17 03:36:53 +00:00
Bryce Denney
87f1f3a2e0 Apply patch.safe-fullscreen. Comments from the patch follow:
This fixes bug #614724: SDL can get stuck in full-screen mode, and provides
a framework for fixing the problem on other full-screen display libraries
such as term, svga, etc.

- add virtual method bx_gui::set_display_mode(mode) which can be overridden
  by each display library class, if appropriate.  This method is primarily
  used when you run Bochs full screen, to tell the gui to switch from full
  screen back to a mode where you can use the text console.
- There are two display modes: config and simulation.  The mode is changed to
  config mode during logfunctions::ask, during the runtime configuration menu,
  and before displaying a debugger prompt.  It is changed back to simulation
  mode whenever instructions are running.
- Instead of being called directly through the global bx_gui pointer, the
  bx_gui_c::set_display_mode() method is almost always accessed through
  siminterface, like this:
    SIM->set_display_mode (DISP_MODE_CONFIG);
    SIM->set_display_mode (DISP_MODE_SIM);
  Of course siminterface just passes the call on to bx_gui::set_display_mode().
  I added it to siminterface so that the config interfaces could call it.
  (They don't #include bochs.h so they can't access bx_gui.)

Modified Files:
  logio.cc main.cc debug/dbg_main.cc gui/gui.h gui/sdl.cc
  gui/siminterface.cc gui/siminterface.h
2002-12-06 19:34:32 +00:00
Christophe Bothamy
fa012aaa1f - fix half of [ 639143 ] va_list is not a pointer on linuxppc 2002-12-02 21:19:09 +00:00
Bryce Denney
4ece9f81fb - when printing the release description string, handle excessively long lines
with a panic instead of printing 2^30 spaces before and after it
2002-11-11 14:10:24 +00:00
Volker Ruppert
e6348a579e - print an error message when the logfile cannot be opened and use stderr in
that case
2002-10-27 13:20:25 +00:00
Bryce Denney
cec9135e9f - Apply patch.replace-Boolean rev 1.3. Every "Boolean" is now changed to a
"bx_bool" which is always defined as Bit32u on all platforms.  In Carbon
  specific code, Boolean is still used because the Carbon header files
  define it to unsigned char.
- this fixes bug [ 623152 ] MacOSX: Triple Exception Booting win95.
  The bug was that some code in Bochs depends on Boolean to be a
  32 bit value.  (This should be fixed, but I don't know all the places
  where it needs to be fixed yet.)  Because Carbon defined Boolean as
  an unsigned char, Bochs just followed along and used the unsigned char
  definition to avoid compile problems.  This exposed the dependency
  on 32 bit Boolean on MacOS X only and led to major simulation problems,
  that could only be reproduced and debugged on that platform.
- On the mailing list we debated whether to make all Booleans into "bool" or
  our own type.  I chose bx_bool for several reasons.
  1. Unlike C++'s bool, we can guarantee that bx_bool is the same size on all
     platforms, which makes it much less likely to have more platform-specific
     simulation differences in the future.  (I spent hours on a borrowed
     MacOSX machine chasing bug 618388 before discovering that different sized
     Booleans were the problem, and I don't want to repeat that.)
  2. We still have at least one dependency on 32 bit Booleans which must be
     fixed some time, but I don't want to risk introducing new bugs into the
     simulation just before the 2.0 release.

Modified Files:
    bochs.h config.h.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h plugin.cc plugin.h bios/rombios.c cpu/apic.cc
    cpu/arith16.cc cpu/arith32.cc cpu/arith64.cc cpu/arith8.cc
    cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer16.cc cpu/ctrl_xfer32.cc
    cpu/ctrl_xfer64.cc cpu/data_xfer16.cc cpu/data_xfer32.cc
    cpu/data_xfer64.cc cpu/debugstuff.cc cpu/exception.cc
    cpu/fetchdecode.cc cpu/flag_ctrl_pro.cc cpu/init.cc
    cpu/io_pro.cc cpu/lazy_flags.cc cpu/lazy_flags.h cpu/mult16.cc
    cpu/mult32.cc cpu/mult64.cc cpu/mult8.cc cpu/paging.cc
    cpu/proc_ctrl.cc cpu/segment_ctrl_pro.cc cpu/stack_pro.cc
    cpu/tasking.cc debug/dbg_main.cc debug/debug.h debug/sim2.cc
    disasm/dis_decode.cc disasm/disasm.h doc/docbook/Makefile
    docs-html/cosimulation.html fpu/wmFPUemu_glue.cc
    gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/gui.cc gui/gui.h
    gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
    gui/rfb.cc gui/sdl.cc gui/siminterface.cc gui/siminterface.h
    gui/term.cc gui/win32.cc gui/wx.cc gui/wxmain.cc gui/wxmain.h
    gui/x.cc instrument/example0/instrument.cc
    instrument/example0/instrument.h
    instrument/example1/instrument.cc
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/cdrom.cc iodev/cdrom.h iodev/cdrom_osx.cc iodev/cmos.cc
    iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_arpback.cc
    iodev/eth_packetmaker.cc iodev/eth_packetmaker.h
    iodev/floppy.cc iodev/floppy.h iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/ioapic.cc
    iodev/ioapic.h iodev/iodebug.cc iodev/iodev.h
    iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.h
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pic.h
    iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h
    iodev/sb16.cc iodev/sb16.h iodev/serial.cc iodev/serial.h
    iodev/vga.cc iodev/vga.h memory/memory.h memory/misc_mem.cc
2002-10-25 11:44:41 +00:00
Bryce Denney
5e520261db Add plugin support to Bochs by merging all the changes from the
BRANCH_PLUGINS branch!

Authors:
  Bryce Denney
  Christophe Bothamy
  Kevin Lawton (we grabbed a lot of plugin code from plex86)
Testing help from:
  Volker Ruppert
  Don Becker (Psyon)
  Jeremy Parsons (Br'fin)

The change log is too long to paste in here.  To read the change log, do
  cvs log patches/patch.final-from-BRANCH_PLUGINS.gz

All the changes and a detailed description are contained in a patch
called patch.final-from-BRANCH_PLUGINS.gz.  To look at the complete
patch, do
  cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz

Then you will have a local copy of the patch, which you can gunzip and
play with however you want.

Modified Files:
    .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure
    configure.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h state_file.h bios/Makefile.in bios/rombios.c
    cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc
    cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h
    cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc
    cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc
    cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc
    cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc
    cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc
    cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc
    debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in
    doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in
    gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc
    gui/control.cc gui/control.h gui/gui.cc gui/gui.h
    gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
    gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc
    gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc
    gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h
    gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map
    gui/keymaps/x11-pc-de.map instrument/example0/instrument.h
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h
    iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc
    iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc
    iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc
    iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc
    iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc
    iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc
    iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc
    iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc
    iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h
    iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc
    iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h
    iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc
    memory/memory.h memory/misc_mem.cc misc/bximage.c
    misc/niclist.c
Added Files:
    README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in
    ltmain.sh plugin.cc plugin.h
2002-10-24 21:07:56 +00:00
Bryce Denney
e3760bedc8 - change default action on panic to ASK, for wx only. Once I get the
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.
2002-09-25 18:35:06 +00:00
Bryce Denney
8c6f664eb5 - created a spot for Peter Tattam to put his ask code for external debugger 2002-09-23 15:39:53 +00:00
Bryce Denney
eca3ef17dc - How to handle default log options has been somewhat confused for a long
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
2002-09-20 17:56:22 +00:00
Bryce Denney
c3e1511874 - move divider (a bunch of equals signs) down to where it's used, so that
it's within the if !BX_WITH_WX.  Otherwise you get warnings when it's
  not used.
2002-09-15 11:02:22 +00:00
Kevin Lawton
6655634179 I merged the cpu/cpu.h and cpu64/cpu.h files as well as the
other header files.  There no longer are any *.h files in cpu64/.
Had to make some changes to the *.cc files for dealing with
accesses to eip.
2002-09-13 00:15:23 +00:00
Bryce Denney
5d9fa0844e - rename "_long" to "dword" in eip structure in cpu64.
- add get_erx() method to bx_gen_reg_t which returns the erx field of the
  structure (which is has a different name in cpu and cpu64).  Providing
  an accessor is one strategy for avoiding igly "#ifdef BX_SUPPORT_X86_64"
  statements in the rest of the code.
- cpu64/init.cc: the "eflags" before get_flag and set_flag is no longer
  correct. removed.
- modified files: load32bitOShack.cc logio.cc cpu/cpu.h cpu64/apic.cc
  cpu64/cpu.h cpu64/init.cc cpu64/proc_ctrl.cc debug/dbg_main.cc
2002-09-12 18:52:14 +00:00
Bryce Denney
0fdbbae45b - integrate Peter Tattam's x86-64 emulation code into the main branch!
This adds a whole new directory cpu64 with the new emulation code.
  Very few changes were necessary outside cpu64.  To try it, configure
  with --enable-x86-64 and make.
- also this adds Peter Tattam's external debugger interface.
- modified files: Makefile.in bochs.h config.h.in configure.in
  load32bitOShack.cc logio.cc cpu/Makefile.in cpu/cpu.cc debug/dbg_main.cc
- added files: cpu/extdb.cc cpu/extdb.h and cpu64/*
2002-09-12 07:16:37 +00:00
Bryce Denney
4a559e26d9 - skip over some fprintfs to stderr when using wxWindows 2002-09-05 16:40:18 +00:00
Bryce Denney
eaa2f87f05 - logfunctions constructor tries to read bx_options.log.actions[]
to get default values, but I didn't initialize bx_options until
  bx_init_options().  I still think that removing the initializer
  was the right choice, so I made a macro in bochs.h called
  DEFAULT_LOG_ACTIONS(level) that supplies the defaults instead.
2002-09-03 08:32:47 +00:00
Bryce Denney
c6277af486 - no longer include prefix in the ask() message string. The code that has to
print the message will have access to the prefix too.
2002-08-28 03:06:12 +00:00
Bryce Denney
53a9f78a46 - in wxWindows, we can start simulation, stop, reinitialize, and start
again.  This means that the simulation needs to stop in a consistent state,
  including the "reentry check" variables in logfunctions::fatal() and
  logfunctions::ask().
- fatal() is supposed to quit the simulation. add a clear panic message if it
  doesn't quit, but remove the reentry check.  The reentry check was causing
  problems when you stop and start the simulation again.
- in ask(), keep the reentry check but set in_ask_already=0 before
  calling fatal() so that ask() works if we start the simulation again.
  and complain if fatal() fails to die.
2002-08-27 17:03:03 +00:00
Christophe Bothamy
11f74cb4ce - fixed "logprefix" output on non "gnu libc" systems 2002-07-16 12:04:46 +00:00
Christophe Bothamy
383ff23866 - cleaned up the logprefix code 2002-06-28 14:03:47 +00:00
Christophe Bothamy
a926744628 I reworked and included Carl's patch to have a new bochsrc directive
to describe the format of the log prefix. This option can be any string
with special tokens being replaced at run time :
  #   %t : 11 decimal digits timer tick
  #   %i : 8 hexadecimal digits of cpu0 current eip
  #   %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror)
  #   %d : 5 characters string of the device, between brackets
the default is "%t%i%d", so the logprefix is the same as before.

New tokens can be easily added or changed if needed.


Modified Files:
  .bochsrc bochs.h logio.cc main.cc gui/control.cc
  gui/siminterface.h gui/siminterface.cc
  patches/patch.logfilefmteip
2002-06-26 14:42:35 +00:00
Volker Ruppert
4425a91b5a - update the vga screen in the ask() function before executing the dialog
- added break statement in the ask() function after fatal() (necessary for
  wxWindows)
2002-06-01 07:39:19 +00:00
Bryce Denney
30aaf4088e - commit patch.wxwindows.gz in the main branch. Now you can try out
the wxwindows interface by just "configure --with-wx; make"

  Modified Files:
    Makefile.in bochs.h config.h.in configure configure.in
    load32bitOShack.cc logio.cc main.cc cpu/cpu.cc cpu/cpu.h
    debug/dbg_main.cc gui/Makefile.in gui/control.cc gui/gui.cc
    gui/siminterface.cc gui/siminterface.h gui/x.cc iodev/cdrom.cc
    iodev/keyboard.cc memory/misc_mem.cc
  Added Files:
    README-wxWindows wxbochs.rc gui/wx.cc gui/wxmain.cc
    gui/wxmain.h gui/bitmaps/cdromd.xpm
    gui/bitmaps/configbutton.xpm gui/bitmaps/copy.xpm
    gui/bitmaps/floppya.xpm gui/bitmaps/floppyb.xpm
    gui/bitmaps/mouse.xpm gui/bitmaps/paste.xpm
    gui/bitmaps/power.xpm gui/bitmaps/reset.xpm
    gui/bitmaps/snapshot.xpm
  Removed Files:
    patches/patch.wxwindows.gz
2002-04-18 00:22:20 +00:00
Bryce Denney
f9fce32eca - remove broken code that deletes the "io" object. Since all logfunctions
objects point to the io object, it is not safe to delete the io object
  as soon as the first logfunctions object is deleted.  This leaves all the
  other logfunctions objects with pointers to a dead object.
2002-01-07 16:10:11 +00:00
Bryce Denney
cbd68598a3 - apply patch.memleaks-tominac from Darko Tominac <darko.tominac@zg.tel.hr>
which fixes some potential memory leaks
2001-12-21 19:33:18 +00:00
Bryce Denney
15784018db - revert back to rev 1.12 because 1.13 introduced some potential segfaults.
The idea is still a nice one, so I put the changes in a patch called
  patch.update-vga-on-ask, until it gets fixed.
2001-12-08 18:08:24 +00:00
Bryce Denney
003f8dc7e0 - update vga screen when you enter the logfunctions::ask() function. This is
useful because sometimes useful messages are printed on the screen just
  before a panic.  It's also potentially dangerous if the vga update function
  calls ask() again...so I added a re-entry check.
2001-11-21 00:25:15 +00:00
Bryce Denney
5585e0cb30 - fixes based on Roland Mainz's patch.mainz-2001-10-05. 2001-11-12 18:28:07 +00:00
Bryce Denney
49d50d0010 - add another choice when you have action=ask: abort! Calling abort
will dump core, and the core can sometimes be loaded into the debugger
  to give some hints as to what is going on.  This could be especially
  useful when the bochs debugger is off.
- try to do something reasonable when abort() doesn't exist on the system.
2001-10-07 00:35:35 +00:00