Commit Graph

2662 Commits

Author SHA1 Message Date
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