Commit Graph

2524 Commits

Author SHA1 Message Date
Volker Ruppert
3c769207e2 - fixed some warnings at BX_INFO, BX_PANIC, BX_ERROR and BX_DEBUG 2002-10-06 20:19:03 +00:00
Bryce Denney
849bb18274 - remove example lines that have # comments. the parser can't handle them. 2002-10-06 19:39:20 +00:00
Volker Ruppert
75ba36cb15 - fixed some warnings at BX_INFO, BX_PANIC, BX_ERROR and BX_DEBUG 2002-10-06 19:38:54 +00:00
Bryce Denney
555e1d03e1 - set the quit context to NULL after it is no longer usable. I don't want
anybody jumping back because the pointer was still lying around.
- modified: gui/wxmain.cc main.cc
2002-10-06 19:21:05 +00:00
Bryce Denney
c818baa0c9 - modified every I/O device so that it will not re-register its timers
if init() is called a second time.  This allows me to restart a
  simulation (wxwindows interface only) without restarting the whole
  application.
- modified: iodev/*.cc
2002-10-06 19:04:47 +00:00
Kevin Lawton
2baf4372d1 Got rid of Ctrl-M's in exception.cc, introduced with the
implementation of SYSCALL.
2002-10-06 18:05:21 +00:00
Bryce Denney
6dff398915 - remove tabs 2002-10-06 17:49:11 +00:00
Kevin Lawton
361835824c unregisterTimer() really frees the timer slot. Added a new field
in pc_system.h to flag each timer slot as being allocated or not.
  register_timer*() functions will claim a free slot if one
  exists before using one at the end of the list.  This will allow
  for this function to be called repeatedly and not have to run
  out of timer slots.
2002-10-06 17:29:22 +00:00
Bryce Denney
8ebc11df90 - use SDL_WarpPointer to keep the mouse from going outside the window.
This must be done carefully though, because the call to SDL_WarpPointer
  generates a mouse motion event of its own.  To work around this, I have
  added code that should ignore motion events generated by SDL_WarpPointer.
  This should fix bug [ 619283 ] SDL: os mouse pointer leaves the window.
  On Linux, SDL 1.2.3 it works fine.
2002-10-06 17:17:14 +00:00
Kevin Lawton
8ef1a6b8b0 Added a function to un-register a bochs timer, in case a component
wants to free up that resource.

  unsigned unregisterTimer(int timerID);

Pass in the timer index received from the register function.  A return
  of 1 means success.  NOTE: you must make sure the timer is deactivated
  first.  Call deactivate_timer() to be sure.  A return of 0 means
  failure, though a panic is really generated.

For now, this function does not really free up the slot, but will soon.
2002-10-06 14:55:06 +00:00
Kevin Lawton
261badee5a Added a couple macros which expand on GCC to __attribute__ directives
to give the compiler some hints:

    BX_CPP_AttrPrintf(formatArg, firstArg)
    BX_CPP_AttrNoReturn()

The first is to tell the compiler that a function receives printf-like
  arguments so it can do some smart argument checking w.r.t. the
  format string.  The 2nd tells the compiler that the function does
  not ever return; it's not used yet, but I'd like to use it on
  exception() after we fix the situation of it returning for debugging.

I fixed one parameter mismatch in cpu/ by deleting a deprecated
  debug print statement.  There are several other mismatches in
  other code modules.
2002-10-06 14:16:23 +00:00
Bryce Denney
346e2747d3 - fixed up ParamDialog to correctly handle "trees" of parameters. A
bx_list_c can now be displayed as either a wxStaticBox with the
  child parameters inside, or as a wxNotebook with each child
  parameter in a separate tab.  (The children can also be lists of
  course.)  The default display is the wxStaticBox type, but if you
  set the option bit bx_list_c::USE_TAB_WINDOW in the list,
  ParamDialog will use the wxNotebook display instead.
- to get the param trees working, I created a new struct
  AddParamContext, which is passed to AddParam().  This struct is
  critical when AddParam calls itself recursively to display lists
  within lists.
- use the wxNotebook display feature for the ATA0,1,2,3 controller
  dialog box.  Now instead of being hundreds of pixels tall, it is
  reasonable height with three different tabs.  This fixed bug
  #619074: "wx: ATA interface editor too tall" and was the whole
  reason I started messing with this at all.

plus some minor cleanups
- when I added the enum constant bx_list_c::USE_TAB_WINDOW, I also
  removed the BX_ prefix from all the other enum constants that are
  used in parameter options in siminterface.cc.  Since these constants
  are enums within a class, there is no possibility of namespace
  conflicts so the prefix is not needed.
- added wxADJUST_MINSIZE to all wxChoice controls, since that tells
  wxWindows to adjust its size to the length of the longest string.
- instead of calling SetSize or SetSizeHints on every textcontrol with
  a hardcoded width, I am using just two wxSize specifications for
  everything: either normalTextSize or longTextSize.
- edit names of a few menus and params.  For example now instead of
  the tab saying "Master ATA device on channel 0" it will say
  "First HD/CD on channel 0".

Modified Files:
  main.cc gui/control.cc gui/gui.cc gui/siminterface.cc gui/siminterface.h
  gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc
2002-10-06 02:37:28 +00:00
Bryce Denney
fdadda0ba8 - remove tabs 2002-10-05 23:11:59 +00:00
Volker Ruppert
d2c286797e - missing conditions for lower_irq() added:
* hardware reset
  * setting software reset bit to 1
  * writing to command register
2002-10-05 19:40:51 +00:00
Bryce Denney
78b179d97c - if we're going to print "dimension update", might as well say what the
new values are
2002-10-05 18:27:24 +00:00
Bryce Denney
f5e351f12d - fix serious color bug in UpdateScreen. Because it considered newBits
to be signed instead of unsigned, it was looking up color values
  like wxBochsPalette[-126] instead of wxBochsPalette[130].  This affected
  any colors in the palette between 128 and 255.  I simply hanged newBits
  to signed, and it fixed bug #618462: wx: 256 color modes not working properly
- I am still not satisfied with the way that wxWindows maps colors on an
  8-bit display, but that is a different issue.
2002-10-05 18:15:00 +00:00
Bryce Denney
b147067051 - palette_change must return 1 to indicate that a screen update is needed
after the palette changes.  This makes the iodev/vga.cc code do the
  right thing.  This also fixes the toolstar splash screen, but at a
  fraction of the cost of the solution in rev 1.37.
2002-10-05 17:45:48 +00:00
Bryce Denney
7f8482cc93 - revert previous revision 1.37. There is a really easy solution which
I will check in instead.
2002-10-05 17:42:51 +00:00
Bryce Denney
494d0784ac - when the colormap changes, any existing pixels on the screen of that color
need to be updated.  This was impossible before, because we only stored the
  RGB values in wxScreen.  I added a new array called wxPixel that stores the
  8-bit color index that should be displayed.  Now if the VGA palette changes,
  I use wxPixel data to reconstruct wxScreen using the new palette.
- this fixes the display of the splash screen of the Toolstar disk, since
  it relied on drawing the picture and then fading the colormap from back
  up to the normal values.  I was hoping it would fix the splash screen of
  win95 too, but it does not.
2002-10-05 17:24:20 +00:00
Volker Ruppert
7158dd8a11 - result data of the ATAPI command 'inquiry' fixed. The strings are padded with
spaces now.
- BX_PANIC at 'read multiple sectors' changed to BX_ERROR
2002-10-05 16:49:03 +00:00
Kevin Lawton
b1d2f7ae48 Added a return value to handleAsyncEvent() so that requests to
exit out of cpu_loop() and back to the caller can be honored.
  Previously, code in this function was a part of cpu_loop so
  a "return;" would already do that.  Now, a value is passed
  back to cpu_loop() to denote such a request, and then a return
  is executed from cpu_loop().

  I haven't tested this yet, but previously I must have broke
  certain debugging requests by moving the code to a separate
  function and not fixing the "return;" statements.
2002-10-05 14:51:25 +00:00
Bryce Denney
89cf45ec2d - remove tabs 2002-10-05 12:40:34 +00:00
Bryce Denney
f7b3ba2a76 - removed this patch because it was complete junk 2002-10-05 12:24:59 +00:00
Bryce Denney
4650017086 - remove AC_MSG_NOTICE([using $WX_CONFIG as ...]) because it looked like
an error message even though it was perfectly normal.
2002-10-05 12:07:51 +00:00
Peter Tattam
db0a37824c Fixed elusive APIC interrupt problems when bochs compiled for P6 or later.
Symptom:  Linux kernel 2.4.19 would hang in random places.  CPU still
running, but in dle loop.

Cause: if APIC interrupt occurred while a PIC interrupt was pending, the
PIC interrupt would be lost.  This is because either an APIC or PIC
interrupt would trash any pending interrupt event because INTR is only a state,
not an event queue.

Temporary fix: reworked apic.cc to have it's own copy of INTR state. cpu.cc now
checks for both cpu.INTR and local_apic.INTR.

Need to do further research to see if local_apic and pic can be integrated in such
a way as properly manage the combined effects of both devices accessing INTR state.
2002-10-05 10:25:31 +00:00
Volker Ruppert
4bdd5acaeb - calculation of the number vertical tiles added for all graphics modes.
- screen height of the graphics mode 640x350 fixed
2002-10-05 08:04:28 +00:00
Kevin Lawton
0d22bbafc2 Added a new function writeEFlags() which takes a 32-bit eflags
value and a change-mask, rather than passing all the boolean
  change flags as arguments.

Recoded the POPF instruction in flag_ctrl.cc to use the
  new writeEFlags() function, and to make it more sane.

Also, the old write_flags() and write_eflags() functions
  redirect to writeEFlags() for now.  Later, when we get
  back in a development mode, it would be better to make
  all calls use the new function and get rid of the old ones.
2002-10-05 06:33:10 +00:00
Bryce Denney
315e7064a2 - limit should be a 20-bit field, not a 16-bit field, coming from
bits 19:16 of high and then 15:0 of low.  This fixes
  bug #597737: info gdt broken: incorrect segment length
2002-10-04 23:16:48 +00:00
Bryce Denney
57e1762aa8 - fix register trace output. We want to print 0 or 1 for every boolean
flag, so it needs to call the getB accessor, not the get accessor.
2002-10-04 23:01:56 +00:00
Bryce Denney
d754550d47 - a boolean variable is represented by just 1 bit, 0=false or 1=true. We have
been using the Boolean type for a number of multi-bit fields on the
  assumption that it is actually many bits wide.  However, this assumption is
  unsafe and has caused some bugs that are hard to track down.
- in the Carbon library on MacOS X, Boolean is defined to be an unsigned char.
  This has been causing some of the EFLAGS accessors to fail (bits 8-31)
  because they depended on Boolean being 32 bits wide.  I changed these
  accessors to return Bit32u instead.  I believe that this will finally fix
  [ 618388 ] Unable to boot under MacOS X.
- It would be possible to create a bochs specific type for booleans (bx_bool),
  but it's cleaner to simply use "Boolean" when we actually mean a 1-bit true
  or false field, and Bit8u/Bit32u when it is a multibit field.
2002-10-04 22:25:22 +00:00
Bryce Denney
97197e326b - clarify why Boolean is defined as unsigned char for Carbon. 2002-10-04 22:11:58 +00:00
Kevin Lawton
66452e9898 Replaced tabs in cpu/*.{cc,h} files with spaces. 2002-10-04 17:04:33 +00:00
Christophe Bothamy
7c35cfb980 - fixed size mismatch 2002-10-04 16:47:29 +00:00
Kevin Lawton
f64eb0e16a Changed the hot countdown timer in pc_system.* files to be
32-bits rather than 64.  This is possible, because there is
  always an active null (heartbeat) timer, with periodicity
  of less than or equal to the maximum 32-bit int value.

  This generates a little less code in the hot part of cpu_loop,
  and saved about 3% execution time on a Win95 boot.

Moved the asynchronous handling code from cpu_loop() to its
  own function since it's a long path.  This neatened up the
  code a little (less gotos and all), and made it more clear
  to use a "while (1)" around the iterative code in cpu_loop().
2002-10-04 16:26:10 +00:00
Mike Lerwill
3d5c7b058a Minor fix to bring into line with usage in lines above (removes msvc warning) 2002-10-04 15:10:13 +00:00
Bryce Denney
690adc16bf - apply patch from Alexander Krisak (darkelf@newmail.ru)
which adds a help command to the debugger
- modified: debug/dbg_main.cc debug/debug.h debug/lexer.c debug/lexer.l
  debug/parser.c debug/parser.h debug/parser.y docs-html/debugger.html
- removed the patch file now that the changes are committed
2002-10-04 14:57:36 +00:00
Bryce Denney
4f6302bf8e - add patch from Alexander Krisak (darkelf@newmail.ru) 2002-10-04 14:38:16 +00:00
Bryce Denney
3cce195f98 - apply October 3 patch from Jeremy Parsons (brefin)
[ 539764 ] MacOS/MacOS X missing headerbar icons
  http://sourceforge.net/tracker/index.php?func=detail&aid=539764&group_id=12580&atid=112580
2002-10-04 13:26:58 +00:00
Bryce Denney
dbc3fa9220 - make the lowest level functions, put_buffer and get_buffer, into
BX_DEBUGs instead of BX_INFOs so that it's easier to read the higher
  level output.
- use bx_vga.timer() instead of BX_VGA_THIS timer().
2002-10-04 13:20:09 +00:00
Volker Ruppert
757823f1ab - force a text screen update after a charmap change 2002-10-04 10:52:44 +00:00
Bryce Denney
9f73882054 - surely I didn't mean to put GUI_CFLAGS into the bios compile line! 2002-10-04 06:08:38 +00:00
Bryce Denney
602df95c3c - replace old bochs-icn.icns with new one from Jeremy Parsons. See this patch
[ 618071 ] Cleaned up MacOSX Application Icon
  His comments:
  > The original icon was actually in a .bin (MacBinary)
  > format but lacked that extension. So wouldn't work in
  > practice.
  >
  > I've cleaned up the icon by adding transparent areas.
  > (So it doesn't show up as a white square with the image
  > in it) as well.
2002-10-03 21:26:32 +00:00
Bryce Denney
f54551717e - include <windows.h> in bochs.h whenever WIN32 is defined. This is required
so that windows types can be used in fields, for example in cdrom.h:
    #ifdef WIN32
      HANDLE cdrom_interface::hFile;
    #endif
- since every file includes bochs.h, I removed includes of <windows.h>
  everywhere else
- modified: bochs.h cpu/extdb.cc gui/win32.cc gui/wx.cc iodev/cdrom.cc
  iodev/eth_win32.cc iodev/floppy.cc
2002-10-03 21:07:04 +00:00
Bryce Denney
e44407be1d - give configure error if you try --enable-debugger and --enable-gdb-stub
at the same time.
2002-10-03 21:03:56 +00:00
Kevin Lawton
4e9db8b224 Removed patches/patch.extra_eflags_asms since I just integrated it. 2002-10-03 18:13:41 +00:00
Kevin Lawton
8e33d2eda1 Integrated patches/patch.extra_eflags_asms from Jas, for more asm()
coverage of the high-frequency eflags instructions.  That should
  complete the asm() eflags updates for now, as we should be stabilizing
  moving towards bochs 2.0.
2002-10-03 18:12:40 +00:00
Kevin Lawton
f344c3df8d Added patch from Jas Sandys-Lumsdaine. I'll review this soon and
integrate it, if it looks good.  Putting here for the CVS trail.

  "This patch adds extra inline asm statements for the most important
  instructions I found to be still resorting to lazy flags execution.
  I counted the instructions that "hit" and "missed" when an eflag
  value was needed - if there was a miss, the flag was not known and
  had to be calculated with lazy_flags.cc. The culprit instruction
  which last executed to affect the eflags was tallied."
2002-10-03 17:23:11 +00:00
Kevin Lawton
295ef3b966 Removed these alternate files since I integrated them into the
main code.
2002-10-03 17:19:27 +00:00
Kevin Lawton
ee47fabac0 Committed new bochs internal timers (in pc_system.{cc,h}.
These seem to be working better, are a more simple design,
  easier to understand, and AFAIK don't have race conditions
  in them like the old ones do.

Re-coded the apic timer, to return cycle accurate values
  which vary with each iteration of a read from a guest OS.
  The previous implementation had very poor resolution.  It
  also didn't check the mask bit to see if an apic timer
  interrupt should occur on countdown to 0.  The apic timer
  now calls its own bochs timer, rather than tag on the
  one in iodev/devices.cc.

I needed to use one new function which is an inline in
  pc_sytem.h.  That would have to be added to the old pc_system.h if
  we have to back-out to it.

Linux/x86-64 now boots until it hits two undefined opcodes:

  FXRSTOR (0f ae).  This restores FPU, MMX, XMM and MXCSR registers
    from a 512-byte region of memory.  We don't implement this yet.

  MOVNTDQ (66 0f e7).  This is a move involving an XMM register.
    The 0x66 prefix is used so it's a double quadword, rather than
    MOVNTQ (0f e7) which operates on a single quadword.

  The Linux kernel panic is on the MOVNTQD opcodes.  Perhaps that's
  because that opcode is used in exception handling of the 1st?

  Looks like we need to implement some new instructions.
2002-10-03 15:47:13 +00:00
Volker Ruppert
171038a28a - stop drawing if the y position is outside of the visible screen. Some graphics
modes have caused a segmentation fault in that case (e.g. CGA 320x300x4)
2002-10-03 13:12:20 +00:00
Volker Ruppert
f3b7378307 - added multiple cdrom support for win32 (NT/2000 version untested). The ASPI
version uses the cdrom drives in the system's order. Drive letters are not
  used by ASPI.
- wrong BX_INFO message for ASPI disabled. The version number is never checked.
2002-10-03 11:59:37 +00:00
Bryce Denney
eef4867ca4 - remove reference to gdbstub.h, which I merged into bochs.h. It was
only a few lines.
2002-10-03 05:43:35 +00:00
Bryce Denney
ead7438d4f - this patch is in cvs now, with a few minor changes. Some of the
modifications to panics and things in cpu I also applied, but checked in
  separately.  See [ 609616 ] remote GDB stub for more information.
2002-10-03 05:31:48 +00:00
Bryce Denney
e568d14ef3 - add GDB stub patch by Johan Rydberg 2002-10-03 05:29:15 +00:00
Bryce Denney
f62c75ff5d - add GDB stub patch by Johan Rydberg 2002-10-03 05:23:20 +00:00
Bryce Denney
3fe65ab230 - enable dbg_fetch_mem and dbg_set_mem when compiling for GDB stub 2002-10-03 05:15:28 +00:00
Bryce Denney
75ce3842d2 - add GDB stub patch by Johan Rydberg 2002-10-03 05:14:50 +00:00
Bryce Denney
aeffd3e212 - improve panic slightly to show limits on LDT, if the limit is exceeded 2002-10-03 05:10:24 +00:00
Bryce Denney
3e797e33d1 - add symbol BX_GDBSTUB that enables gdb stub 2002-10-03 04:58:03 +00:00
Bryce Denney
0d28420aa2 - provide dbg_xlate_linear2phy when running as GDB stub 2002-10-03 04:53:53 +00:00
Bryce Denney
534c4985d9 - specify the exception type on triple exceptions 2002-10-03 04:52:39 +00:00
Bryce Denney
6c5b223752 - improve panic msg slightly 2002-10-03 04:49:47 +00:00
Bryce Denney
de68ca74d9 - call BX_CPU_C::set_INTR(0) instead of just setting the INTR value.
The result is the async_event gets set, though as far as I can tell
  it makes no difference.
2002-10-03 04:45:17 +00:00
Bryce Denney
add4fbe892 - allow user to specify $WX_CONFIG variable before running configure, to
override default.  This is useful if you have more than one wx installation,
  for example debug and release libraries.
- modified: Makefile.in configure.in configure
2002-10-03 02:26:32 +00:00
Bryce Denney
cbf9307ad9 - workaround for SDL compile problem on MacOS X 2002-10-02 19:23:01 +00:00
Bryce Denney
e17ae7dee8 - turn on guest2host tlb for beos 2002-10-02 12:43:01 +00:00
Bryce Denney
698da0c303 - compile beos-specific cdrom file if $target says beos, rather than if
they used --with-beos.
2002-10-02 12:11:25 +00:00
Kevin Lawton
1aeb4c71b1 Updated the alternate pc_system.{cc,h} files to add the ID string
parameter so we know which source modules are requesting
  timers.  Also added a SpewPeriodicTimerInfo #define in
  case somebody is still having guest OS hang problems.  If
  enabled, this macro will force a brief dump of the active timers
  list to the bochsout.txt file, every 5Million ticks.
  If the lowest timer's period is extremely low, that would be
  suspect.
2002-10-02 05:54:34 +00:00
Kevin Lawton
83c9d266d0 Added a field on register_timer() so that a name identifying the
requesting source can be registered as well.  Otherwise, there
  is no way to know which source modules are requesting
  suspect frequencies which are too high.
2002-10-02 05:16:01 +00:00
Bryce Denney
7a5b4377fb - replace new preprocessor directive "#panic" with call to BX_INFO and
UndefinedOpcode().
2002-10-02 04:01:45 +00:00
Bryce Denney
c901d60d00 - only XFlush if display has been opened already 2002-10-02 02:52:24 +00:00
Bryce Denney
2f502adc45 - add --subsystem,windows -mwindows to link line for win32 compile with
wxwindows
2002-10-02 00:53:20 +00:00
Bryce Denney
e377b6dd5d - when building on for win32, add a "windres" command to build the
resources into wxbochs_resources.o, and link them in.
- modified: Makefile.in configure.in configure
2002-10-02 00:09:49 +00:00
Bryce Denney
4c9776fb96 - add -lwinmm to the link lines anytime you use --enable-sb16=win. Now
instead of winmm being a part of GUI_LINK_OPTS_WIN32 only, it is
  placed in @DEVICE_LINE_OPTS@ so that it will be used for sdl, rfb, wx,
  etc.
- solve compile problems when building bximage, niclist, and any other
  console based program.  The compile flags returned by wx-config and
  sdl-config did strange things to these console programs, for example
  redefining main to SDL_main.  Because I wanted to use the
  configure-generated CFLAGS to compile the programs, but I wanted to
  avoid including GUI specific compile options, I split up the configure's
  @CFLAGS@ variable into @CFLAGS@ and @GUI_CFLAGS@, and split
  @CXXFLAGS@ into @CXXFLAGS@ and @GUI_CXXFLAGS@.  All programs in the
  Bochs binary will use both, but the console programs will just use
  @CFLAGS@ or @CXXFLAGS@.
- gui/Makefile.in, I no longer use the gui specific CFLAGS variables,
  SDL_CFLAGS and WX_CXXFLAGS.  These values are included in CFLAGS and
  CXXFLAGS now.
- modified: configure.in, configure, all Makefile.in's
2002-10-01 23:37:50 +00:00
Bryce Denney
0d8e31b672 - solve SDL specific build problem: in win32, SDL redefines main to SDL_main.
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.
2002-10-01 23:34:52 +00:00
Kevin Lawton
a11e637ec0 Added an alternative set of pc_system.{cc,h} files for
testing.  Please try these out if you want to help test
  them or if your guest OS appears to be hanging with
  no apparent activity.  The old bochs internal timer
  framework is broken in several areas.

  I put these in the patches directory for now.  After
  a 'make all-clean', you can do something like:

    mv pc_system.cc pc_system.cc-old
    mv pc_system.h  pc_system.h-old
    cp patches/pc_system.cc-kpl .
    cp patches/pc_system.h-kpl .
    make

  And let me know if A) they work for you and B) if they help
  the hanging problem.
2002-10-01 21:27:34 +00:00
Bryce Denney
85ca569ef4 - fix a very stupid memory leak that I added to the the text mode debugger
recently.  oops.
2002-10-01 13:40:05 +00:00
Peter Tattam
562d6b55dd fixed a formatting problem for debug output for external debugger. 2002-10-01 07:13:00 +00:00
Peter Tattam
9078c5fc06 fixed extdb.cc to work in default IA32 bochs 2002-10-01 06:47:06 +00:00
Peter Tattam
94b2dd2bc8 Cleanup of extdb.* files. included in right places now. 2002-10-01 04:13:12 +00:00
Bryce Denney
3fa708ea7a - fix all printfs so that they can handle 64bit integers
- use "long" for the second arg to fseek.
2002-09-30 22:33:52 +00:00
Bryce Denney
ef77eb0ad3 - only register the parameters the first time init is called, to fix bug
[ 613975 ] wxWindows: params redefined on restart
2002-09-30 22:23:57 +00:00
Bryce Denney
be4005269b - many parameters in cpu were being redefined if you stop simulation and
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
2002-09-30 22:18:53 +00:00
Bryce Denney
3f9e3ee12d - comment out a few very frequent debug messages
- in CopyParamToGui and CopyGuiToParam, ignore list parameters instead of
  printing a warning
2002-09-30 22:15:20 +00:00
Bryce Denney
e093bec99c - Stu's test for ADD_FLAGS was not working quite right, because the []'s
were being removed by autoconf.  I changed it to use
     if test CONDITION; then ... fi
  instead of
     if [ CONDITION ]; then ... fi
2002-09-30 20:31:14 +00:00
Kevin Lawton
298c1d4ac5 Documented a number of the functions/variables in pc_system.h and
rearranged things to put all the timer related stuff together
  for sanity.
2002-09-30 17:32:34 +00:00
Kevin Lawton
1e5343b421 As a 1st effort to understand/debug the timer code, I cleanup
up pc_system.h.  Moved all variables under the private: section,
  as well as a few member functions.  The string instructions
  were accessing a field directly (only reads), so I indirected
  that via an inline member function for better abstraction.
2002-09-30 16:43:59 +00:00
Bryce Denney
63a7680b4c - add AC_SYS_LARGEFILE test
- also add note about the special largefiles test that wxwindows does
2002-09-30 16:24:25 +00:00
Bryce Denney
e658f463ab - remove pthread check for wxwindows. This used to be needed to add the
"-pthread" flag to the link line, but as of wxWindows 2.3.3 their
  wx-config script adds it for us.  Given the keyboard mapping improvements
  in wx 2.3.3, I don't expect to support any previous version.
2002-09-30 14:35:34 +00:00
Bryce Denney
d92ccf70ae - apply patch from Stu Grossman <grossman@juniper.net> that changes
harddrv code to use off_t for file offsets.  If off_t is going to
  require a configure test, I'll add it later.
2002-09-30 14:19:46 +00:00
Bryce Denney
1387109e7b From: Stu Grossman <grossman@juniper.net>
To: bochs-developers@lists.sourceforge.net
Subject: [Bochs-developers] Fix for configure.in bug

This patches fixes a bug in configure.in which prevents configure from setting
default values for CFLAGS and CXXFLAGS.  Normally, the way autoconf builds
configure, it will set default values for CFLAGS and CXXFLAGS of `-g -O2'.
But, if the user specified them (via the environment), it won't touch them.

The clause in configure.in that tries to set platform-specific flags breaks
this because it always assigns a value (usually blank for most platforms),
which fools the defaulting mechanism later on.
2002-09-30 14:11:21 +00:00
Bryce Denney
fb54f552fa - removing; patch has been applied now 2002-09-30 14:04:26 +00:00
Bryce Denney
ea20513e19 - convert to unix newlines so that patch is happy 2002-09-30 14:03:53 +00:00
Bryce Denney
169332660a - apply patch.carbon-jusansai from Chris Thomas. This is associated with
patch [ 549248 ] Fix Carbon key & menu handling at
  http://sourceforge.net/tracker/index.php?func=detail&group_id=12580&atid=312580&aid=549248
2002-09-30 14:03:20 +00:00
Bryce Denney
ea0874aa4a - add Carbon patch from Chris Thomas (jusansai) 2002-09-30 13:56:51 +00:00
Kevin Lawton
af31c4583b More merging of modRM==11b if () clauses in logical*.cc functions,
and code cleanup.
2002-09-30 03:37:42 +00:00
Kevin Lawton
00c14e4efe Added ./configure option --enable-all-optimizations which turns on
all available optimizations in one shot.

Finished one last case of an instruction which could but didn't use
  the Read-Modify-Write variants of access.cc functions.

Started going through the integer instructions, merging obvious cases
  where there are two "if (modrm==11b) {" clauses and very little
  action in between, and cleaning up the aweful indentation leftover
  from many years ago when those instructions were implemented using
  cut-and-paste.  We may get a little extra performance out of these
  mods, but they'll also be easier after I'm finished to enhance
  with asm() statements to knock out the lazy flags processing on x86.
2002-09-30 02:02:06 +00:00
Kevin Lawton
67721c48f4 The convience functions protected_mode(), v8086_mode() and real_mode()
now simply return a cached value which is set upon mode changes.
  The biggest problem was protected_mode() which did something like:

    return CR0.PM && ! EFLAGS.VM

  This adds up when it was being executed many times in branch functions
  etc.  Now, cached values are set and sampled instead.
2002-09-29 22:38:18 +00:00
Kevin Lawton
a5537449cd Split out reg-reg and reg-memory cases for a few other high-profile
instructions, mainly variants of MOV.  Had to update fetchdecode64
  to keep it inline with the 32-bit mods.
2002-09-29 19:21:38 +00:00
Stanislav Shwartsman
60505911c3 The patch was already committed to main trunk 2002-09-29 18:43:22 +00:00
Stanislav Shwartsman
b8f1d5c031 Fixed the bug caused failures of instrumentation on SMP configuration ... 2002-09-29 16:59:28 +00:00
Stanislav Shwartsman
4593431f49 Committed another instrumentation example for C++ lovers ;) 2002-09-29 16:50:29 +00:00
Volker Ruppert
9fb6561b66 - added descriptions of the new ATA disk options based on the comments in the
bochsrc sample
2002-09-29 16:41:41 +00:00
Kevin Lawton
f99f17bca4 Integrated CPUID CMPXCHG8B bit setting patch from John_Bäckstrand.
Moved it slightly, but it is correct.
2002-09-29 16:23:03 +00:00
Stanislav Shwartsman
bee72cf17b changed old bxInstruction name to new one 2002-09-29 16:10:27 +00:00
Stanislav Shwartsman
5bcef53393 Fixed instrumentation example 2002-09-29 16:05:13 +00:00
Kevin Lawton
895693b3b5 Fixed fetchdecode64() to work with the few MOV instructions which
were split into mod=11b, and mod!=11b cases for performance.
2002-09-29 15:07:11 +00:00
Stanislav Shwartsman
abb1530faf Fixed number of problems with instrumentation merge cause to instrumentation fail the compilation 2002-09-29 15:06:58 +00:00
Stanislav Shwartsman
8d99157993 Another additional for instrumentation 2002-09-29 14:16:30 +00:00
Stanislav Shwartsman
0ea0d828df removed the example because it already integrated to the main trunk 2002-09-28 17:11:30 +00:00
Stanislav Shwartsman
f24624f27a Replaced instrumentation example0 files with new example, for new implementation of the instrumentation 2002-09-28 17:09:04 +00:00
Volker Ruppert
4158c1e862 - serial port detection for two ports added to the POST code
- parallel port detection fixed:
  * write the value of AX to 0x0410, not BX
  * the timeout value is a byte and now stored in CL
  * the offset of the port address list is 2 bytes
2002-09-28 15:03:32 +00:00
Volker Ruppert
06bbbba109 - register description "master disable" renamed to "master clear". This is the
register name in the Intel docs
2002-09-28 13:36:32 +00:00
Volker Ruppert
b98975c832 - parallel port detection for two ports added to the POST code 2002-09-28 12:27:56 +00:00
Stanislav Shwartsman
d495bd75a6 fter integration of SplitMod11b changes Bochs failed to compile in SMP mode.
I fixed the compilation errors in CVS, smbd please check if the fix is property;
2002-09-28 09:38:58 +00:00
Peter Tattam
3ed1d61cd4 Initial work on updating bochs disassembler
Used patch.disasm to do

1) clean up the disasm output to make the dispaly of extra stuff optional.
2) included the part of the patch which displays displacements as
   proper addresses.
2002-09-28 06:29:55 +00:00
Kevin Lawton
08a89fe7b6 Performance mod: I implemented a suggestion from Peter Tattam
and Jas Sandys-Lumsdaine to split out common instructions into
  variants which deal with the mod=11b case (Reg-Reg) and the
  other cases (which do memory ops).  Actually, I only split
  MOV_GwEw and MOV_GdEd for now.  According to some instrumentation
  of a Win95 boot, they were the most frequently used opcode by far.
2002-09-28 05:38:11 +00:00
Bryce Denney
935b0f97bd - a few minor fixes to make it compile 2002-09-28 04:54:17 +00:00
Kevin Lawton
ad3c1474e3 Integrated this patch verbatim. Deleted from patches/. 2002-09-28 01:51:21 +00:00
Kevin Lawton
6843c3dfe8 Integrated patches/patch.logicalxx_asm from Jas Sandys-Lumsdaine.
Essentially, when I coded a few of the instructions to use
  asm()s for acceleration of the eflags, I got lazy and only
  used the asm() to compute eflags and let the normal C operation
  do the actual operation.  Jas's patch, moved the asm()s such
  that they now do the work of the operation as well.

  The patches look great.  The code reads a lot better as well.

  Further work can be done to give the compiler more options with
  register scheduling.
2002-09-28 01:48:18 +00:00
Kevin Lawton
11139670ad Added patch/patch.logicalxx_asm from Jas Sandys-Lumsdaine.
I'm going to look at this next and integrate it if it's good,
  but wanted a record of the patch in CVS.
2002-09-28 01:22:39 +00:00
Kevin Lawton
c49309de14 Committed [english] patches from Jas Sandys-Lumsdaine. These
were simply replacements of the eflags mask constants with
  the macro names already in cpu.h for asm() statements.  I forgot
  to use the macros for some instructions.
  0x000008d5 -> EFlagsOSZAPCMask
  0x000008d4 -> EFlagsOSZAPMask
2002-09-28 01:16:09 +00:00
Kevin Lawton
8755e5b391 This patch was just itegrated. Removed it. 2002-09-28 00:55:12 +00:00
Kevin Lawton
13a1e55f20 Committed patches/patch-bochs-instrumentation from Stanislav.
Some things changed in the ctrl_xfer*.cc, fetchdecode*.cc,
and cpu.cc since the original patches, so I did some patch
integration by hand.  Check the placement of the
macros BX_INSTR_FETCH_DECODE_COMPLETED() and BX_INSTR_OPCODE()
in cpu.cc to make sure I go them right.  Also, I changed the
parameters to BX_INSTR_OPCODE() to update them to the new code.
I put some comments before each of these to help determine if
the placement is right.

These macros are only compiled in if you are gathering instrumentation
data from bochs, so they shouldn't effect others.
2002-09-28 00:54:05 +00:00
Bryce Denney
a2d70c9953 - separate Zwane's patch and my patch so they can be more easily compared.
Now patch.tsc-zwane is back to exactly what Zwane sent to me, and
  patch.tsc-bryce has my modified version.
2002-09-27 23:17:04 +00:00
Bryce Denney
2a0f6ccedb - add wxwindows CFLAGS and CXXFLAGS to the flags for all compiles, not
just the wxwindows ones.  This is required on cygwin, for example, because
  the CFLAGS and CXXFLAGS include gcc flags that change code generation:
  -fno-pcc-struct-return and -fvtable-thunks.  It is not safe to mix code
  compiled with these flags with code compiled without.  I learned this the
  hard way when I found that sometimes code that called a virtual member
  function was jumping to the WRONG member function.
2002-09-27 20:06:57 +00:00
Bryce Denney
84080d26f1 - disable debug specific wxwindows calls, when wxwindows library is not
compiled with debug support
2002-09-27 19:12:56 +00:00
Stanislav Shwartsman
e6adebfe2d Added MMX opcodes to x86-64 mode
Fixed problem with fetching extra byte in ESCx opcodes if FPU is disabled
2002-09-27 09:56:40 +00:00
Kevin Lawton
47f2e7c404 Got rid of the KPL64Hacks macro. The fixes below eliminated it.
Created 64-bit versions of some branch instructions and
  changed fetchdecode64.cc to use them instead.  This keeps the
  #ifdef pollution down for 32-bit code and made fixing them
  easier.  They needed to clear the upper bits of RIP for
  16-bit operand sizes.  They also should not have had a protection
  limit check in them, especially since that field is still
  32-bit in cpu.h, so there's no way to set nominal 64-bit values.
  The 32-bit versions were also not honoring the upper 32-bits
  of RIP.

  LOOPNE64_Jb
  LOOPE64_Jb
  LOOP64_Jb
  JCXZ64_Jb

Changed all occurances of JCC_Jw/JCC_Jd in fetchdecode64.cc to
  use JCC_Jq, which was coded already.  Both JMP_Jq and JCC_Jq are
  now fixed w.r.t. 16-bit opsizes and upper RIP bit clearing.
2002-09-27 07:01:02 +00:00
Peter Tattam
5bfd2c669e SYSRET patch. need to do invalidate_prefetch() for correctness 2002-09-27 03:33:13 +00:00
Bryce Denney
4098cf607e - I screwed up the previous rev by somehow removing a line "typedef struct {".
You can imagine how well it worked without that.
2002-09-27 03:18:44 +00:00
Kevin Lawton
109111202c Modified my fix to JMP_Jq to clear all the upper bits,
63..16 when a 16-bit operand size JMP is executed.  Previous
  fix cleared only 63..32.  I since realized, this is the case
  which does parallel the 32-bit semantics.
2002-09-26 22:34:06 +00:00
Kevin Lawton
6d74a334d6 64-bit bug#1: Instructions such as MOV_ALOq were always
fetching 64-bit address opcode info, which was incorrect.

  Fixed.  Got rid of BxImmediate_Oq.  fetchdecode64.cc now
  uses BxImmediateO, like the fetch routine does.  Addresses which
  are embedded in the opcode, have a size which depends on
  the current addressing size.  For long-mode, this is
  either 64 (default) or 32 (AddrSize over-ride).  BxImmediate_O
  now conditionally fetches based on AddrSize.

64-bit bug#2: In JMP_Jq(), when the current operand size is
  16-bits, the upper dword of RIP was not being cleared.  The
  semantics with this case are weird - one would think the
  top 48 bits would be cleared, but apparently only the top
  32 bits are.  Anyways, I fixed this.

Replaced some of the messy immediate fetching (byte-by-byte) in
  fetchdecode64.cc with ReadHost{Q,D}WordFromLittleEndian() calls
  for cleanliness.  Should do this for all the cases, plus
  the 32-bit stuff.
2002-09-26 21:32:26 +00:00
Bryce Denney
79cd346575 - fix previous rev. It would probably help to put the #include before
the first time that this function is used!
2002-09-26 19:34:44 +00:00
Bryce Denney
5c6d434929 - the raw keycodes code for wxMSW refers to HIWORD, so I made it
conditionally include <windows.h>.  This may seem like a drastic step
  for just one little type, but I expect before long we may want to use
  other symbols like VK_F12 which are also in windows.h.  In a cygwin
  compile this is required.
2002-09-26 19:24:53 +00:00
Stanislav Shwartsman
f987ad036e Changed BxError to UndefinedOpcode function for UD2 opcode (oF 0B) 2002-09-26 18:58:50 +00:00
Bryce Denney
ce8030585f - if cross configuring, don't insist on finding pthreads for the rfb and
wxWindows guis.
- if cross configuring, don't insist on finding curses library.
- on normal configures, when the target platform is win32 (windows, cygwin,
  mingw), don't insist on finding pthread either.

(I'm starting to wonder if when cross_configure=1 we shouldn't just skip over
ALL of the library and header checks.  When you're going to configure on one
platform and build on another, all that information is useless anyway.)
2002-09-26 18:23:34 +00:00
Mike Lerwill
e0275c644f Silence compiler warnings on VC6.0 2002-09-26 09:00:52 +00:00
Bryce Denney
a50f374a28 - fix typo: "event-type" to "event->type" 2002-09-26 03:01:13 +00:00
Bryce Denney
bbc43ba25b - avoid segfaults by checking if the term gui has already been initialized
or not, before calling curses functions.
2002-09-26 02:53:58 +00:00
Bryce Denney
d7251f8693 - move comment on bx_gui_c::specific_init down so that it's next to the
method it describes
2002-09-26 02:46:39 +00:00
Bryce Denney
73681b3a53 - for term compile, search for a function called "color_set" and compile it
away if color_set doesn't exist on that platform.  On Solaris this was
  the only thing keeping term from compiling.  See this bug
  [ 613393 ] solaris: term compile missing color_set
  http://sourceforge.net/tracker/index.php?func=detail&aid=613393&group_id=12580&atid=112580
2002-09-26 02:36:04 +00:00
Bryce Denney
4be28bc5ed - RFB_LIBS was getting overwritten by pthread libs. arg! 2002-09-26 02:19:14 +00:00
Bryce Denney
ec096b9653 *** empty log message *** 2002-09-26 02:15:56 +00:00
Bryce Denney
2352bd4992 - oops, the substitution variable is RFB_LIBS 2002-09-26 02:15:20 +00:00
Bryce Denney
48e0e9dc7d - update so that it applies clean again 2002-09-26 02:12:00 +00:00
Bryce Denney
45acd5b67a - rfb gui needs the socket function. on solaris, you need to link with
-lsocket to get it.
2002-09-26 01:53:29 +00:00
Bryce Denney
085ebec771 - rfb gui needs the socket function. on solaris, you need to link with
-lsocket to get it.
2002-09-26 01:45:10 +00:00
Bryce Denney
87835fd841 - fix memory leaks in the text mode interface that I introduced while working
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.
2002-09-25 22:54:23 +00:00
Bryce Denney
56b58e6226 - remove "Create Image" button for cdrom from the sketch 2002-09-25 21:28:49 +00:00
Christophe Bothamy
83235c10ec - malloc'ed memory was one byte too short 2002-09-25 19:24:26 +00:00
Bryce Denney
e6e2c08809 - make parse_bochsrc return -1 if any parse errors occur.
- 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
2002-09-25 19:05:01 +00:00
Bryce Denney
2b4fb2b0ed - until init_done is set, don't dump CPU registers. It's frustrating to
get a screen full of cpu registers when you actually have a bochsrc
  parse error.
2002-09-25 18:49:35 +00:00
Bryce Denney
a4f0c5b53e - move read configuration and save configuration behavior out of wx.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
2002-09-25 18:40:15 +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
fd2566023a - add enums for the LOG_ASK choices: continue, die, etc. 2002-09-25 18:32:36 +00:00
Bryce Denney
13de366861 - now parse_line_formatted and parse_line_unformatted return a signed int
(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.
2002-09-25 18:31:38 +00:00
Bryce Denney
2ee888f3bb - create the quit_context as early as possible, in case fatal() gets called
from bx_init_main, bx_do_text_config_interface, or bx_config_interface.
  This should fix bug #614175: infinite panic loop if bochsrc buggy
2002-09-25 16:26:29 +00:00
Bryce Denney
ba6afa5e97 minor cleanups:
- 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
2002-09-25 14:52:45 +00:00
Peter Tattam
67082a5b50 Implemented SWAPGS instruction.
Note that it is unusual to decode (see SGDT instruction)
2002-09-25 14:09:08 +00:00
Bryce Denney
4570f1ba77 - add highmem patch from Zwane Mwaikambo 2002-09-25 13:29:11 +00:00
Bryce Denney
8f9bec3919 - remove unused, and incorrect MSR fields 2002-09-25 13:26:04 +00:00
Bryce Denney
b77654f907 - add APIC patch from Zwane Mwaikambo 2002-09-25 13:16:04 +00:00
Bryce Denney
610d7f00d0 - make the parser a little more informative when things go wrong. 2002-09-25 13:01:30 +00:00
Peter Tattam
a0d90e9b39 Implemented SYSCALL and SYSRET as part of x86-64 emulation.
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.
2002-09-25 12:54:41 +00:00
Bryce Denney
6ba1fd1b06 - VC++ doesn't like declaring a var inside a for loop, and then later
declaring another.  I guess it doesn't think the var went out of
  scope at end of first loop.  Oh well, it's easy to fix.
2002-09-25 08:04:07 +00:00
Bryce Denney
3889b9339c - add missing right alt keycode XK_Alt_R to all keymaps 2002-09-25 08:00:25 +00:00
Bryce Denney
a66f903731 - add a few more missing keys: left&right windows keys, pause
- clean up remainder of the old scancode-fixing hack
- change the BX_INFO on each keypress to a BX_DEBUG
2002-09-25 07:24:41 +00:00
Bryce Denney
ae1ac3e266 - add cases in switch statement for keys: Right CTRL, Right ALT, Scroll Lock,
Print Screen, Pause.
2002-09-25 07:21:38 +00:00
Peter Tattam
0de63e8492 Fix to stop external debugger trapping for all exceptions. 2002-09-25 06:36:42 +00:00
Bryce Denney
2107fb3af9 - in the keycode conversion switch statement, rename bx_key to key_event so
that it is as close as possible to the x.cc version.  I've made some
  improvements in x.cc and I want to apply them to wxWindows as well.
2002-09-25 05:35:36 +00:00
Bryce Denney
b99b6a157e - change the way x86-64 default options work to hopefully make them
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
2002-09-25 04:24:46 +00:00
Bryce Denney
6ccc57320f - add sanity checks for x86-64 compiles to ensure that the required
features are enabled.  Currently checks for cpu level > 5, support
  for PAE, PGE, and PSE.
2002-09-25 03:58:40 +00:00
Bryce Denney
e3539d7a4a - from Peter Tattam: add missing instruction MOVNTI to decode table 2002-09-25 03:32:12 +00:00
Bryce Denney
62066dbd4a - I modified Zwane's patch. see my comments inside 2002-09-25 03:17:32 +00:00
Bryce Denney
8e103b3ffb - fix compile warning about checking that an unsigned int was >= 0 2002-09-25 01:50:14 +00:00
Bryce Denney
70a7056b23 - add tsc patch from Zwane Mwaikambo 2002-09-25 00:00:11 +00:00
Bryce Denney
85b6fa7c8d - add 2 paragraphs about who the paste buffer is allocated and freed
- 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
2002-09-24 23:52:54 +00:00
Christophe Bothamy
5b0df32692 - fixed read_toc if start_track is 0 (whole cd).
It missed the first track. Now it returns one track plus leadout.
2002-09-24 23:45:43 +00:00
Christophe Bothamy
cf7e8f2a7c - fixed the pasting code. The bytes array passed as an argument was never freed. 2002-09-24 23:09:52 +00:00
Christophe Bothamy
900d61f6f7 - fixed mismatched malloc/delete 2002-09-24 22:50:51 +00:00
Christophe Bothamy
0dbed48de1 - changed irq for ata2 and ata3, as ps2 mouse needs irq12 2002-09-24 22:49:52 +00:00
Christophe Bothamy
f36fb4fb58 - merged rombios-new-ata.c in rombios.c
- compiled BIOS-bochs-latest from latest rombios.c
2002-09-24 21:56:31 +00:00
Christophe Bothamy
2ef503ae20 - merged rombios-new-ata.c in rombios.c. New features :
. 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
2002-09-24 21:52:32 +00:00
Bryce Denney
4588c9b531 - when I added the realtime PIT option, I accidently enabled it by default.
It should be disabled by default.
2002-09-24 21:47:27 +00:00
Christophe Bothamy
4d179c4fa9 - merged rombios-new-ata.c in rombios.c. This one is not needed any more 2002-09-24 21:44:26 +00:00
Bryce Denney
d3802b9013 - add configure variable $cross_configure, which gets set if you are
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
2002-09-24 21:35:04 +00:00
Bryce Denney
d21ffad632 - fix call to accessor getB_VM() 2002-09-24 20:41:22 +00:00
Kevin Lawton
62084dd83d Shortened this patch file down to just the important notes. I integrated
the patches, but didn't want to lose the text until they're put into
a doc somewhere.
2002-09-24 20:13:38 +00:00
Kevin Lawton
c3a74d4da0 Integrated patches/patch.promise-dc2300-vlbide from Christophe Bothamy.
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.
2002-09-24 20:02:00 +00:00
Kevin Lawton
3c09fdb363 I updated code that was using !!get_CF() (or other arithmetic flag) to
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().
2002-09-24 18:33:38 +00:00
Bryce Denney
472202226d - add configure option for Greg's realtime pit.
- chose a creative name.... how about --enable-realtime-pit
2002-09-24 18:00:23 +00:00
Bryce Denney
c111260872 - default initializer (=NULL) does not belong on the function definition, only
the declaration in the class.
2002-09-24 17:57:48 +00:00
Bryce Denney
21f5d1f7e8 - remove deprecated -mpentium (which I saw from an unrelated bug report from
Hartmut Birr)
2002-09-24 17:56:09 +00:00
Kevin Lawton
aeca26fc04 Declaration of loadSRegLMNominal() is now only defined for 64-bit. 2002-09-24 16:39:33 +00:00
Kevin Lawton
26ebda0775 Got rid of INIT_64_DESCRIPTOR in all places. Added/replaced it with
loadSRegLMNominal() which should be used to load a segment register
  in long-mode with nominal values which are compatible with existing
  checks and expectations for descriptor cache values.

Fixed 64-bit iret to not do a descriptor fetch if SS selector is null.
  Also load SS with loadSRegLMNorminal() in the same case.
2002-09-24 16:35:44 +00:00
Kevin Lawton
6e7e4c2431 Fixed ctrl_xfer_pro.cc for 64-bit iret. Check for null selector
was not correct (used == 0, rather than s&0xffc == 0).  Also,
  with a null SS selector, it was fetching the descriptor anyways.
  Put more code inside the if (selector != NULL) clause.
  For a temporary measure I added the local INIT_64_DESCRIPTOR
  from segment_ctrl_pro.cc, and used it in the case that the
  SS selector is null.  We need to make a real function which
  sets a descriptor in long-mode to nominal values.  I'm going
  to do that next... I can't stand seeing the current hacks.  :^)
2002-09-24 15:41:03 +00:00
Bryce Denney
05084fd759 - I made the first line of each ata section look a little more like a
section title, and less like the grammar that you're supposed to use.
  Someone on irc was confused because it was written in uppercase, but then
  bochs did not accept the uppercase ATA0-MASTER parameter.
2002-09-24 14:46:58 +00:00
Bryce Denney
2684886624 - fix my merging error from previous rev. Instead of putting the 32bit code
inside the else clause of an if statement, I added a return in the 64bit
  code so that it would not continue.
2002-09-24 14:00:10 +00:00
Bryce Denney
6e473648bd - remove extra #endifs that came from merging Peter's and Kevin's code 2002-09-24 13:57:37 +00:00
Christophe Bothamy
dab39a8031 - this patch enables Promise DC2300 VLB-IDE support 2002-09-24 12:55:13 +00:00
Christophe Bothamy
33a7581f57 - added "floppy" and "disk" as available directive to the boot: option
- legacy "c" and "a" are still supported
2002-09-24 09:50:16 +00:00
Bryce Denney
7ba1d2d96f - replace SDL key handling, which used hardware-dependent scancodes, with
hardware-independent SDL keysyms.
2002-09-24 08:50:51 +00:00
Bryce Denney
de0e58c2c5 These changes are from Peter Tattam
- fix load_ss, remove load_ss_null
- change the "#if KPL64Hacks" around msr stuff into "#if BX_IGNORE_BAD_MSR"
- remove "#if KPL64Hacks" from BX_CPU_C::can_push
- segment_ctrl_pro.cc: bug fix to ss == null handling in 64 bit mode

Modified: cpu/cpu.h cpu/ctrl_xfer_pro.cc cpu/exception.cc
cpu/proc_ctrl.cc cpu/segment_ctrl_pro.cc cpu/stack_pro.cc
2002-09-24 08:29:06 +00:00
Bryce Denney
3b011766fa - add --enable-ignore-bad-msr, which causes Bochs to NOT do a panic
or gpf when an unrecognized MSR is accessed.
2002-09-24 08:15:27 +00:00
Kevin Lawton
82fd79c546 Fixed/updated/cleaned repeat IO & memcpy speedups for Long mode.
Fixed/updated/cleaned guest2host TLB speedups for Long mode.

I now can boot the Linux x86-64 kernel to the VFS mount message,
using all the accelerations.
2002-09-24 04:43:59 +00:00
Kevin Lawton
281e62d8b1 I integrated my hacks to get Linux/x86-64 booting. To keep
these from interfering from a normal compile here's what I did.
In config.h.in (which will generate config.h after a configure),
I added a #define called KPL64Hacks:

  #define KPL64Hacks

*After* running configure, you must set this by hand.  It will
default to off, so you won't get my hacks in a normal compile.
This will go away soon.  There is also a macro just after that
called BailBigRSP().  You don't need to enabled that, but you
can.  In many of the instructions which seemed like they could
be hit by the fetchdecode64() process, but which also touched
EIP/ESP, I inserted a macro.  Usually this macro expands to nothing.
If you like, you can enabled it, and it will panic if it finds
the upper bits of RIP/RSP set.   This helped me find bugs.

Also, I cleaned up the emulation in ctrl_xfer{8,16,32}.cc.
There were some really old legacy code snippets which directly
accessed operands on the stack with access_linear.  Lots of
ugly code instead of just pop_32() etc.  Cleaning those up,
minimized the number of instructions which directly manipulate
the stack pointer, which should help in refining 64-bit support.
2002-09-24 00:44:56 +00:00
Bryce Denney
caa82a19a0 - print CR* registers on exit
[ 501694 ] cr2 value shown when bochs panics
  http://sourceforge.net/tracker/index.php?func=detail&aid=501694&group_id=12580&atid=362580
2002-09-23 22:10:00 +00:00
Bryce Denney
be2b9cc656 *** empty log message *** 2002-09-23 21:41:59 +00:00
Bryce Denney
6a0e1e94be - add configure test for usable wxWindows version 2002-09-23 21:41:35 +00:00
Christophe Bothamy
8ce766fc17 - fixed problem reported by Kevin. the buffer index was incremented twice when repeat-speedups is enabled 2002-09-23 21:11:51 +00:00
Kevin Lawton
2459d81619 Removed this patch which is already in the bochs CVS source. 2002-09-23 19:31:50 +00:00
Kevin Lawton
6d51ca08f1 Removed my patches, which are already integrated into bochs. 2002-09-23 19:29:15 +00:00
Bryce Denney
91402bb98a - add spoolpipe utility from Carl Sopchak
see [ 558422 ] Spool parallel output
  http://sourceforge.net/tracker/index.php?func=detail&aid=558422&group_id=12580&atid=312580
2002-09-23 19:25:06 +00:00
Kevin Lawton
d9ac09ea26 Removed this old 4Meg pages patch. We already have big page
support in bochs.
2002-09-23 19:23:03 +00:00
Bryce Denney
ff0c169407 - add patch from Luiz Henrique Shigunov, see
[ 612486 ] more disasm functions
  http://sourceforge.net/tracker/index.php?func=detail&aid=612486&group_id=12580&atid=312580
2002-09-23 19:20:58 +00:00
Bryce Denney
fb08f28c8b - add Danish keymap from Andreas Ott 2002-09-23 19:16:54 +00:00
Kevin Lawton
91fd4b3745 Added new configure option --enable-host-specific-asms, so the
user can turn on/off use of native host specific inline asm
  statements.  By default, this option is enabled, so you only
  need it to disable inline asms in your compile for now.

Currently only on x86+GCC environments, will inline asm()
  statements be used.  Eventually, other platforms could specify
  some asm()s; probably for endian issues such as byte-swapping
  and unaligned memory accesses.  On x86, there are some inline
  asm()s which do the arithmetic EFLAGS processing so that the
  lazy flags handling is somewhat bypassed.  Eventually, I'll
  add more, at least for the more common instructions.  This
  adds a little extra performance.
2002-09-23 17:59:18 +00:00
Bryce Denney
091e7ee721 - quick and dirty script to run make again in every build-* directory 2002-09-23 17:57:18 +00:00
Bryce Denney
140abecb87 - the valid arg of dbg_xlate_linear2phy is declared as Boolean but we were
giving it Bit32u pointers.  On MacOSX for some reason Boolean is set to
  unsigned char instead of unsigned int, so it actually cares that we get the
  type right.
2002-09-23 17:53:47 +00:00
Bryce Denney
8c3fb9dd1a - add methods to force update of the VGA screen and to force a call
to handle_events.  These are primarily so that when a debugger is
  single stepping, the screen updates immediately instead of after
  thousands of cycles.
2002-09-23 17:41:42 +00:00
Bryce Denney
f4e08f4497 - add to my "to do" list 2002-09-23 17:12:24 +00:00
Bryce Denney
6fafbe4b25 - add example of how to use siminterface callback function 2002-09-23 17:02:33 +00:00
Bryce Denney
93311561aa - add get_notify_callback method 2002-09-23 16:57:45 +00:00
Bryce Denney
97f3350daf - only call XCloseDisplay if display has been opened 2002-09-23 16:30:27 +00:00
Volker Ruppert
ff517c9c59 - added missing register_irq() for the PS/2 mouse (IRQ12) 2002-09-23 16:19:21 +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
8213f3916a - add option BX_OVERRIDE_ASK (request by Peter T) 2002-09-23 15:28:16 +00:00
Bryce Denney
c6133d926a - uncomment pieces of Peter Tattam's external debugger, but leave them in
an #if BX_EXTERNAL_DEBUGGER block
2002-09-23 15:26:05 +00:00
Bryce Denney
00b2607e6a - added bit definitions of CR4 in comments 2002-09-23 14:45:44 +00:00
Bryce Denney
c9b05afa6d - add "Reserved" bitfields to comments, to make it more complete 2002-09-23 14:38:14 +00:00
Bryce Denney
8b1a27fc7e - I forgot to mention that the previous rev was a patch from Peter Tattam 2002-09-23 14:33:49 +00:00
Bryce Denney
185254e367 - for x86-64, claim that we are an "AuthenticAMD" processor
- return model=2 so that Linux recognizes the processor as having an APIC.
  We don't really know what Hammer returns.
- in SetCR4, allow bits 9 and 10 to be written
2002-09-23 14:31:21 +00:00
Bryce Denney
35d9ad97b9 - from Peter Tattam: change prefetch instructions to nops instead of undefined 2002-09-23 14:25:29 +00:00
Bryce Denney
9810e6ab8d - in CMP_EqId, fix bug in sign extension 2002-09-23 14:25:08 +00:00
Bryce Denney
169efc4cc5 - change help msgs to make it clear that we can support 8 processors, not
just 1,2,4.  Thanks to Ph. Marek for pointing this out.
2002-09-23 14:09:55 +00:00
Christophe Bothamy
ed3270d12d - updated from rombios-new-ata.c rev 1.6 2002-09-23 12:49:02 +00:00
Christophe Bothamy
98c1f73690 - 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"
- changed various occurences of "mov ax, #0000" by "xor ax, ax"
- fixed serious bugs in EDD function 0x48
- included Volker's rombios recent changes to PCIBIOS
- initialization of DMA controller on POST entry
2002-09-23 12:47:24 +00:00
Bryce Denney
6aa079b234 - now with cpu level < 5 you must disable mmx 2002-09-23 07:37:07 +00:00
Bryce Denney
cd10908664 - use the GNU defines when compiling in cygwin without WIN32, for example
compiling --with-term
2002-09-23 06:57:57 +00:00
Bryce Denney
92b5efeab6 - update beos build scripts for this century 2002-09-23 06:14:01 +00:00
Bryce Denney
08ff8df002 - add special condition for compiling --with-term in cygwin 2002-09-23 05:15:06 +00:00
Bryce Denney
09e8993e41 - add
- this patch is from [ #567595 ] guess floppy type from image file length.
  from Tal Benavidor
2002-09-23 04:16:18 +00:00
Bryce Denney
a96d0da728 - distinguish between $(srcdir)/build/macosx, where the source files
are found, and build/macosx, where the files created by configure are
  found.  Now VPATH build should work.
2002-09-23 03:58:25 +00:00
Bryce Denney
b9847fe6c1 - rename MIN and MAX to BX_MIN and BX_MAX to avoid name conflicts
on MacOS X
2002-09-23 03:49:39 +00:00
Bryce Denney
14512ccced - substitute version number in build/macosx/Info.plist 2002-09-23 03:46:47 +00:00
Bryce Denney
a6a63ce96c - macosx: add reference to new icons 2002-09-23 03:45:11 +00:00
Bryce Denney
a45214a3ef - from patch [ #590426 ] additions to the MAC OS X build scripts, make
changes to Info.plist and add an icon
2002-09-23 03:43:16 +00:00
Bryce Denney
35630a672a - rename Info.plist to Info.plist.in so that I can make the configure script
substitute the correct version number
2002-09-23 03:41:22 +00:00
Gregory Alexander
249131fbed I added a support function to osdep.
The function gets the real time in useconds and puts it in
a Bit64u.  This function is defined when:
BX_HAVE_REALTIME_USEC is 1.

Right now, BX_HAVE_REALTIME_USEC is defined to be BX_HAVE_GETTIMEOFDAY
and bx_get_realtime64_usec is defined in terms of gettimeofday().

However, it could be defined in terms of any other method of obtaining
the current time accurate to the usecond.  That is why I moved the
function to osdep and added the new define.
2002-09-23 02:20:52 +00:00