Commit Graph

67 Commits

Author SHA1 Message Date
Kevin Lawton 771b1a9558 Added big/little-endian specific declarations for the Bit128{u,s}
types in config.h.in.  It was always in little-endian order.
2002-09-15 05:29:06 +00:00
Kevin Lawton 278e27d5fe Merged proc_ctrl.cc. Also fixed a bug in CR4 reloading; we were
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.
2002-09-14 23:17:55 +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
Kevin Lawton 08576b24be I implemented Global pages. Though, I haven't tested them. :^)
You need to use '--enable-global-pages' to configure in support.
If you have something to boot that uses them, give them a
spin.  Really the were introduced for PPro and above, but
I haven't put in any limits.  CPUID and CR4 report the proper
bits when configured, regardless of --enable-cpu-level at the
moment.
2002-09-10 03:52:32 +00:00
uid94540 293cbc01ea Got rid of very old BX_SUPPORT_TASKING define. That originated
way back when I first added paging support.
2002-09-09 19:48:58 +00:00
Gregory Alexander 4f6039f533 Macroize BX_TLB_QUICK_INVALIDATE code.
Kevin Lawton says he doesn't get a performance benefit.

I'm not sure if I do.  Either way, the difference isn't
very large.

This code may get removed if it turns out to be useless.
2002-09-06 19:21:55 +00:00
Bryce Denney 80a3900b8b - apply a patch I've been working on
- modified files: config.h.in cpu/init.cc debug/dbg_main.cc gui/control.cc
  gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h
  gui/wxmain.cc gui/wxmain.h iodev/keyboard.cc

----------------------------------------------------------------------
Patch name: patch.wx-show-cpu2
Author: Bryce Denney
Date: Fri Sep  6 12:13:28 EDT 2002

Description:

Second try at implementing the "Debug:Show Cpu" and "Debug:Show
Keyboard" dialog with values that change as the simulation proceeds.
(Nobody gets to see the first try.)  This is the first step toward
making something resembling a wxWindows debugger.

First, variables which are going to be visible in the CI must be
registered as parameters.  For some variables, it might be acceptable
to change them from Bit32u into bx_param_num_c and access them only
with set/get methods, but for most variables it would be a horrible
pain and wreck performance.

To deal with this, I introduced the concept of a shadow parameter.  A
normal parameter has its value stored inside the struct, but a shadow
parameter has only a pointer to the value.  Shadow params allow you to
treat any variable as if it was a parameter, without having to change
its type and access it using get/set methods.  Of course, a shadow
param's value is controlled by someone else, so it can change at any
time.

To demonstrate and test the registration of shadow parameters, I
added code in cpu/init.cc to register a few CPU registers and
code in iodev/keyboard.cc to register a few keyboard state values.
Now these parameters are visible in the Debug:Show CPU and
Debug:Show Keyboard dialog boxes.

The Debug:Show* dialog boxes are created by the ParamDialog class,
which already understands how to display each type of parameter,
including the new shadow parameters (because they are just a subclass
of a normal parameter class).  I have added a ParamDialog::Refresh()
method, which rereads the value from every parameter that it is
displaying and changes the displayed value.  At the moment, in the
Debug:Show CPU dialog, changing the values has no effect.  However
this is trivial to add when it's time (just call CommitChanges!).  It
wouldn't really make sense to change the values unless you have paused
the simulation, for example when single stepping with the debugger.

The Refresh() method must be called periodically or else the dialog
will show the initial values forever.  At the moment, Refresh() is
called when the simulator sends an async event called
BX_ASYNC_EVT_REFRESH, created by a call to SIM->refresh_ci ().

Details:
- implement shadow parameter class for Bit32s, called bx_shadow_num_c.
  implement shadow parameter class for Boolean, called bx_shadow_bool_c.
  more to follow (I need one for every type!)
- now the simulator thread can request that the config interface refresh
  its display.  For now, the refresh event causes the CI to check every
  parameter it is watching and change the display value.  Later, it may
  be worth the trouble to keep track of which parameters have actually
  changed.  Code in the simulator thread calls SIM->refresh_ci(), which
  creates an async event called BX_ASYNC_EVT_REFRESH and sends it to
  the config interface.  When it arrives in the wxWindows gui thread,
  it calls RefreshDialogs(), which calls the Refresh() method on any
  dialogs that might need it.
- in the debugger, SIM->refresh_ci() is called before every prompt
  is printed.  Otherwise, the refresh would wait until the next
  SIM->periodic(), which might be thousands of cycles.  This way,
  when you're single stepping, the dialogs update with every step.
- To improve performance, the CI has a flag (MyFrame::WantRefresh())
  which tells whether it has any need for refresh events.  If no
  dialogs are showing that need refresh events, then no event is sent
  between threads.
- add a few defaults to the param classes that affect the settings of
  newly created parameters.  When declaring a lot of params with
  similar settings it's more compact to set the default for new params
  rather than to change each one separately.  default_text_format is
  the printf format string for displaying numbers.  default_base is
  the default base for displaying numbers (0, 16, 2, etc.)
- I added to ParamDialog to make it able to display modeless dialog
  boxes such as "Debug:Show CPU".  The new Refresh() method queries
  all the parameters for their current value and changes the value in
  the wxWindows control.  The ParamDialog class still needs a little
  work; for example, if it's modal it should have Cancel/Ok buttons,
  but if it's going to be modeless it should maybe have Apply (commit
  any changes) and Close.
2002-09-06 16:43:26 +00:00
Kevin Lawton 746f09b427 There's a bug in the repeated IO & mem copy speedups. I
added --enable-repeat-speedups with default to disabled.
Reconfigure/recompile and the speedup code will be #ifdef'd
out for now.  It manifested as junk written to the VGA screen
while booting/running Windows.

Also made some more mods to the main cpu loop.  Moved the
handling of EXT/errorno outside the main loop, much like
the extra EIP/ESP commits were moved, for a little better
performance.

I changed the fetch_ptr/bytesleft method of fetching to
a slightly different model, which calculates a window
for which EIP will be valid (land on the current page),
and a bias which when applied to EIP will be from
0..upper_page_limit.  Speed is about the same for either
method, but a pseudo-op/threaded-interpreter will plug
in better with this and be faster.
2002-09-02 18:44:35 +00:00
Kevin Lawton 3d8e5f8b61 Removed the BX_FETCHDECODE_CACHE mods, and the patch that
Bryce created for use of ensuring all mods were removed
cleanly.
2002-09-01 23:02:36 +00:00
Bryce Denney e7515cd933 - move decision about which ETH_ packet movers are enabled into
config.h.in (from iodev/eth.h)
2002-09-01 21:22:43 +00:00
Kevin Lawton 3a5f338419 Integrated patches for:
- Paging code rehash.  You must now use --enable-4meg-pages to
    use 4Meg pages, with the default of disabled, since we don't well
    support 4Meg pages yet.  Paging table walks model a real CPU
    more closely now, and I fixed some bugs in the old logic.
  - Segment check redundancy elimination.  After a segment is loaded,
    reads and writes are marked when a segment type check succeeds, and
    they are skipped thereafter, when possible.
  - Repeated IO and memory string copy acceleration.  Only some variants
    of instructions are available on all platforms, word and dword
    variants only on x86 for the moment due to alignment and endian issues.
    This is compiled in currently with no option - I should add a configure
    option.
  - Added a guest linear address to host TLB.  Actually, I just stick
    the host address (mem.vector[addr] address) in the upper 29 bits
    of the field 'combined_access' since they are unused.  Convenient
    for now.  I'm only storing page frame addresses.  This was the
    simplest for of such a TLB.  We can likely enhance this.  Also,
    I only accelerated the normal read/write routines in access.cc.
    Could also modify the read-modify-write versions too.  You must
    use --enable-guest2host-tlb, to try this out.  Currently speeds
    up Win95 boot time by about 3.5% for me.  More ground to cover...
  - Minor mods to CPUI/MOV_CdRd for CMOV.
  - Integrated enhancements from Volker to getHostMemAddr() for PCI
    being enabled.
2002-09-01 20:12:09 +00:00
Bryce Denney ffc84c8be9 - add BX_SCHEDULED_DIE_TIME which causes Bochs to exit automatically after a
certain number of instructions.  I use it for performance testing, and it
  won't hurt anyone unless they are foolish enough to enable it in config.h.
  Of course it is disabled by default!
2002-09-01 15:38:29 +00:00
Bryce Denney 03f9b7c4ac - add name for CD-ROM 2002-08-30 06:47:21 +00:00
Bryce Denney 02bae6a701 - now I need names for both floppy and HD 2002-08-28 15:26:09 +00:00
Bryce Denney eca0f0bb57 - add "name" for 1st and 2nd floppy disks. For now, name them a: and b: for
win32 only, and 0 and 1 elsewhere.
2002-08-28 08:29:19 +00:00
Bryce Denney bc78eaaa76 - add configure option --enable-mmx to prepare for Stanislav Shwartsman's
MMX patch
2002-08-26 16:17:10 +00:00
Bryce Denney 26385f2866 - I've added lots of comments in siminterface.h, and tried to clean up
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.
2002-08-26 15:31:23 +00:00
Gregory Alexander c41505e342 Added a RPN directory for the cache to help make invalidates
faster.  Hopefully this won't slow things down too much.

 	config.h.in cpu/cpu.cc cpu/cpu.h memory/memory.cc
2002-06-05 03:59:31 +00:00
Gregory Alexander fda1b874e9 Check in FETCHDECODE Caching, with changes.
Specific changes from the patch:

1.) renamed fdcache_eip to fdcache_ip, as it is using
the RIP instead of the EIP.

2.) added a Boolean array fdcache_is32 which uses is32
to determine icache hits.  Otherwise we could run 32-bit
code as 16-bit or vice versa.


 Modified Files:
 	config.h.in cpu/cpu.cc cpu/cpu.h memory/memory.cc
2002-06-03 22:39:11 +00:00
Bryce Denney ec0a0d115f - add HAVE_TUNTAP flag, so that configure can set it 2002-04-18 01:00:53 +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
Christophe Bothamy d1ef29dc6e - Added a biosdev "pseudo device" to handle the log output of the rombios and vgabios :
. ports 0x0400 0x0401 and 0xfff0 : rombios
  . ports 0x0500 0x0501 and 0x0502 : vgabios
  The rombios log output was previously handled by the unmmapped device
2002-04-01 21:53:23 +00:00
Bryce Denney 9a177ba518 - add configure test for ethertap. On systems which have a header file
called <linux/netlink.h> the ethertap module will be defined.  If other
  OSes turn up that also have ethertap, we can change the test.
- in eth_tap.cc, I replaced the calls to GPL code from maconlinux with
  my own stuff.
2002-03-09 01:04:49 +00:00
Bryce Denney c2e0e409e7 - add --enable-vbe option in anticipation of Jereon Jannsen's VESA BIOS
extensions.
2002-03-08 22:37:06 +00:00
Bryce Denney 41767f5a5f - add configure check for socklen_t, define as int if not already there. 2002-03-08 04:45:00 +00:00
Bryce Denney 556a8fa8f8 - commit patch.check-platform. For full details, pull up the patch itself
and look at the description at the top.  Here's an intro.

  This patch makes significant changes to the configure script.  It adds the
  lines AC_CANONICAL_HOST and AC_CANONICAL_TARGET which detect the OS and
  processor type.  The configure script, knowing the OS and processor type, can
  then make intelligent decisions about which CFLAGS are needed and what is the
  default GUI for that platform.  One of the goals of this patch is to make it
  so that on all supported platforms, "configure;make" will compile cleanly.
  Configure detects the target platform, but it can be overridden by using
  --target=___.  This is important when using one platform to generate
  Makefiles and header files for another platform.  See config.guess script for
  the exact details of platform naming.

  The defaults that are currently implemented in the modified configure script
  include:
    If platform is windows* or winnt*, use win32 gui.
    If platform is cygwin*, use win32 gui and compile with
       "-mno-cygwin -DWIN32".
    If platform is macosx* or darwin*, use carbon gui and compile
       with "-fpascal-strings -fno-common -arch ppc -Wno-four-char-constants
       -Wno-unknown-pragmas -Dmacintosh"
    If platform is macos, use macos gui.
    If platform is beos, use beos gui.
    If platform is amigaos, use amigaos gui.
    Otherwise, use X windows gui.
2002-03-07 16:00:39 +00:00
Bryce Denney ee6b54f395 - distinguish between WIN32 the platform and WIN32 the gui library.
use #if defined(WIN32) to determine if you are on that platform
  and #if BX_WITH_WIN32 to determine if you are using that gui.
2002-03-06 19:16:40 +00:00
Gregory Alexander 57273620e6 Added an experimental realtime PIT to the mix.
This is basically the opposite of the slowdown timer.  Instead
of trying to keep the PIT ticks in sync with bochs time, we
keep them in sync with REAL time.  This is bad because it creates
unreproducible fails, but it's good if you want to run bochs at
maximum speed on your machine.  However, bochs will take all of
the available resources from the machine also.

DO NOT use this with the slowdown timer.  Results would be
unpredictable.
2002-02-07 21:22:55 +00:00
Volker Ruppert 8bf4e10948 - check for the validity of BX_USE_IDLE_HACK moved after the gui definition 2002-01-27 09:24:08 +00:00
Bryce Denney 2cd62e75c8 - Dave enabled the E9 hack in config.h.in, but it had no effect. The correct
way is to make the configure.in default to turning it on.  The value in
  config.h.in will be replaced by configure anyway.
2001-12-05 16:25:24 +00:00
Bryce Denney 4b60b69bf4 - fail fast if you try --enable-idle-hack with any gui except for X11. 2001-11-12 00:49:57 +00:00
Bryce Denney 50f84e5947 - add configure switch called --enable-idle-hack that turns on
Roland Mainz's idle patch.
2001-11-12 00:43:59 +00:00
Bryce Denney 7c92e20272 - add test for getenv 2001-11-11 05:43:12 +00:00
Bryce Denney cd88c86840 - add configure check for the abort function, which I will use as a
choice when a panic occurs.
2001-10-07 00:10:19 +00:00
Bryce Denney dbb6d5f821 - remove my ill-conceived configure test for wsprintf. It really is
available in cygwin, and I don't know what I was thinking before.
2001-10-05 13:52:25 +00:00
Bryce Denney 7fcffe0c38 - make symbol for BX_HAVE_WSPRINTF 2001-10-05 06:07:46 +00:00
Bryce Denney 2d257370af - resolve conflicts in Boolean type for MacOS X 2001-09-26 17:30:15 +00:00
Bryce Denney 3abf0831a5 - add configure option "--with-carbon" which is used for MacOS X compiles 2001-09-26 00:13:16 +00:00
Bryce Denney 141da24c74 - add symbols, which default to zero, for slowdown timer and sleep functions 2001-09-24 05:35:05 +00:00
instinc 0a604c877b Added I/O Interface to the debugger option, disabled by default 2001-09-14 14:51:26 +00:00
Bryce Denney bf286c20ac - configure and makefile changes for AmigaOS port. Now configure
--with-amigaos is allowed and sets up the makefiles correctly.  It
  defines a symbol called BX_WITH_AMIGAOS, which should be used in
  #if..#endif constructs that are specific to amigaos.
- if --enable-cdrom is used with --with-amigaos, the cdrom_amigaos.o
  object file will be added to CDROM_OBJS in the iodev makefile.
2001-08-15 20:33:47 +00:00
Bryce Denney 4d8a524e81 - add --enable-new-pit option to turn on Greg's PIT model 2001-08-15 17:51:10 +00:00
Bryce Denney ec0fbf18bc - convert nearly all bx_options to parameter form. All options that have
been converted into parameters temporarily have the letter "O" appended
  to their name.  I don't want to keep it this way, but it has helped
  in the conversion process because the compiler refuses to compile the
  old uses of the name.  Before I started using the "O" trick, there were
  many bugs like this:   if (bx_options.diskc.present) {...}
  This was legal with the new parameters, but it was testing whether the
  parameter structure had been created, instead of testing the value of
  the present parameter.  Renaming present to Opresent turns this into
  a compile error, which points out the incorrect use of the param.
- the "--disable-control-panel" no longer works, I'm afraid.  I can no
  longer support this and continue progress.
2001-06-20 14:01:39 +00:00
Bryce Denney 01d7de33ad - add logging code to eth_fbsd, similar to eth_null.cc 2001-06-19 16:09:13 +00:00
Bryce Denney 1ae66aeeb6 - added empty stubs for serial_raw. To try it out, define USE_RAW_SERIAL
in config.h and add serial_raw.o to the makefile in the iodev directory.
2001-06-16 19:27:41 +00:00
Bryce Denney 0998d63de7 - add eth_null logging switch, currently on. 2001-06-13 22:28:17 +00:00
Bryce Denney f822257511 - there were cases where BX_APIC_SUPPORT were used and others where
BX_SUPPORT_APIC were used.  To follow the pattern used by other
  names like this, I changed them all to BX_SUPPORT_APIC.
  Thanks to Tom Lindström for chasing this down!
2001-06-12 13:07:43 +00:00
Bryce Denney 19bbda01ca - add test for struct timeval 2001-06-12 03:37:55 +00:00
Gregory Alexander 56b670a371 Added ssize_t to cygwin setup. Should compile out of
the box under cygwin.
2001-06-10 21:26:11 +00:00
Bryce Denney 8b7fbca53e - more work on text-mode control panel. Now the control panel starts before
the simulation begins, to give you a chance to choose between bochsrcs,
  choose the boot disk, etc.
2001-06-09 20:01:12 +00:00