Commit Graph

435 Commits

Author SHA1 Message Date
Volker Ruppert
adf209fe9e Fixed some issues reported by valgrind. 2021-04-18 17:20:41 +00:00
Volker Ruppert
8e8414aae4 Some cleanup in the plugins code and related documentation additions. 2021-04-01 19:36:59 +00:00
Volker Ruppert
249fcf9442 Set the device type correctly for all media types when parsing floppy options.
- Added helper function get_floppy_devtype_from_type().
- The floppy type option now accepts the value "none".
- Added parameter handler for "devtype" to handle the BX_FDD_NONE case.
- Cleaned up floppy options parser code.
2021-03-29 11:17:03 +00:00
Volker Ruppert
b1c36691de Partly fixed floppy issues caused by previous commit. If device type is set to
"none" the dependent parameters cannot be set. That's why the bochsrc parser
needs to set device type first.
- Set initial device type of first floppy to '3.5" 1.44M'.
- Detect device type along with image type if necessary.
- TODO: fixes for media types like "1_44" and some more cleanup.
2021-03-28 08:40:28 +00:00
Volker Ruppert
3fcc320897 Added new plugin type PLUGTYPE_CI for config interfaces. Updated related code
and documentation.
2021-03-27 17:23:31 +00:00
Volker Ruppert
0c2a9c69d6 Some config option changes.
- Moved serial and parallel config parameter list creation to the corresponding
  device code.
- Unregister serial and parallel bochsrc options in PLUGIN_FINI mode.
- Moved USB config and runtime parameter list creation to bx_init_usb_options().
- textconfig.cc: Small fixes in the optional plugin control.
2021-03-07 11:54:50 +00:00
Volker Ruppert
66d9fd53b5 Two more disabled options fixes in the config interfaces. 2021-03-05 21:25:13 +00:00
Volker Ruppert
e8709d58e4 Fixes in the config interfaces handling of disabled options.
- Don't show dialog or menu if selected list is NULL or empty.
- Don't create list for lowlevel sound options if disabled in config.h.
2021-03-05 16:52:26 +00:00
Volker Ruppert
a475fee44f Fixed compilation with networking and USB support disabled. 2021-03-03 17:47:15 +00:00
Volker Ruppert
2aadd3e470 Changed type of the PCI slot option to bx_param_enum_c and build choices list
from plugin devives with PLUGFLAG_PCI set.
2021-02-27 10:23:05 +00:00
Volker Ruppert
8aaf9d858e Changed type of vga and svga_cirrus plugins to PLUGTYPE_VGA. Modified vga
extension option init to make this work correctly. The choices "none" and "vbe"
load the vga plugin, "cirrus" loads svga_cirrus.
2021-02-23 08:12:24 +00:00
Volker Ruppert
7a479ff4c9 Upgraded MSVC workspace files for VS2019 and fixed some MSVC warnings. 2021-02-21 08:08:06 +00:00
Volker Ruppert
2e44a5c8bf Changed type of VGA extension option to bx_param_enum_c. Additional choices are
added from plugins list.
2021-02-19 16:05:56 +00:00
Volker Ruppert
24bccc8efb Changed parameter handler argument "set" type to bool. 2021-02-19 13:13:42 +00:00
Volker Ruppert
368c83127e Some small changes in the USB devices configuration.
- Fixed USB devices list by adding a terminating NULL entry.
- Disable USB device options parameter if device is set to "none".
- Related documentation updates.
2021-02-15 19:55:53 +00:00
Volker Ruppert
919d82b68e Next step of USB devices handling rewrite. Changed type of the device parameter
to bx_param_enum_c. Updated code to provide support for legacy syntax
(portX="device:option").
TODO: generate USB devices list from plugins list.
2021-02-15 16:09:02 +00:00
Volker Ruppert
e00a5d0761 Started rewrite of the USB devices handling.
- Moved main option from the portX parameter to the optionsX parameter. Added
  new option "path" for the disk, cdrom and floppy devices, "ports" for the
  USB hub and "file" for the USB printer. The legacy syntax is still supported.
- Register USB device state after init() to ensure all options that may have
  effect on the save/restore list are applied.
- Report available devices on top of log file similar to hdimage, network and
  sound modules.
- Changed USB device type variable typein host controllers to int.
- Prepared improved usbdev_ctl init / exit implementation.
- TODO: Create list of USB devices dynamicly from available plugins.
2021-02-14 08:30:49 +00:00
Volker Ruppert
535856833c Display library plugins list is now created dynamicly at startup instead of the
hardcoded one. In plugins mode now all plugins with PLUGTYPE_GUI can be used.
Added similar code for the case plugins are disabled. The macros
PLUG_get_plugins_count() and PLUG_get_plugin_name() can be used in both cases.
2021-02-09 21:53:15 +00:00
Volker Ruppert
333afe3e4a Fixed some issues found with save/restore tests.
- BXRS_PARAM_BOOL macro should be used for bool type members only.
- Fixed usage of wrong BXRS macro for numeric member in usb_hid.cc.
- New PCI parameter "advopts" must be saved in config.
- FIXME: Bochs hangs at startup in restore mode.
2021-02-09 21:32:35 +00:00
Volker Ruppert
6ad19a7716 Rewrite of the sound driver handling similar to the hdimage and networking
module code. Sound driver names are now stored as string constants instead
of hardcoded values. Available modules are detected at Bochs startup and stored
in a string array before initializing options. In the plugins case available
modules are read from the plugins list. If plugins are off, the registry of
bx_sound_lowlevel_c is used. Related changes similar to the hdimage and
network modifications.
2021-02-06 16:51:55 +00:00
Volker Ruppert
1fe24e32b0 Rewrite of the networking module handling similar to the hdimage module
handling. Networking module names are now stored as string constants instead of
hardcoded values. Available modules are detected at Bochs startup and stored in
a string array before initializing options. In the plugins case available
modules are read from the plugins list. If plugins are off, the eth_locator_c
registry is used. Related changes in all parts of Bochs that need the
networking stuff.
TODO #1: Sound drivers could be handled in a similar way.
2021-02-05 20:40:43 +00:00
Volker Ruppert
22fabb599a Started bx_bool to bool type changes in the Bochs core. 2021-01-30 15:16:00 +00:00
Volker Ruppert
880ee1832a Some Bochs plugins support and VGA extension option changes.
- Changing VGA extension to "voodoo" did not work in the config interface.
  Moved plugin loading to the string parameter handler and added plugin
  unloading case.
- Unloading "voodoo" VGA plugin resets pluginVgaDevice to stubVga.
- pluginUnregisterDeviceDevmodel() now supports core plugins.
- Some other small plugin related changes.
2021-01-27 20:06:02 +00:00
Volker Ruppert
74deb16b44 Since externally developed optional device plugins (AKA "user plugins") can be
loaded in bochsrc with "plugin_ctrl" or with their own name, the user plugin
option and the special cases for PLUGTYPE_USER are no longer needed. Updated
example patch to make it work with the latest SVN code.
2021-01-24 10:16:22 +00:00
Volker Ruppert
e5c68dd4ac Rewrite of the optional plugin control feature.
- Now that we know about all available plugins at startup, the bx_list_c object
  "plugin_ctrl" contains a fixed number of bx_param_bool_c objects representing
  the requested status (1 = load). It is verified at simulation startup.
- The config interface creates two text lists (textconfig) or list boxes (win32,
  wx) from it to show the remaining available and the loaded plugins. Loading
  and unloading is performed immediately and plugins may install / uninstall
  options in other menus / dialogs.
- Modified the "non-plugin" code to make the optional plugin control work very
  similar in this mode.
2021-01-21 18:10:40 +00:00
Volker Ruppert
5ffb319df1 Rewrite of the disk image mode handling. Disk image modes are now stored as
string constants instead of hardcoded values. Available modes are detected at
Bochs startup and stored in a string array before initializing options. In the
plugins case additional modes are read from the plugins list. If plugins are
off, the hdimage_locator_c registry is used. Related changes in all parts of
Bochs that need the hdimage stuff.
TODO #1: Network and sound drivers could be handled in a similar way.
TODO #2: Make disk image mode detection work again in plugins mode.
2021-01-05 21:57:13 +00:00
Volker Ruppert
c12c8324dc Added config parameter to set up advanced PCI options as comma-separated
values. Now it is possible to disable ACPI or HPET in case the i440FX chipset
is selected.
2020-12-04 17:04:40 +00:00
Volker Ruppert
6692664a3b Added helper function bx_split_option_list() to reduce code duplication.
It creates an array of strings from a string containing a comma separated list
of options. Now using this function for display library options, USB port
options and ROM image options.
2020-12-03 20:30:10 +00:00
Volker Ruppert
90dc9f7468 Setting up options without specifying display library is now also supported. 2020-11-29 13:37:07 +00:00
Volker Ruppert
aaf8c9d4e4 Removed "svga" display library designed for the obsolete Linux SVGALib.
The latest release is from 2001 and it will not work on modern Linux systems.
Parts of the SVGALib code have been moved to the Linux kernel and the X11 and
SDL libraries are using it as a video driver.
2020-11-25 07:56:32 +00:00
Volker Ruppert
2045ead0ce Improved error handling of the user shortcut feature.
- Shortcut parser sets a flag in case of error.
- String parameter handler resets to old value if the new one is invalid.
- User button handler shows a message box if the parser signals an error.
2020-10-19 15:01:40 +00:00
Volker Ruppert
5de465b5b1 Fixed some gcc 9.3 warnings. 2020-08-06 20:21:14 +00:00
Volker Ruppert
c05cb5e1d7 Removed legacy "load32bitOShack" feature. In the early days of Bochs some hacks
were required to load a 32 bit OS. In the meantime Bochs has been made capable
of loading 32 and 64 bit OS's without hacking.
2020-06-07 17:28:54 +00:00
Volker Ruppert
ed223c6499 DDC: changed the "off" case to Bochs default name "disabled" and updated docs. 2020-03-22 12:31:34 +00:00
Volker Ruppert
e23a930864 Added "ddc" parameter to the "vga" option to make it possible either to disable
the DDC feature or to read the monitor EDID from file. By the default the
builtin "Bochs Screen" EDID is used.
2020-03-21 18:00:02 +00:00
Volker Ruppert
d51f6480a0 Some fixes for the "multiple NICs" support.
- Fixed ne2k parameter save function.
- For backward compatibility, card #0 defaults to PCI if the ne2k is assigned
  to at least one PCI slot.
- The "bootrom" parameter is only valid for the PCI card type.
2020-03-04 17:37:34 +00:00
Volker Ruppert
835a745215 Added experimental "multiple NICs" support (currently NE2000 only). Unlike the
old SF patches this solution is compatible with the plugin architecture. The
ne2k plugin is loaded only once and a new ne2k_main_c object creates up to 4
ne2k device objects depending on the config. The new ne2k parameter "card"
specifies the zero-based card number to configure. If not given, the default
is card #0 for compatibility. The new ne2k parameter "type" specifies the bus
it is connected to ("isa" or "pci"). Card #0 defaults to PCI, the others to
ISA. In the PCI slot configuration the ne2k device can be used multiple times
if more than one card is configured.
Related changes:
- removed SMF stuff for ne2k
- always convert device prefix to uppercase (ne2k uses NE2K0 ... NE2K3)
- removed unused BXPN values
- TODO: add multiple NICs support for the E1000
2020-03-02 22:04:10 +00:00
Volker Ruppert
a088949447 Save / restore fixes
- Don't set up and load pre-defined optional plugins in restore mode.
- Remove the save/restore registration in Voodoo destructors.
- TODO: Fix frozen SDL/SDL2 display after restore.
2020-01-24 16:01:00 +00:00
Stanislav Shwartsman
96e2c50bef applying SF patch #545 Speling fixes 2019-12-09 16:29:23 +00:00
Volker Ruppert
0a805faf02 Fixes related to Windows registry key for Bochs.
- Fixed typo in registry key created by installer.
- Updated registry key name used for BXSHARE environment variable generation.
2019-11-30 17:51:19 +00:00
Volker Ruppert
f206839636 Some work on the Bochs version number strings.
- Get rid of VER_STRING since it's the same as VERSION
- Add new defines VER_MAJOR, VER_MINOR, VER_PATCH and VER_SVN and use them for
  the version number on Windows.
- TODO: Add the capability to detect installed version to the Windows installer.
2019-11-14 10:34:39 +00:00
Volker Ruppert
dbc8f1aa19 Fixed some warnings caused by possibly not enough space for sprintf format. 2019-11-08 13:49:48 +00:00
Volker Ruppert
74d40805d1 Added support for unlocking disk images (locks leftover from previous Bochs
session) with the new command line argument '-unlock'.
2018-05-11 07:44:49 +00:00
Volker Ruppert
db95a54238 Prepared config interface for a hard disk sector size option.
This code is based on the initial patch by Ben Lunt with some modifications:
using enum parameter, extra parser handler and cdrom handling not necessary,
TODO: hdimage and bximage code, harddrv and USB disk emulation, BIOS.
2018-03-13 20:35:56 +00:00
Volker Ruppert
e7093e74d8 Started implementing the i440BX PCI/AGP chipset.
- Added new PCI chipset choice for the i440BX AGPset. Some basic work is done,
  but AGP support is not present yet.
- Added new class for the "virtual" PCI-to-PCI bridge that should manage the
  secondary bus (AGP). Since this device must appear with device number #1 at
  the primary bus, it was required to change the PCI device numbers for the
  i440BX case. Moved the PIIX4 module to device number #7. The presence of the
  PCI base address regions now depends on the header type as expected.
- Since the Bochs BIOS cannot handle the modified PCI device layout, all tests
  continued with an external BIOS designed for this chipset (GA-6BA_F1.bin).
  This BIOS requires additional changes in some devices.
- ACPI: Return value 0 for some status registers and the GPI registers.
- CMOS: Since the PIIX4 supports a 256 byte CMOS RAM, prepared support for it
  and enable it in case a 256 byte CMOS image is used.
- PCI: The device numbers for 4 slots starting at #8. The 5th slot could be
  used for AGP when available.
2018-02-24 18:04:36 +00:00
Volker Ruppert
967f7d3381 Added method parse_param() to bx_param_bytestring_c and use it to reduce code
duplication (TODO: similar changes in win32paramdlg.cc).
2018-02-04 22:20:46 +00:00
Volker Ruppert
c4a86cbee0 Some fixes in the bochsrc save and parse functions.
- Fixed saving new parameter type BXT_PARAM_BYTESTRING (MAC address).
- Fixed some special parser functions by using new parse_param() method.
2018-02-02 19:04:59 +00:00
Stanislav Shwartsman
7310d9edae write byte arrays from param_data in save/restore in JSON style format (using [] instead of {}). fixes in save/restore. 2018-01-26 20:02:28 +00:00
Stanislav Shwartsman
e8d0e718f1 continue param tree changes
take RAW_BYTES string out of bx_param_string_c into new param type bx_param_bytestring_c (better name, anybody?)
this is intermediate step, later it would be better to merge bx_param_string into generic template bx_param<type>
but bx_param_bytestring_cis not matching that concept (or probably will continue to inherit from bx_param<string>)
2018-01-19 20:27:04 +00:00
Stanislav Shwartsman
5f2bf81995 add new dump_param method to param object which dumps param into a string
use new method do dump param tree during save/restore, GUI and text debugger and other places
significantly reduce code duplication over multiple modules
2018-01-10 20:05:59 +00:00