Commit Graph

70 Commits

Author SHA1 Message Date
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
Volker Ruppert
99a31bd150 - devices 'parallel' and 'serial':
- added to optional plugin control
  - moved config parameter creation and bochsrc option parsing to the plugin
    device code
2012-04-16 19:17:10 +00:00
Volker Ruppert
8ada8d66ff - simplyfied unloading of core plugins 2012-02-12 08:37:42 +00:00
Volker Ruppert
e4570a0939 - added special linked list for core plugins and manage them with the device
plugin system.The load order is important for these devices!
- load support plugins for networking, sound and usb only if at least one of the
  related plugin devices is loaded.
- plugin_ctrl: added missing devices to the list in bochsrc sample
2012-01-13 17:04:47 +00:00
Volker Ruppert
fb9401c3b0 - devices 'ne2k' and 'sb16': moved config parameter creation and bochsrc option
parsing to the plugin device code
- sb16: modified misc runtime menu creation to make the sb16 parameters optional
- ne2k: changed location of the init() method in file (now matches coding style
  of other device plugins)
2012-01-12 18:03:20 +00:00
Volker Ruppert
5c49e2458f - added new plugin type PLUGTYPE_STANDARD for optional plugins which are used in
nearly all cases and plugins that depend on others. These plugins cannot be
  managed with 'plugin_ctrl' (e.g. keyboard, harddrv, pci_ide). Store the plugin
  type in the divice structure for compatiblity with the "no-plugin" compilation.
  Call the device methods init(), reset() and after_restore_state() for each type
  separately in the order: stanard, optional, user. This also affects the status
  bar LED feature: now the keyboard and harddrv LEDs are always visible, but
  those of optional plugins may be invisible if there is no space left.
- TODO #1: add the devices 'ne2k' and 'sb16' to 'plugin_ctrl'
- TODO #2: manage core plugins with the device plugin system
2012-01-10 17:45:18 +00:00
Volker Ruppert
db4520f778 - devices 'pcidev' and 'pcipnic': moved config parameter creation and bochsrc
option parsing to the plugin device code
2012-01-09 17:15:03 +00:00
Volker Ruppert
c403b4b699 - devices 'usb_ohci' and 'usb_uhci': moved config parameter creation and bochsrc
option parsing to the plugin device code
- added function bx_init_usb_options() to reduce code duplication
- added log function names for 'usb_ohci' and 'usb_uhci'
- documentation updates
2012-01-08 12:43:46 +00:00
Volker Ruppert
a48ef5f719 - added check for bochsrc options of optional plugins that have been moved to
the device code. Added panic message to force the user to enable the plugin
  with 'plugin_ctrl'.
- moved config parameter creation and bochsrc option parsing for device
  'usb_xhci' to the plugin device code
- added minimal documentation for the "log action per device" feature
- added log function name for 'usb_xhci'
2012-01-07 14:14:53 +00:00
Volker Ruppert
8ef4c8abaa - removed plugins 'acpi' and 'ioapic' from the optional plugin control to avoid
trouble. In the future they may depend on the selected PCI chipset.
2011-12-27 13:02:35 +00:00
Volker Ruppert
0de2516d05 - fixes to avoid crash after unloading plugins before simulation
- small cleanups
2011-12-26 20:32:56 +00:00
Volker Ruppert
046b74d94c - devices 'e1000' and 'es1370': moved config parameter creation and bochsrc
option parsing to the plugin device code
- TODO: some more optional device plugins could be modified this way
2011-12-26 17:32:57 +00:00
Volker Ruppert
aad2d89c83 - rewrite of the optional plugin control feature. Now the plugins are loaded
directly while parsing the bochsrc or command line. If plugin support is enabled,
  the option could load all optional plugins, not only the ones supported before.
  NOTE #1: The old option had all plugins enabled by default and gave the user
           a chance to diable them. Now the plugins are only loaded if they
           appear in the config line and they are set to "1".
  NOTE #2: Loading a plugin that is controlled by a bochsrc option is possible,
           but it currently leads to a panic, since the load command is still
           present in devices.cc.
  NOTE #3: The plugin init code creates the device object and registers the
           optional plugin device. As an option, it can create config parameters
           and register an option parser. The device init, register state and
           reset is still handled in devices.cc, but in the order the devices
           have been loaded with the plugin control.
  NOTE #4: If plugin support is disabled, the plugin control only accepts the
           devices listed in plugin.cc.
- plugin init of core plugins now fails if they are not loaded with the expected
  type. For core plugins the load order is important and they cannot be handled
  with the chained devices list (used for optional and user plugins).
- some additions for calling config.cc functions from a plugin device
2011-12-25 08:52:34 +00:00
Volker Ruppert
04b0bcb746 - some work for the case the plugin support is turned off
- added plugin unload function and improved load function
  - use new function in bx_unload_plugins()
- new macro BX_UNREGISTER_DEVICE_DEVMODEL for future enhancements
2011-12-23 12:01:58 +00:00
Volker Ruppert
38a797f502 - added function for loading optional plugins in case the plugin support is
turned off. Removed workaround code from devices.cc.
- removed 'pci_ide' plugin from the optional plugin control, since it depends
  on the presence of 'pci' and 'harddrv'.
- define types for plugin init/fini functions
2011-12-22 10:35:49 +00:00
Volker Ruppert
c2d0c207f7 - preparing Bochs for experimental USB xHCI support (written by Ben Lunt) TODO list:
- add sources (update in progress)
  - update configure script
  - initialize new USB devices member 'max_packet_size' (need help from Ben)
2011-07-04 19:42:47 +00:00
Volker Ruppert
6a42228075 - first step for DLL plugin support with MSVC. Now the BOCHS.EXE with plugin
support compiles and links fine and the main object files for the plugin DLLs
  are created. Since the gui and iodev makefiles are not ready yet, the link
  stage must be done manually. Support for the search path defined in
  LTDL_LIBRARY_PATH should be added when the DLL plugins compile and work.
2011-06-15 17:24:32 +00:00
Stanislav Shwartsman
00981cd7a6 Adding Id and Rev property to all files 2011-02-24 22:05:47 +00:00
Volker Ruppert
668cd80448 - plugin target changes based on Debian patches
- use system 'ltdl' library if present (otherwise use builtin ltdl stuff)
  - use plugin library extension '.so' on non-win32 platforms
2011-01-23 20:21:21 +00:00
Stanislav Shwartsman
7233fdf3c1 fixed non-printable character 2009-08-22 19:30:23 +00:00
Volker Ruppert
6a78f0d769 - removed extended debug output in some PCI config space read handlers
- small changes in some debug messages to make the log better readable
2009-04-22 18:37:06 +00:00
Volker Ruppert
501952efdd - removed unused logfunctions member 'type' and related method 'settype()'
- updated FSF address in copyright
2009-01-10 11:30:20 +00:00
Volker Ruppert
8aa8b1a3db - rewrite for user plugin support with user-defined options
* initialize plugin system before parsing bochsrc and command line
  * pass previous value to bx_param_string_c handler
  * load / unload plugin in bx_param_string_handler()
  * handle user plugins after optional ones in plugin device init, reset and
    save/restore functions
  * added new siminterface method unregister_user_option()
  * removed first version of config option handling for user plugins
  * added new parameter subtree for user-defined options
  * added new bx_list_c method remove()
  * removed unused bx_devmodel_c method init_mem()
2009-01-04 21:46:20 +00:00
Volker Ruppert
b23e7bf6a0 - added basic user plugin support (TODO: add sample code) 2009-01-02 11:51:03 +00:00
Volker Ruppert
d65e860637 - some small progress for user plugin support
* the "init" and "fini" functions of different user plugins can always have
    the same name (tested on Linux and Windows)
  * make sure that a plugin cannot be loaded twice
  * fixed check for the presence of the "fini" function
  * TODO: configuration and load mechanism for user plugins
2009-01-01 12:06:31 +00:00
Stanislav Shwartsman
a459a64f3e whispace, tab2space, indent, dos2unix and other cleanups 2008-02-15 22:05:43 +00:00
Stanislav Shwartsman
55ad3e89b6 another whitespace cleanup by Sebastien 2008-02-05 22:57:43 +00:00
Stanislav Shwartsman
d30a0d3699 warning fixes 2007-10-24 23:29:40 +00:00
Stanislav Shwartsman
071c5c1a26 A lot of changes but everything is really trivial.
Make save/restore default feature, the configure option for save/restore removed from configure script and save/restore made available forever. All code now assume it is exists. Bochs save/restore tree previosly called "save_restore" renamed to "bochs" tree and it will be havily used everywhere, starting from save/restore and ending by various bochs debugger functions. I am going to rework debugger code to get rid of debug CPU access functions and use this "bochs" param tree instead
2007-09-28 19:52:08 +00:00