Commit Graph

454 Commits

Author SHA1 Message Date
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
Volker Ruppert 8fde5ecfaf - implementation of the DMA controller reset
- new function reset_controller() resets the specified controller
- reset code removed from init()
- "master disable" uses the new reset function
2002-08-28 19:39:00 +00:00
Bryce Denney 3f9155c050 - when the device is reset via control register, it is BX_RESET_SOFTWARE 2002-08-28 16:55:16 +00:00
Bryce Denney 2594c18521 - revert previous revision to take out reset() method. The cdrom_interface
object is an interface to the host OS, not really a hardware device, so it
  probably doesn't need a reset().
2002-08-28 16:45:18 +00:00
Bryce Denney 7fdc7303c2 - add "void reset(unsigned type)" method to every I/O device.
Some devices already had one.  Some I had to add an empty one.
  I did a little cleaning of init() methods to make them more uniform
  but generally I left them alone.
- I also put these exact diffs into a patch "patch.iodev-add-reset"
  in case I want to revert these changes for some reason, for example
  if they break an old patch.  It should be deleted after a while.
2002-08-27 19:54:46 +00:00
Bryce Denney 1a7dcbfe86 - update dependencies by running gcc -MM again 2002-08-27 19:50:27 +00:00
Volker Ruppert 46140ac6ce - moved the initialization of the io read/write and irq register structures
from the constructur to the init function
- moved the cmos reset from init() to the devices reset function
2002-08-27 17:25:18 +00:00
Volker Ruppert 9985b80617 - fixed hexadecimal format of BX_DEBUG, BX_INFO and BX_PANIC messages 2002-08-27 17:24:36 +00:00
Volker Ruppert db4c7ca718 - don't try to open a serial connection when the device string is empty
- do read/write operations only when tty_id is valid
2002-08-24 19:03:43 +00:00
Volker Ruppert eda0dc5c7e - renamed serial and parallel options "Opresent" to "Oenabled" and "*_PRESENT"
to "*_ENABLED"
- bx_serial_options for all 4 ports moved into an array com[4]
- serial port com1 is enabled by default
- detection of com2, com3 and com4 config options disabled for now
- new parameter "enabled" added to the serial bochsrc options
- error handling for serial and parallel bochsrc options changed. The unhandled
  BX_PANICs are replaced by BX_ERRORs.
- new function bx_write_serial_options() added
- serial destructor restores original terminal settings only when serial port
  is enabled and the tty_id is valid
2002-08-24 17:11:33 +00:00
Volker Ruppert 56952f9132 - parport1 enable/disable support added. Now you can control the presence of
parport1 with the new option "enabled". The old option "enable" only
  controlled the output. The parport1 is enabled with no output by default.
  Changes:
  * bochrc option "enable" replaced by "enabled"
  * parport option "Oenable" replaced by "Opresent"
  * bx_parport_options par1 and par2 replaced by an array par[2]
  * initialize parport1 resources only when enabled
  * renamed variable "parport_init_list" to "par_ser_init_list" since it
    contains parport and serial options
  * documentation and bochsrc updates
- the parport variables "output" and "initmode" now belong to the bx_par_t
  structure
- TODO: add parport2 (disabled by default), parport detection in the bios
2002-08-24 10:20:35 +00:00
Volker Ruppert eb0e95f54d - check for bx_options.sb16.Opresent added in init() and the destructor
(SB16 was always enabled before)
- call finishmidifile() and finishvocfile() in the destructor only if the
  files are vaild
2002-08-23 18:12:02 +00:00
Volker Ruppert 46093f8a88 - i440fx structure is now a private member of bx_pci_c
- PCI configuration space of the host bridge renamed from array[] to pci_conf[]
- new functions load_ROM() and mem_read() for ROM access
- macros for PCI functions defined in bochs.h
2002-08-17 09:23:42 +00:00
Volker Ruppert e33b16701f - the status of the 'disk changed' line depends on the selected drive.
The digital input register is now an array (DIR[4]).
2002-08-13 12:02:37 +00:00
Christophe Bothamy 6bbd601c83 - fixed offset in vbe. See patch [ 592081 ] Bug: typo in VBE code 2002-08-12 16:16:53 +00:00
Christophe Bothamy 1a7d18743f - added subcommand 0x66 (Disable reverting to power-on default)
and 0xCC (Enable reverting to power-on default) to list of unsupported
"Set Feature" subcommands.
2002-08-09 13:16:22 +00:00
Volker Ruppert f81909361d - panic at MODE SENSE (chg) and a few audio cd functions replaced by a
BX_ERROR. The harddisk controller returns an error code until we are able to
  implement this features.
2002-08-07 08:53:01 +00:00
Christophe Bothamy 1a454f196e - fixed lockup during mouse movements during win98 install. (patch from Wilfried Weissmann in sf forum) 2002-08-06 14:11:03 +00:00
Volker Ruppert 806e32e984 - initialize the shadow ram array with the value 0xff (used by rom images)
- initialization of read only registers not necessary when PCI is disabled
2002-08-05 17:43:25 +00:00
Christophe Bothamy 87bb0f37a4 - fixed problem with multiple drq atapi data transfers 2002-08-05 15:51:06 +00:00
Christophe Bothamy 6c62d72398 - added a check on odd byte count for atapi command
- fixed problem with multiple drq atapi data transfers
2002-08-05 15:47:40 +00:00
Volker Ruppert c3cda0a919 - separation of floppy device type and media type started. This feature needs
more work in the floppy and bios code.
- floppy and cdrom entries in the runtime config menu can be disabled if the
  drive wasn't defined in bochsrc or start menu
- floppy variable "initial_status" and cdrom variable "inserted" renamed to
  "status"
- unused variable *ips in function build_runtime_options_prompt() disabled
2002-08-04 08:42:34 +00:00
Volker Ruppert 16dfd66163 - floppy read/write commands: return value of status register 1 is 0x85 when
the requested sector doesn't exist.
- BX_PANIC message for requested cylinder > tracks on media fixed
2002-08-03 06:58:56 +00:00
Volker Ruppert cb567008bd - new function reset() for bx_devices added (currently for PCI and floppy only,
we have to add more devices)
- device reset function is called on startup and after pressing the reset
  button in the headerbar
2002-08-01 12:19:01 +00:00
Volker Ruppert a6d07ad166 - added support for 360k floppy images
* new floppy type 360k can be used in .bochsrc and the config interface
  * media type and geometry can be set for the floppy type
  * BIOS changes to make 360k floppy drives work
  * bximage can create 360k images now
2002-08-01 07:37:56 +00:00
Volker Ruppert e3f378505d - the win32 version now uses the READ TOC function for files. This is a hack
and works okay with one rom track only. We still have to implement reading
  the real TOC on win32.
- in function GetCDCapacity(): type of variable 'buf[8]' must be 'unsigned char'
- in function capacity(): win32 version returned the number of bytes, but it
  should return the number of blocks (ASPI blocksize is 2352)
- description of the function capacity() fixed (it always returns blocks)
2002-07-31 05:21:46 +00:00
Volker Ruppert 2b2369a049 - panic at 'Read sub-channel with SubQ' replaced by a BX_ERROR. The harddisk
controller returns an error code until we are able to implement this feature.
- init_send_atapi_command(): don't panic if alloc_length is 0, use byte_count
  to set alloc_length instead
- fixed a BX_PANIC message in the io write handler for port 0x1f0
2002-07-30 09:54:26 +00:00
Christophe Bothamy 1956be72db - I forgot to initialize the new variable 2002-07-30 08:48:03 +00:00
Volker Ruppert 92f54faa01 - implementation of the function READ TOC for cdrom image files 2002-07-30 06:25:57 +00:00
Volker Ruppert f4fdaa7e54 - function read_toc() works with the requested start track 0xaa (lead out) too
- commented include statement removed
2002-07-29 16:42:01 +00:00
Christophe Bothamy 5e15db2dcd - added port 0x8900 to enable bochs programmatic shutdown 2002-07-29 12:44:47 +00:00
Volker Ruppert 4dbd597456 - panic at READ CD replaced by a BX_ERROR. The harddisk controller
returns an error code until we are able to implement this feature.
2002-07-27 18:42:31 +00:00
Volker Ruppert 68d3969bc4 - floppy read and write function do not set the 'seek end' bit in status
register 0
2002-07-26 16:39:18 +00:00
Volker Ruppert c9420428f1 - calculation of the screen size for some graphics modes fixed
- use the start address when calculating the byte offset for standard EGA/VGA
  modes
2002-07-24 19:36:39 +00:00
Jeroen Janssen 42bb859bff fix 800x600 tile problem as pointed out by Peter Tattam 2002-07-21 14:50:11 +00:00
Volker Ruppert e5f8fc20f5 - byte offset for modeX fixed (use value of CRT register 0x13) 2002-07-21 11:03:43 +00:00