Commit Graph

98 Commits

Author SHA1 Message Date
Volker Ruppert
d8b25c5f26 Some more cleanup in the plugins code. 2021-04-03 18:26:03 +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
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
27c120154b Fixed a GCC warning and some MSVC warnings. 2021-02-27 20:53:10 +00:00
Volker Ruppert
3209b04d82 Fixed compilation with plugins enabled on Windows. 2021-02-27 13:15:37 +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
4dd5816108 Some changes in the Bochs plugins code.
- Changed variable type of the plugin_t "type" member from enum to Bit16u.
- Added support for returning device flags with the new mode PLUGIN_FLAGS in
  the plugin entry functions. It is currently only used for devices that can
  be connected to a PCI slot.
- Code cleanup in core device plugins: checking type no longer necessary.
- The "non-plugin" mode now also uses the "loadtype" member of plugin_t.

TODO: Change PCI slot options to bx_param_enum_c and build the choices list
using the new capabilities of the plugin API.
2021-02-26 20:37:49 +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
d4171cbf31 Renamed usb_cbi plugin to usb_floppy (including changes of source file names
and internal names).
2021-02-18 15:03:05 +00:00
Volker Ruppert
07f32da5a7 Some plugin related fixes.
- Fixed loading of all plugins with one type using wildcard.
- Reduced maximum length of line when listing available modules for hdimage,
  network and sound.
2021-02-14 06:25:01 +00:00
Volker Ruppert
744efe9c22 The hdimage, networking and sound code now also use PLUG_get_plugins_counrt()
and PLUG_get_plugin_name() in case plugin support is disabled. Removed
temporary compatibility code from the self-registering stuff.
2021-02-10 07:29:14 +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
0d425037df Improved plugin type detection at Bochs startup.
- Added special mode to all plugin entry functions that returns the plugin type.
- The plugins search function now temporarily loads all available plugins and
  reads the plugin type using the new mode PLUGIN_PROBE.
- Added "loadtype" to the plugin structure to store the type used for plugin
  loading (currently only the voodoo plugin provides two types).
2021-02-07 16:16:06 +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
3f760e2900 Some work on the Bochs plugins support.
- Improved macro definitions for plugin entry points.
- Forward declarations of plugin entry points are only required when plugin
  support is off.
- Improved panic message for the case when plugin entry point is not found.
2021-01-24 19:47:04 +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
8db0a2b001 Replaced the plugin init / fini functions with one single function called
plugin_entry(). The additional boolean argument "init" is used to select the
requested action. The entry points still have unique names for compatibility
with the "non-plugin" compilation. Added macros for setting up these names
(e.g. PLUGIN_ENTRY_FOR_MODULE for device plugins).
2021-01-23 12:06:11 +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
9e95491fb5 Some work on the Bochs plugin API.
- bx_load_plugin() now returns the status of the operation.
- Plugin load failures are now correctly handled by the plugin code (unloading
  if necessary, then panic).
2021-01-18 19:57:11 +00:00
Volker Ruppert
afcda20b83 Some work on the hdimage mode detection code.
- In plugin mode make sure all hdimage plugins are loaded for mode detection.
- Implemented image mode detection via hdimage_locator_c.
- TODO: use the new code for bximage, too.
2021-01-08 21:17:47 +00:00
Volker Ruppert
127fd003cc Some more work on the Bochs plugins support.
- Added support for loading all plugins of one type using wildcard "*".
- Unloading no longer removes the plugin object. Now the member "loaded" is
  set to 0 and the type of a device plugin is reset.
- Added plugin_cleanup() function to remove plugin objects on Bochs exit.
- Some other related cleanups in the plugins code.
2021-01-08 19:04:41 +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
d48ca7e2a4 Fixed compilation with plugin support disabled. 2021-01-02 21:05:56 +00:00
Volker Ruppert
4f311f0618 Some work on the Bochs plugins support.
- Added suffix "_gui" to the base name of display library plugins.
- Added new function plugins_search() that browses the plugin folder(s) and
  detects the type from the library name. Plugins with no prefix or suffix are
  treated as i/o device plugins. The plugin_load() function uses this database.
- Some related fixes and cleanups.
2021-01-02 20:49:39 +00:00
Volker Ruppert
c99bd49f34 Some work on the hdimage plugin support.
- Renamed vpc-img.* files to vpc.* and removed hack for image mode name conversion.
- Added suffix "_img" to all disk image mode plugin base names. This is important
  for the future implementation of a plugin enumeration at Bochs startup.
2020-12-30 17:56:27 +00:00
Volker Ruppert
b880fb2975 Rewrite of the hdimage plugin code.
- Common hdimage code, lowlevel cdrom code and the classes for the Bochs "own"
  image modes (e.g. flat, sparse, growing") are now a part of the Bochs core.
- All classes for image modes present in separate files are now built as
  plugins with the same self register mechanism as network, sound and usb
  modules. Defined new plugin type PLUGTYPE_HDIMAGE.
- Temporarily disabled the base image format detection of the undoable/volatile
  modes for the "external" modes in the plugins case.
- TODO: Bochs should know about all of the available plugins and their
  capabilities right after startup, but before the configuration stage.
2020-12-27 17:26:33 +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
d25e85c21a Preparing improved VGA extension support and some VGA / Cirrus cleanups.
- Treat VGA extension name other than "none", "vbe" or "cirrus" as a VGA
  compatible device plugin and try to load it.
- Added new plugin type PLUGTYPE_VGA for such a plugins (interally handled like
  a core plugin).
- Added panic in devices init for the case no VGA compatible plugin is present.
- Added new method vga_redraw_area() that handles the non-VGA and null size
  case. The specific method redraw_area() is called otherwise.
- Moved init_systemtimer() call from extension code to init_standard_vga().
- TODO: Implement VGA subsystem in the Voodoo code to test the new feature.
  Voodoo Banshee 2D accelerator code needs to be written to make this really
  useful.
2017-10-10 18:06:16 +00:00
Volker Ruppert
bd1eb0f862 Rewrite of the USB devices plugin code similar to the network driver code.
- Removed "pseudo device plugin" containing common code and all connectable
  USB devices.
- Moved USB device base class and module handling to the Bochs core.
  Now loading USB device plugins in usb_common.cc.
- Created separate plugins for each USB device implementation.
- Modified Bochs plugin system to support new plugin type PLUGTYPE_USBDEV.
- Added entries for the non-plugin case similar to the network and sound stuff.
2017-05-28 08:13:06 +00:00
Volker Ruppert
c897ffa619 Cleanups in the Bochs system timer code
- Now using macro DEV_register_timer() in all devices and lowlevel modules.
- Removed unused timer stuff from the plugin.cc/.h code.
2017-03-30 18:08:15 +00:00
Volker Ruppert
eeec43d811 Implemented self-registering static objects in the lowlevel sound code similar
to the network module handling. Now the 'dummy' sound driver can be a real
plugin, too.
2017-03-14 18:21:05 +00:00
Volker Ruppert
18e138b0b4 Fixes and improvements for the network plugins changes in previous commit.
- In "non-plugin" mode loading and unloading network module is not necessary.
  Now enabled loading for the plugin mode only and removed unloading function
  for that case. The "pseudo plugin" entries of the dummy entry points are
  necessary to make sure the self-registering network driver objects are not
  optimized out.
- slirp / vnet: Since the plugin init function is not called in non-plugin
  mode, revert the instance count init change.
- Fixed a makefile dependecy.
- TODO: Implement self-registering objects in the sound driver code.
2017-03-12 20:26:42 +00:00
Volker Ruppert
758f4de4d4 Rewrite of the network driver plugin code.
- Removed "pseudo device plugin" containing common code and specific drivers.
- Moved network module base classes and module handling to the Bochs core.
  Now loading network driver plugins in netmod.cc.
- Moved shared networking code used by the 'vnet' driver and 'bxhub' from
  netmod.cc/.h to new files netutil.cc/.h.
- Created separate plugins for each network driver implementation.
- Modified Bochs plugin system to support new plugin type PLUGTYPE_NETWORK.
2017-03-12 07:48:08 +00:00
Volker Ruppert
0456c1034f Rewrite of the "no-plugins" code for loading/unloading gui, optional and sound
plugins. Now the plugin type is stored in the structure, so we need only one
array and one load function for plugins of these types.
2017-02-24 19:45:23 +00:00
Volker Ruppert
449c8ae620 Some more fixes in the new sound plugins code.
- Builtin sound driver plugin support should depend on BX_SUPPORT_SOUNDLOW.
- Added some symbols required for the MSVC plugin of sound driver "file".
- Clean up threads and audio buffers only when shutting down the primary sound
  driver (pcm_callback_id >= 0). Fixes crash on exit with wavemode 3.
2017-02-21 21:12:17 +00:00
Volker Ruppert
60d24943c6 Rewrite of the sound driver plugin code.
- Renamed OSS sound driver files from soundlnx.cc/.h to soundoss.cc/.h.
- Removed "pseudo device plugin" containing common code and specific drivers.
- Moved common sound code, base classes of sound drivers and the dummy driver
  to the Bochs core. Now loading sound driver plugins in soundmod.cc.
- Created separate plugins for the platform/library specific drivers and the
  "file" driver.
- Modified Bochs plugin system to support now plugin type PLUGTYPE_SOUND.
2017-02-20 18:21:19 +00:00
Volker Ruppert
c119c3528f Fixed non-plugin case for wxWidgets. 2017-02-18 16:56:19 +00:00
Volker Ruppert
f33093549b Modified plugin system to support the new PLUGTYPE_GUI.
- Changed the name of the entry point of the gui plugin code to
  lib{gui_name}_gui_plugin_init(). It is used when loading plugin with the new
  type. Added gui init code for the non-plugin version in plugin.cc.
- Some related changes for the "wx" case.
- The function load_and_init_display_lib() now only returns 1 on success.
- Minor other changes.
2017-02-18 16:28:04 +00:00
Volker Ruppert
458f747b48 Removed unused argc and argv parameters from plugin init functions. 2017-01-28 09:52:09 +00:00
Volker Ruppert
877118954c Plugin system cleanup
- Removed unused functions and declarations.
- Removed unused command line argument handling.
- TODO: Modify the "plugin_init" and PLUGTYPE_* definitions.
2017-01-13 18:09:51 +00:00
Volker Ruppert
d5ffb53f4e Simplified loading of the display library ("gui") plugin. Some special code is
only required for the non-plugin case. Loading an externally developed gui might
be possible now.
2017-01-12 21:39:04 +00:00
Stanislav Shwartsman
ca403b69c4 c++ better to use delete and not malloc 2016-12-05 18:47:16 +00:00
Volker Ruppert
0ba744b9fe Started implementing USB EHCI support. The PCI and MMIO register behaviour is
almost implemented, the port owner handling and the UHCI companion controllers
are present. High speed devices are not yet supported, since the EHCI scheduler
code has not been written yet (e.g. porting from Qemu). Low and full speed
devices should be detected correctly and work after port ownership change to
UHCI. 6 ports are available and the bochsrc syntax is similar to other HCs.
2015-12-06 20:03:42 +00:00
Volker Ruppert
a767ec0b1b The plugin version now uses the native DLL handling code for all Windows ports.
Skip configure checks for libtool / ltdl and no longer link with mingwex.
2013-12-29 20:04:16 +00:00
Volker Ruppert
fc4538a131 Some fixes / improvements in logging system
- fixed pluginlog init in non-plugin mode
- reduced logprefix length limit and use it for the related string parameter
- increase the device prefix size to 6
- TODO: change some more device prefixes
2013-12-29 10:41:11 +00:00
Volker Ruppert
acc4c6c2c8 Some fixes and cleanups
- in wx we had two logfunctions for the siminterface (removed duplicate init)
- renamed siminterface prefix to "SIM"
- moved variable "pluginlog" to the plugin interface
- fixed / removed some forward declarations
2013-12-29 08:45:28 +00:00
Volker Ruppert
df1a3158ec Added full support for the LTDL_LIBRARY_PATH with MSVC plugins. Using the
semicolon as item separator similar to ltdl. TODO: make the MSVC plugin
handling work with the other win32 ports.
Minor cleanups in the plugin code.
2013-11-16 11:24:51 +00:00
Volker Ruppert
fc6b64c1b5 Added minimal support for LTDL_LIBRARY_PATH with MSVC plugins. Only one path
is supported for now (TODO: add support for a path list similar to ltdl).
Fixed documentation for LTDL_LIBRARY_PATH (Windows path separator).
2013-11-15 19:14:31 +00:00
Volker Ruppert
5f5d8e2c33 Applied initial version of the 3dfx Voodoo Graphics emulation. The Voodoo core
is based on a patch originally designed for DOSBox. Currently only the Voodoo1
adapter model can be emulation. The emulation is currently slow, but we intend
to clean up and optimize the code. Running the 3D engine in a separate thread
is also planned. To compile with Voodoo support the configure option
"--enable-voodoo" must be used. Then the device can be activated with
"plugin_ctrl: voodoo=1" in bochsrc or on the command line. The device will be
assigned automatically to a PCI slot unless you do that manually. A specific bochsrc
option to select the adapter model will be added when the code has support for it.
2012-09-14 21:50:50 +00:00