Commit Graph

489 Commits

Author SHA1 Message Date
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
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
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
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
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
Mike Lerwill
e0275c644f Silence compiler warnings on VC6.0 2002-09-26 09:00:52 +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
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
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
Volker Ruppert
ff517c9c59 - added missing register_irq() for the PS/2 mouse (IRQ12) 2002-09-23 16:19:21 +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
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
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
Bryce Denney
27e5bd1bd6 - check in minor change in CreateFile() which fixes cdrom access in win2k.
Suggested by Gino Chen Hsiang-Jan in bug [ #470701 ] Win32 CD-ROM
  Need help testing on other windows versions.
2002-09-23 01:23:25 +00:00
Christophe Bothamy
af215531f2 - fixed compile problem with --enable-repeat-speedups 2002-09-22 23:47:34 +00:00
Christophe Bothamy
440dffc803 - applied patch.4ata-channels and patch.4ata-channels.bbd
- Features :
 . number of active channels defined at boot-time config
 . new options in bochsrc
 . up to 8 devices support (disks or cdroms)
 . up to 4 cdrom devices can be changed at runtime config
 . wxwindows config interface
2002-09-22 20:56:12 +00:00
Bryce Denney
17f873abc3 - these fixes are from Psyon
- PacketSetReadTimeout: instead of calling with a very short timeout,
  now we call it with -1 which means no timeout.
- Psyon found that Peter Tattam's changes, while necessary for win95, broke
  WinNT/2000.  So now on Windows NT/2000, we still call
  WaitForSingleObject(lpAdapter->ReadEvent,0) but we ignore the return value.
2002-09-22 14:58:49 +00:00
Jeroen Janssen
53723a8569 hopefully solved bugreport [ 612741 ] VBE mem conflicts w/ local APIC address 2002-09-22 11:31:48 +00:00
Bryce Denney
556e4d2590 - fix call to create slowdown timer object. I'm pretty sure I broke this
on August 28 when I was messing with init and reset methods.
2002-09-22 02:29:59 +00:00
Bryce Denney
e41655a78c - add configure test for BX_HAVE_GETTIMEOFDAY
- hardcode BX_HAVE_GETTIMEOFDAY=0 if cross compiling for VC++
  (this part hasn't been tested)
- modified files: configure configure.in config.h.in iodev/pit_wrap.cc
2002-09-22 01:56:18 +00:00
Volker Ruppert
d7e6649f72 - log type PCI2ISALOG added
- pci2isa prefix changed to "P2I"
- device name changed to "PIIX3 PCI-to-ISA bridge"
- added more default values to the reset() function
- added stubs for i/o mapped registers
- array pci_conf[] is now a part of the structure s
2002-09-21 11:38:12 +00:00
Volker Ruppert
7ea3cdfd76 - update dependencies after adding the pci2isa device 2002-09-21 10:24:43 +00:00
Gregory Alexander
e668567e85 Made BX_USE_REALTIME_PIT checked at runtime. This is
a precursor to making it a runtime option.  I'm not
sure how to do this, but it should be trivial.  All it
would take is adding the option and changing the
macro for BX_USE_REALTIME_PIT to point to that option.
2002-09-21 04:02:51 +00:00
Gregory Alexander
44c5829ea5 Realtime PIT with gettimeofday is working beautifully.
It's MUCH smoother than with the time(NULL) version.

We need to work on setting up the config parameters some more.
2002-09-21 03:20:59 +00:00
Gregory Alexander
1f05d9aa6b Working on Realtime PIT code.
Getting fair results with gettimeofday.
2002-09-20 23:10:55 +00:00
Bryce Denney
0d68427d37 - we kept getting /usr/include/math.h in the dependency list for keyboard.cc
and I could never explain it.  The problem was that in keyboard.cc it
  included "math.h" with quotes instead of <math.h> with less than/greater
  than, so gcc -MM didn't realize it was a system header.
2002-09-20 22:42:29 +00:00
Gregory Alexander
f5f6cc65be Working on using gettimeofday for timing instead of time(NULL). 2002-09-20 04:42:25 +00:00
Volker Ruppert
721f89b77b - forward changes of the active charmap to the gui with the new function
set_text_charbyte()
- vga: store the address of the active charmap in the new variable
  charmap_address
- vga: text mode hack removed. The write modes, operations and masks must be
  used in text mode too.
- sdl: clear_screen() is not necessary when the charmap has changed
- win32: update only the changed font bitmaps before drawing the text
2002-09-19 18:59:50 +00:00
Bryce Denney
bb507ec5b5 - increase tilesize to 16x24 as suggested by Peter Tattam 2002-09-19 01:32:38 +00:00
Volker Ruppert
19c660a30c - implementation of the PCI-to-ISA bridge started. I/O ports and features are
not present yet.
2002-09-16 19:18:58 +00:00
Bryce Denney
6a50742b20 - clean up ^M pollution from working in cygwin 2002-09-16 17:00:16 +00:00
Bryce Denney
d160c872b3 - in debugger, all output must now be printed with dbg_printf, instead
of fprintf to stderr
2002-09-15 11:20:11 +00:00
Christophe Bothamy
4c41a3f0f8 - fixed error under linux 2.0.36, when reading toc on an iso file.
Since we only return one track, the content stays the same for starttrack in (0,1)
2002-09-13 14:21:53 +00:00
Christophe Bothamy
8a9992998e - committed vga patch for yamit. I'm not really sure how the standard vga card
behaves in text mode memory mappings 0 & 1.
2002-09-13 00:11:49 +00:00
Bryce Denney
d6cd93b462 - add support for Peter Tattam's external disk simulator 2002-09-12 06:49:04 +00:00
Bryce Denney
954862cc5b - these are changes from Peter Tattam, who says "This dramatically improves
performance of the ne2K driver in win9x."
- receive timer set to 10000 instructions instead of 1000000.
- placed if (WaitForSingleObject(lpAdapter->ReadEvent,0) == WAIT_OBJECT_0) {}
  around the read code.
2002-09-12 06:44:04 +00:00
Kevin Lawton
414e97bc32 Enhanced the repeat IO accelerations (enabled by --enable-repeat-speedups)
to request bulk IO operations to IO devices which are bulk IO aware.
Currently, I modified only harddrv.cc to be aware.  I added some
fields to the bx_devices_c class for the IO instructions to
place requests and receive responses from the IO device emulation.
Devices except the hard drive, don't monitor these fields so they
respond as normal.  The hard drive now monitors these fields for
bulk requests, and if enabled, it memcpy()'s data straight from
the disk buffer to memory.  This eliminates numerous inp/outp calling
sequences per disk sector.

I used the fields in bx_devices_c so that I would not have to
disrupt most IO device modules.  Enhancements can be made to
other devices if they use high-bandwidth IO via in/out instructions.
2002-09-09 16:56:56 +00:00
Volker Ruppert
d23d121674 - new function set_text_charmap() stores the vga charmap data in the array
vga_charmap
- the SDL gui uses the charmap data for the vga text display
  * TODO: implement this feature for other guis
- removed unused variables in sdl.cc and gui.cc
- fixed a warning in vga.cc
2002-09-08 07:56:10 +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
Bryce Denney
17624e7549 - clean up memory usage after bx_gui_c::get_clipboard_text for win32,
X windows, wxWindows.  Each platform has its own way of returning
  a variable length string, and its own rules about how you're supposed
  to dispose of the string.  Now all platforms do the same thing: they
  allocate a Bit8u buffer with C++ "new" and copy the clipboard data in,
  then release the clipboard data in the platform-specific correct way.
  The Bit8u buffer is sent to the keyboard code, which frees it with
  delete [] when finished.
- modified: gui/wx.cc gui/x.cc gui/win32.cc iodev/keyboard.cc
2002-09-05 15:57:37 +00:00
Bryce Denney
1cda50d9f2 - make all packet mover classes report their log messages using the NE2K
class's prefix, NE2K.  The real issue is that the ne2k class exists at
  configuration time, so it is possible to tell it how to respond to
  panics, errors, etc.  The packet mover is created after configuration
  depending on the setting of bx_options.ne2k.Oethmod, so I cannot
  (with major hacks) affect its settings from the configuration interface.
  Several packet movers were already set up this way anyway.
2002-09-02 16:56:24 +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
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
Christophe Bothamy
a52f2467cf - first part of fix for bug [ 601166 ] CMOS Problem @ "0x0F Index 0x05 data"
Added more allowed values for index 0x0F
2002-08-31 21:31:11 +00:00
Volker Ruppert
e1d8d30e4c - meaning of the memory type values changed (0 = ROM, 1 = Shadow RAM)
- the functions mapRead() and mapWrite() are no longer necessary
2002-08-31 15:35:51 +00:00
Volker Ruppert
38666a2cfb - PCI memory handling moved to bx_mem_c
* shadow RAM array and fetch function are now a part of the memory code
  * removed unnecessary PCI macros and functions load_ROM() and mem_read()
2002-08-31 12:24:41 +00:00
Bryce Denney
630d37269b - reset should have one arg, unsigned int type 2002-08-29 16:52:47 +00:00