Commit Graph

11451 Commits

Author SHA1 Message Date
Volker Ruppert
ca9120655b Some work on the Voodoo Banshee emulation.
- Moved basic BitBlt stuff from the Cirrus code to a separate header file to
  make it usable for the Voodoo Banshee, too.
- Rewrite of the screen-to-screen BitBlt code for the new ROP code.
- Calculate redraw parameters based on the screen start.
- Set "Banshee busy" bit in the status register when 2D is busy.
- Added some error messages for unimplemented features.
2017-11-04 23:43:38 +00:00
Volker Ruppert
b1aefb0b6c Some work on the Voodoo Banshee emulation.
- Host-to-screen and screen-to-screen copy operations implemented (ROP 0xcc).
- Rectangle fill command now handles clipping.
- Attempt to fix the redraw_area() location after bitblt operations.
- Update the host palette entries when writing to CLUT (fixes screenshot).
- Added 2D register names for debug messages.
2017-11-01 21:32:41 +00:00
Volker Ruppert
815b8238c7 Some work on the Voodoo Banshee emulation.
- Fixed hardware cursor bottom/right edge display bug.
- Started splitting 2D code in different methods (no functional changes).
- Added hardware cursor to save/restore list.
TODO #1: Implement bitblt engine similar to the Cirrus one.
TODO #2: Voodoo code reorganization: base class with Voodoo core, one subclass
         for Voodoo1/2 and one for Banshee.
2017-10-31 22:58:10 +00:00
Volker Ruppert
78ef782b38 Some work on the Voodoo Banshee emulation.
- Added CMDFIFO extensions (CMDFIFO #1 still unhandled).
- Fixed voodoo plugin compilation on Windows.
- Fixed an MSVC warning.
2017-10-31 11:43:28 +00:00
Volker Ruppert
dcbca35ac7 Voodoo Banshee hardware cursor implemented. 2017-10-30 23:03:26 +00:00
Volker Ruppert
13d4f0ff65 Some work on the Voodoo Banshee emulation. Win95 boots now with Banshee driver
in 8 bpp mode, but it's not yet usable (no cursor, no text). List of changes:
- Added AGP/CMD/Misc register handling (CMDFIFO #0 is now usable).
- Started work on 2D register handling ("Rectangle fill" command implemented).
- Added Banshee specific code in redraw_area().
- Writing to VGA DAC registers also modifies the Banshee CLUT.
- Banshee now indicates that no TV-out and video-in device is connected.
- Some other related fixes and improvements.
2017-10-29 21:25:37 +00:00
Volker Ruppert
d7ab113a95 Improved video clock handling for the retrace timing emulation.
- Added VCLK array and removed hardcoded values.
- Added new method get_crtc_params() to retrieve htotal and vtotal values.
- Cirrus: Set up VCLK registers with default on reset (TODO: VGABIOS should do
  that when setting video mode).
- Voodoo Banshee: Set up VCLK #3 when writing to pllCtrl0 register. VCLK #0 and
  #1 are VGA compatible and VCLK #2 is fixed 50 MHz. Fixed maximum resolution
  based on PLL section of the spec.
2017-10-27 18:49:19 +00:00
Volker Ruppert
7bd6e6c7c2 Removed all of the pre-defined rasterizer functions and replaced it by a single
function. I guess the old stuff should be a speed optimization, but I don't see
a difference with the new code. The simulation output is also still the same.
Now Bochs compiles much faster with Voodoo support enabled and the binary is
much smaller. This patch has been written by Luigi B.
2017-10-23 20:01:25 +00:00
Volker Ruppert
e2245d98d3 Some work on the Voodoo Banshee emulation.
- Banshee Memory layout implemented (AGP/misc and 2D register behaviour not
  implemented yet). Now Win95 with Banshee driver can boot in standard VGA mode.
- Fixed memory allocation: Banshee has 16 MB shared LFB / TMU memory.
- Some work on save/restore support.
- Renamed Banshee VGA register handlers.
2017-10-23 18:45:16 +00:00
Volker Ruppert
539356ac13 Some changes and comments in the xHCI code by Ben Lunt. 2017-10-22 14:30:04 +00:00
Volker Ruppert
1b8c58ed58 Some work on the Voodoo Banshee emulation.
- tile-based VBE graphics updates implemented
- "half mode" support added (line doubling for low resultions)
- change screen resolution only after re-enabling the video processor
2017-10-22 12:16:20 +00:00
Volker Ruppert
26c6c3bfca Moved macros SET_TILE_UPDATED and GET_TILE_UPDATED to vgacore.h to reduce code
duplication.
2017-10-22 10:09:32 +00:00
Stanislav Shwartsman
8261a91ce9 implemented GFNI instructions 2017-10-21 19:57:12 +00:00
Volker Ruppert
35684fa0f5 Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
  initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
  to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
  original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
  mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
  - Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
  - 2D graphics engine must be written from scratch
  - interaction between new device and existing 3D core
  - non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
  - save/restore support, move Banshee stuff to separate file, ...
2017-10-21 12:46:17 +00:00
Stanislav Shwartsman
e426970f15 updating CHANGES 2017-10-20 19:55:24 +00:00
Stanislav Shwartsman
b7f62a291c fixed compressed displ form for more avx512 instructions 2017-10-20 19:41:32 +00:00
Stanislav Shwartsman
da8d6e793f fixed compilation issues 2017-10-20 19:24:10 +00:00
Stanislav Shwartsman
bca076889b decode all the vbmi2 opcodes, fix vpcompress/vpexpand instruction handler names (affects disasm) 2017-10-20 18:50:10 +00:00
Stanislav Shwartsman
77a62a4dcd implemented (experimental, still untested) AVX512 VBMI2 extensions 2017-10-20 18:38:15 +00:00
Stanislav Shwartsman
0afbb6cd3d fixed compilation when AVX is not configured in 2017-10-20 12:27:42 +00:00
Stanislav Shwartsman
5439647254 small change to extract ia_opcodes.h from instr.h to dedicated file. this would remove compilation dep of all files on ia_opcodes.h (now called ia_opcdes.def). regenerating dep ober all files in Makefiles.in 2017-10-19 21:27:25 +00:00
Stanislav Shwartsman
ba1e5bbffa fixed accidentially broken XMM versions of AES instrructions 2017-10-19 20:25:05 +00:00
Stanislav Shwartsman
15ba88c195 implemented VAES/VPCLMULDQ instructions - VEX/EVEX extensions of AES/PCLMULQDQ 2017-10-19 19:12:55 +00:00
Stanislav Shwartsman
ac442009aa lazy flags code small refactoring 2017-10-15 22:01:32 +00:00
Stanislav Shwartsman
6daa1ba9ba fixed compilation issue with EVEX enabled 2017-10-15 20:40:56 +00:00
Stanislav Shwartsman
944f37b1f2 implemented AVX-512 BITALG instructions/bugfix for VPOPCNT instructions 2017-10-15 20:33:19 +00:00
Stanislav Shwartsman
0d190eec8e implemented AVX-512 VNNI instructions 2017-10-15 19:17:07 +00:00
Stanislav Shwartsman
4179e6f939 add some const 2017-10-14 18:42:12 +00:00
Volker Ruppert
184324c8e8 Some small fixes in the display adapters code.
- Fixed missing bx_gui->flush() call after non-VGA update().
- Fixed a BX_DEBUG message in the Voodoo code.
- Re-define LOG_THIS for messages in the "Voodoo VGA" code.
2017-10-14 11:15:00 +00:00
Stanislav Shwartsman
69f27439db added new cpuid flags mentioned in new Intel SDM future extensions rev030 doc 2017-10-13 20:27:52 +00:00
Volker Ruppert
2b91dabfe5 Added new VGA extension choice "voodoo" to test the new VGA extension code. It
currently only implements an ISA standard VGA adapter with the selected Voodoo
model as it's extension. The methods of the "Voodoo VGA" device only call the
required methods of the Voodoo or VGA core.
TODO: Start implementing the Voodoo Banshee chipset based on this code.
2017-10-12 19:34:58 +00:00
Volker Ruppert
5ec78eaae2 Modified VGA extension init method. Now it returns 1 if the extension code has
initialized the VGA compatible video memory. If it has returned 0 the VGA core
code sets up the default VGA memory (256k).
2017-10-12 19:18:23 +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
6dba96d10a Some changes related to the PCI ROM handling.
- Added support for setting memory write handler to NULL (ROM case).
- Added new PCI device method after_restore_pci_state(). It currently handles
  the PCI ROM case only (could be extended).
2017-10-08 15:54:21 +00:00
Volker Ruppert
610cec209d Rewrite of the VGA/Cirrus code to reduce code duplication.
- Moved VGA timer handler to the VGA core and handle the non-VGA case there.
  It calls the specific update() code and finally bx_gui->flush().
- Moved the VGA update frequency parameter handler and the refresh_disply()
  method to the VGA core.
- Store the VGA extension parameter in the VGA core.
- Voodoo: Fixed graphics snapshot.
2017-10-08 07:55:04 +00:00
Volker Ruppert
ebbd952d3b Code cleananup: Since the Cirrus plugin device is only loaded in case the
VGA extension "cirrus" is selected, there is no need to check this parameter.
TODO: Implement new VGA extensions (e.g. Voodoo Banshee, Voodoo3).
2017-10-07 08:49:05 +00:00
Volker Ruppert
f31d062854 Added SDL / SDL2 specific multi-threading support. If one of these guis is
enabled, the portable code is used instead of the pthread or win32 one.
2017-09-16 22:01:49 +00:00
Volker Ruppert
0311f47bc3 Moved all Bochs event / wait functions required for multi-threading to a new
file called "bxthread.cc".
2017-09-14 16:18:12 +00:00
Volker Ruppert
2a47615bb6 Started updating changes after release 2.6.9. 2017-09-12 17:48:43 +00:00
Volker Ruppert
c889fcae87 Some improvements in the Voodoo2 CMDFIFO code.
TODO: Check whether or not there are still simulation freezes caused by CMDFIFO.
2017-09-12 16:29:02 +00:00
Volker Ruppert
245ccf1037 Added symbols to fix MSVC plugins compilation. 2017-09-10 19:16:02 +00:00
Volker Ruppert
b61b9d255a Moved all Bochs multi-threading definitions from bochs.h and osdep.h to a new
file called "bxthread.h".
2017-09-10 15:55:13 +00:00
Volker Ruppert
ad9f1c3417 Moved event / wait stuff from the Voodoo code to osdep.cc fot the usage in
other parts of Bochs.
2017-09-10 06:50:07 +00:00
Volker Ruppert
da48346f9d Implemented combined PCI / memory FIFO. This is required for running Voodoo1
games / demos correctly on the Voodoo2 model. I noticed a small slowdown
(2 or 3 percent) on the Voodoo1.
2017-09-08 16:17:20 +00:00
Volker Ruppert
c1d5947a80 Memory FIFO fix: 16-bit write support for the FBI video memory was missing. 2017-09-03 20:51:37 +00:00
Volker Ruppert
e063d282ac Voodoo2 CMDFIFO fix and cleanup.
- Fixed probing the CMDFIFO with Voodoo output disabled (send FIFO wakeup
  directly, otherwise driven by vertical retrace).
- Use the CMDFIFO member 'enabled' instead of reading the fbiInit7 register bit.
- TODO: The Voodoo2 freeze when testing a Voodoo1 demo is still not fixed.
2017-09-03 17:32:49 +00:00
Stanislav Shwartsman
ec6281a828 remove include which is not needed 2017-09-03 11:43:30 +00:00
Stanislav Shwartsman
3148cdd683 fixed compilation under VS2013 2017-09-03 11:42:27 +00:00
Volker Ruppert
7c3dafc7f5 Some Voodoo emulation fixes.
- voodoo_init() must be called after initializing FIFO mutex.
- The 'op_pending' counter must be reset after resetting FIFOs.
- Fixed an MSVC warning and removed obsolete comment.
- FIXME: There are still some conditions that can freeze the Voodoo display.
2017-09-03 08:28:16 +00:00
Volker Ruppert
1f85292418 Implemented memory FIFO to speed up the Voodoo1 emulation. The PCI FIFO with
it's 64 entries is still not present, since it makes the emulation a few
percent slower due to the overhead of the FIFO code. The memory FIFO has 64k
entries and makes a speedup of around 75 % possible.
2017-09-01 17:30:49 +00:00
Volker Ruppert
ea8bfca53f Two USB modifications requested by Ben Lunt.
- usb_msd.cc: The Device Qualifier is valid for high speed devices only.
- uhci_core.cc: Don't report BX_DEBUG message if the current TD belongs to an
  async operation that is still not complete.
2017-08-26 08:10:21 +00:00
Volker Ruppert
bd40347963 Store FIFO presence in variable "enabled" and report the state change of the
currently unimplemented FIFOs.
2017-08-24 21:08:21 +00:00
Stanislav Shwartsman
2d3d62db5f cleaned cr2 print in 32-bit mode 2017-08-22 21:14:39 +00:00
Stanislav Shwartsman
2a55ba0a39 Merge set of debugger improvements by Doug Gale <doug16k>
Here is his original comment:

I have made several improvements in the debugger.
I have fixed several issues with proper handling of 64-bit addresses, and added support for 64 bit symbols.
I also have added several symbol lookups.
2017-08-22 21:03:58 +00:00
Stanislav Shwartsman
f490b00beb added support for conditional breakpoints in Bochs debugger 2017-08-22 18:47:18 +00:00
Volker Ruppert
680189a548 Fixed Voodoo pixel clock calculation.
- Now using float type for the 'clk0_freq' variable.
- DAC register 6 can switch to half pixel clock (ported from PCem).
- Writing value 0xf8 to PLL register 0x0e completes clock #0 setup.
2017-08-21 19:33:29 +00:00
Volker Ruppert
4e80e2fbfc Started preparing the Voodoo code for the PCI FIFO / memory FIFO implementation.
- Initialize the thread and event stuff for both Voodoo models.
- Rewrite of the event handling code to manage different events.
2017-08-20 20:25:45 +00:00
Volker Ruppert
e187f3907a Removed Voodoo realtime option. Since the gui screen update timing is now
controlled by the 'vga' option and Voodoo2 CMDFIFO thread has the best
performance with realtime mode disabled, this option is now obsolete.
2017-08-18 15:19:30 +00:00
Volker Ruppert
9a1668ac36 First version of the Voodoo2 CMDFIFO thread using "pthread cond" code on
non-WIN32 platforms instead of BX_MSLEEP(). The donut demo is once again a
little bit slower, but on other tests the IPS values are still okay. Cleaned
up the code a little bit and added save/restore stuff for the new code.
2017-08-17 19:15:02 +00:00
Volker Ruppert
6361386e8b Reverted BX_LOCK/BX_UNLOCK changes from previous commit (don't lock CMDFIFO
completely while running cmdfifo_process()). The donut demo is now a little bit
slower on Linux host, but other test cases are faster again.
2017-08-17 17:15:12 +00:00
Volker Ruppert
fcb5f6d1d3 Voodoo2: Now only start processing of the CMDFIFO at the vertical retrace.
I noticed a speed improvement of around 10 % (tested with donut demo only).
2017-08-15 21:30:45 +00:00
Stanislav Shwartsman
7f4a9b4b08 skylake CPUID should compile also with no EVEX 2017-08-09 21:04:15 +00:00
Stanislav Shwartsman
7f01a7d9b6 remove obsolete comment 2017-08-09 20:37:43 +00:00
Stanislav Shwartsman
b2fdbd1274 added Skylake-X model to CPUDB -> with EVEX and AVX512 support 2017-08-09 20:36:17 +00:00
Volker Ruppert
593141603d Small change in the non-WIN32 Voodoo2 thread code: Process all complete command
packets and then always sleep for 1 millisecond.
TODO: The first tests with pthread_cond_* stuff showed a slowdown of approx.
10 % compared with the IPS value of the current code.
2017-08-09 15:42:34 +00:00
Volker Ruppert
3cee1f74ee Now using WIN32 event / wait functions in the Voodoo2 thread. I noticed a speed
improvement of around 10 % (tested with donut demo only).
TODO: Use similar functions of the pthread library for improvements on other
platforms.
2017-08-08 18:23:12 +00:00
Volker Ruppert
bd39f8c103 Fixed GCC 6.3 warnings (indentation only). 2017-08-07 18:18:18 +00:00
Volker Ruppert
ca3758423b Fixed some MSVC warnings. 2017-08-06 18:35:37 +00:00
Volker Ruppert
21fce8c2f2 Fixed compilation failure if ES1370 is enabled, but gameport disabled in config.h. 2017-08-04 18:09:26 +00:00
Volker Ruppert
18dc09aaad Fixed possible CMDFIFO failure. 2017-07-18 18:03:16 +00:00
Volker Ruppert
7b5eca0cf2 Minimal improvement in the CMDFIFO code: calculate needed depth for current
command and execute it when there is enough data present (code partly ported
from voodoo.h.txt).
TODO: Use "wait for event / condition" functions instead of msleep() if there
is a performance improvement with it.
2017-07-17 18:07:28 +00:00
Volker Ruppert
2b92978728 Fixed save/restore failure. 2017-07-12 21:01:58 +00:00
Volker Ruppert
0d7c32c6b5 Minor fixes and cleanups in the bxhub code.
TODO: rewrite of the vnet server code to reduce code duplication.
2017-07-04 18:53:33 +00:00
Volker Ruppert
bc82bf9316 Removed unnecessary include. 2017-06-28 15:34:34 +00:00
Volker Ruppert
851e9a084c Fixed compilation on MSVC (Bochs always defines stricmp). 2017-06-23 19:44:30 +00:00
Volker Ruppert
17abf11e85 Check requested maximum DHCP message size and report if invalid (networking
modules vnet / socket only).
2017-06-18 15:54:54 +00:00
Volker Ruppert
d22cdbdbf7 Some work on the bxhub utility.
- Added DNS service support for the server "vnet" and connected clients.
- Added command line option "-loglev=" to control whether or not there is
  BX_ERROR, BX_INFO or BX_DEBUG output. Default value is 1 (BX_ERROR only).
2017-06-17 12:40:13 +00:00
Volker Ruppert
2ae5fd563e Added destructors to some networking modules and call fclose() there for the
case the logging feature is enabled.
2017-06-16 08:27:55 +00:00
Stanislav Shwartsman
54e969b749 disasm update 2017-06-05 21:05:47 +00:00
Stanislav Shwartsman
20e9e33662 internal disasm updates 2017-06-05 20:49:04 +00:00
Stanislav Shwartsman
3f4f18de7a internal disasm updates 2017-06-05 20:28:33 +00:00
Stanislav Shwartsman
46ef85ce0f avoid using magic constants for disasm source metadata 2017-06-05 19:55:40 +00:00
Volker Ruppert
8006ec9fa3 Fixes and updates for wxWidgets 3.0
- wxMSW unicode: define UNICODE before including windows.h via bochs.h.
- Fixed compilation error (wxNode usage).
- Fixed deprecation warnings at toolbar creation.
2017-06-04 09:32:58 +00:00
Stanislav Shwartsman
38e2562d9c added new debugger cap: conditional continue' 2017-06-03 19:11:52 +00:00
Volker Ruppert
f38a0d8a97 Updated code for the invisible cursor on wxGTK (fixes compilation on wxMSW 3.0). 2017-06-03 14:32:56 +00:00
Volker Ruppert
bdd8875692 Reverted BX_THREAD_KILL() changes in the lowlevel sound code. Now using control
variables again to let the threads end normally. Re-implenented the method
closewaveoutput() for some modules, move the destructor code to it and call it
after leaving the mixer thread. This fixes a deadlock in the "soundwin" module
if Bochs is compiled with plugin support.
2017-06-02 16:56:58 +00:00
Volker Ruppert
726e39f854 Some work on the USB device plugin code.
- usb_common: init_device() now splits device name and primary option before
  detecting device type.
- usb_hub: now completely handle port option in constructor.
- plugin.h: removed obsolete defines.
2017-06-01 20:04:10 +00:00
Stanislav Shwartsman
b4d2bbcd32 fixed compilation issue 2017-06-01 10:25:22 +00:00
Stanislav Shwartsman
555bb8f8b6 updates to prev commit 2017-06-01 08:41:41 +00:00
Stanislav Shwartsman
6ab4fd597b implement another form of AR field packing used in SKL, in addition on present NHM format 2017-06-01 08:31:20 +00:00
Stanislav Shwartsman
bde8a1f69d fixed ifdef typo 2017-06-01 07:48:54 +00:00
Stanislav Shwartsman
22e9051716 implemented correct VM-exit instruction information for INVPCID, RDRAND/RDSEED and XSAVES/XRSTORS instruction Vmexits 2017-05-31 13:16:49 +00:00
Volker Ruppert
1de56aa05e Fixed plugins case (unloading module). 2017-05-28 08:45:23 +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
Stanislav Shwartsman
bb43ac527b fixed decoder issue when decoding opcode 8f (aka xop prefix) as well 2017-05-27 10:32:44 +00:00
Stanislav Shwartsman
54c109ceb4 VEX and EVEX opcodes should be considered as 2-byte opcode, always attempt to fetch 2nd byte even if #UD is already detected 2017-05-26 11:46:02 +00:00
Stanislav Shwartsman
48a2bc2cbf change disasm memsize print 2017-05-26 11:21:56 +00:00
Stanislav Shwartsman
6ac6463754 fixed compilation err with recent gcc 2017-05-26 07:16:25 +00:00
Volker Ruppert
431e9671a6 Code cleanup: removed unused definitions, functions and statistics code not
required for the emulation.
2017-05-21 18:30:25 +00:00
Volker Ruppert
5db2596317 The resampler and mixer threads are now stopped with BX_THREAD_KILL(). 2017-05-21 15:08:20 +00:00
Volker Ruppert
82eeab4a57 Some documentation updates. 2017-05-21 07:27:26 +00:00
Volker Ruppert
c160fd4830 Bochs thread handling improvements:
- Modified win32 thread macros to use the handle instead of the id.
- Added new macro BX_THREAD_KILL to terminate threads.
Voodoo thread changes:
- Let the cmdfifo_thread sleep while the CMDFIFO is disabled.
- Kill the cmdfifo_thread in destructor and removed old thread control code.
2017-05-18 18:34:00 +00:00
Volker Ruppert
495a8afeac Voodoo2 bitBLT: optimized SGRAM fill code a little bit. 2017-05-17 21:21:53 +00:00
Volker Ruppert
9912c99fd2 Continued work on Voodoo2 support (some demos now working).
- Added capability to save/restore float type values in paramtree / siminterface.
- Added Voodoo2 triangle generator data to save/restore list.
- Implemented bitBLT function "SGRAM fill".
- Minor other changes and cleanups.
- TODO: remaining bitBLT functions, thread handling improvements.
2017-05-16 20:37:01 +00:00
Volker Ruppert
9a705a3369 Fixed Voodoo2 CMDFIFO write handling (check address range first). 2017-05-15 20:55:49 +00:00
Volker Ruppert
da489b91ce Implemented CMDFIFO type 3 data support using some pieces of code from file
voodoo.h.txt which was a part of the original voodoo patch for DOSBox.
Some Voodoo2 specific parts were not integrated in the main patch file. I guess
they have been removed since Voodoo2 support was incomplete (2D stuff missing).
TODO: Voodoo2 2D support (bitblt engine), more testing, code cleanup...
2017-05-15 19:15:55 +00:00
Volker Ruppert
6265976a2c Some work on the Voodoo2 CMDFIFO support.
- Added CMDFIFO thread similar to the sound output thread.
- split register write function in 2 functions: register_w_common() handles
  the CMDFIFO writes and valid registers in CMDFIFO mode. It forwards write
  accesses to other registers to register_w() (Voodoo1 and non-CMDFIFO mode).
  The CMDFIFO thread also calls register_w() when processing data.
- The CMDFIFO thread processes all data, but it does not yet execute type 3
  requests (extended triangle generator missing).
- TODO #1: implement Voodoo2 specific triangle functions (for CMDFIFO).
- TODO #2: implement 2D bitblt engine.
2017-05-14 15:53:29 +00:00
Volker Ruppert
19f6cbc519 Continued preparing Voodoo2 CMDFIFO support.
- Zero out voodoo device state in init().
- Added the CMDFIFO state to save/restore list.
- Added CMDFIFO register handling in read/write functions.
- Added new function cmdfifo_put().
- TODO: CMDFIFO thread.
2017-05-13 11:52:49 +00:00
Stanislav Shwartsman
af76e0c412 fixes for debugger and disasm 2017-05-10 18:31:59 +00:00
Stanislav Shwartsman
1ca366609f add memsize for non-evex memory refrences in disasm 2017-05-09 19:49:27 +00:00
Stanislav Shwartsman
f8abddafcf bugfix in disasm 2017-05-09 19:34:03 +00:00
Volker Ruppert
a575b4aa2f Some work on the Voodoo2 CMDFIFO code.
- Fixed normal register access in CMDFIFO mode.
- Implemented cmdFifoBaseAddr register behaviour.
- Write CMDFIFO data to FBI memory (has no effect yet).
- Changed some log messages to BX_DEBUG.
- Report unimplemented Voodoo2 registers.
- TODO: Add FIFO thread to process the CMDFIFO data.
2017-05-09 19:18:58 +00:00
Stanislav Shwartsman
1d48973c80 updates in fetchdecode.h to help automatic disasm to determined memaccess size 2017-05-09 12:06:02 +00:00
Volker Ruppert
e956100a60 Fixed possible segfault in win32 gui when switching back from Voodoo to VBE or
Cirrus mode. Set font height to 0 in graphics modes and fixed argument order.
2017-05-07 14:52:37 +00:00
Volker Ruppert
eb89cdaea4 It is valid to set up the PRD size larger than the IDE transfer size. Fixed
busmaster DMA code to handle this case.
2017-05-07 07:47:08 +00:00
Volker Ruppert
78ff38fcf3 Fixed check for unimplemented CMDFIFO and return for now if write would be
valid. The hRetrace value can be set now, since Bochs no longer crashes.
TODO: Implement enough of the FIFO stuff to make the Win9x driver for the
Voodoo2 work.
2017-05-06 10:07:28 +00:00
Volker Ruppert
495607d162 Added description for the win32 option "traphotkeys". 2017-05-06 08:15:05 +00:00
Volker Ruppert
6273f0cdc9 Added new win32 gui option "traphotkeys" to disable system hotkeys for the
host when the mouse is captured and in fullscreen mode. This is useful if the
guest is also a Windows version. These changes are based on the rejected SF
patch "disablesystemhotkeys". But instead of disabling the hotkeys completely,
the events are sent to the Bochs keyboard.
2017-05-05 21:44:30 +00:00
Stanislav Shwartsman
e357da9150 update (c) for fpu files 2017-05-05 21:09:27 +00:00
Stanislav Shwartsman
1abfcd39ff implement FOPCODE and FDP deprecation CPU features 2017-05-05 20:56:13 +00:00
Stanislav Shwartsman
fce7476bda convert magic defines into static const variables 2017-05-03 18:20:13 +00:00
Volker Ruppert
8b96faf99e Some work on the timing code of the Bochs display adapters.
- Voodoo: Use the VGA/Cirrus timers to drive the gui screen update.
  The vertical retrace emulation is still driven by a separate timer.
- VGA/Cirrus: Since we are using the virtual timer, we also have to read
  time_usec() from it.
- vgacore: removed unused timer methods.
2017-05-01 11:54:12 +00:00
Volker Ruppert
73c914a7f6 - Some work on the Voodoo Graphics emulation (Voodoo2 specific)
- prepared hRetrace value implementation (cannot be enabled yet, since the
    driver passes this test and gets confused in next stage (segfault).
  - Detect CMDFIFO access (not present yet).
  - Report disabling Voodoo graphics mode.
  - TODO #1: Fix Voodoo2 to make it usable.
  - TODO #2: Split update code and drive gui screen updates from the VGA timer
    (finally remove new realtime option again).
2017-05-01 09:11:12 +00:00
Volker Ruppert
d462e52a9d Implemented 'realtime' option for the Voodoo update timer similar to the VGA
realtime option (enabled by default).
2017-04-30 09:07:25 +00:00
Volker Ruppert
904984e795 Voodoo code cleanup (removed unused / disabled stuff). 2017-04-29 22:19:29 +00:00
Volker Ruppert
a7529c1e75 - Some work on the Voodoo Graphics emulation
- Since we are using the virtual timer, so we have to read time_usec()
    from it, too (TODO: realtime mode is hardcoded, maybe add an option).
  - Voodoo1 and Voodoo2 have different timing register widths.
  - Fixed vertical retrace value returned by get_retrace().
  - Prepared separate hvRetrace register (TODO: hRetrace).
2017-04-29 10:25:57 +00:00
Volker Ruppert
f4bfb6353f - Some work on the Voodoo Graphics emulation
- Store the Voodoo model in structure bx_voodoo_t.
  - The PCI initEnable register of the Voodoo2 model has a read-only secondary
    revision ID in bits 12..15. Now the Voodoo2 is correctly detected by the
    Windows driver, but display is not yet working (blank screen).
  - Reset now disables VGA override.
- PCI: Moved PCI device base class methods to the end of file devices.cc and
  re-define LOG_THIS to use the correct log module and prefix.
2017-04-28 18:45:45 +00:00
Volker Ruppert
915746a1fd Fixed slirp user-mode networking support on Cygwin 64-bit.
- Enabled Winsock2 usage and define _WIN32 symbol for Cygwin (both 32 and 64 bit).
- Changed include order in some files to resolve conflicts.
- Modified some data types to fix errors and warnings.
- Added workarounds for the incorrectly defined symbols FIONBIO, FIONREAD and
  EWOULDBLOCK.
- Verified slirp usability with Cygwin 32-bit, MinGW/MSYS and MSVC builds of
  Bochs. Other ports should not be affected.
2017-04-23 08:38:16 +00:00
Volker Ruppert
1ffac6a461 Moved method release_keys() to the common devices code to make sure this
feature also affects the removable (USB) keyboard.
2017-04-22 15:32:07 +00:00
Volker Ruppert
4ebe5e6879 If setenv() is present on Windows and variable BXSHARE is not set, use the
function get_builtin_variable() to set it up with either the value of the Bochs
registry key or the BX_SHARE_PATH constant.
2017-04-22 10:17:54 +00:00
Volker Ruppert
ec03c4bb53 Fixes in networking modules for 64-bit Cygwin.
- socket: Define the FIONBIO workaround for 64-bit Cygwin only.
- slirp: Don't mix usage of WIN32 and _WIN32 definitions.
- TODO: The slirp module still fails at UDP socket creation when Bochs is
  compiled in Cygwin64.
2017-04-21 21:07:52 +00:00
Volker Ruppert
89ed58114b Fixed compilation with DEBUG symbol defined. 2017-04-21 15:28:25 +00:00
Volker Ruppert
068795a73f Fixes in networking modules for 64-bit Cygwin.
- slirp: Increment IP packet ID outside of htons() to avoid undefined behaviour.
- socket: Workaround for a bug in the w32api code that generates a constant
  with wrong value. Setting up our own FIONBIO fixes the panic.
- TODO: The slirp module still fails when Bochs is compiled in Cygwin64.
2017-04-20 18:51:18 +00:00
Stanislav Shwartsman
68b9d10b76 reverting latest commit, merged by mistake 2017-04-20 18:31:52 +00:00
Stanislav Shwartsman
e3fdf42225 use std::string in param_tree and gain more robust code with automatic garbage collection 2017-04-20 18:26:45 +00:00
Volker Ruppert
78cce73f8a Fixed error handling on Windows (avoid flooding log file with useless messages). 2017-04-19 21:03:53 +00:00
Stanislav Shwartsman
cfecb7c969 fixed compilation err in cygwin 2017-04-19 18:30:02 +00:00
Volker Ruppert
2fb6263102 Compilation fixes for Cygwin.
NOTE: networking still fails when compiled with Cygwin ('socket' mode fails
to set up non-blocking i/o / 'slirp' doesn't complain, but fails to connect
the internet).
2017-04-18 20:45:28 +00:00
Stanislav Shwartsman
2cae01edea better way of fixing shift of 1 by 64-bit to avoid integer overflow 2017-04-17 20:38:18 +00:00
Volker Ruppert
7f2191c117 Fixed MSVC warnings. 2017-04-17 19:56:41 +00:00
Stanislav Shwartsman
0702901377 fixed gcc specific ULL usage in hpet code 2017-04-17 18:44:16 +00:00
Volker Ruppert
0ee643ad76 Removed gui support auto-detection using --with-all-libs option for the MacOS 9
and SVGAlib specific guis. These guis can still be enabled explicitly with
--with-macos or --with-svga options.
2017-04-17 14:41:02 +00:00
Volker Ruppert
e1d8bedbb5 Added symbol BX_LOAD32BITOSHACK to disable this legacy feature. With the
latest BIOS images 32-bit and even 64-bit guest OS's are known to boot inside
of Bochs without hacking. This legacy hack could be removed after next release
if nobody complains.
2017-04-17 13:26:44 +00:00
Volker Ruppert
e36b3175d1 Missed the new HPET files. 2017-04-17 07:31:08 +00:00
Volker Ruppert
e5370fa2ac Regenerated configure script and recompiled BIOS for HPET support. 2017-04-17 07:28:22 +00:00
Volker Ruppert
1d27d67ccd Added initial version of the High Precision Event Timer (HPET) ported from Qemu.
- Created framework based on our I/O APIC code and ported HPET core from Qemu
  with some required changes for the Bochs timer and IRQ handling.
- Enabled HPET-specific code in the ACPI and rombios32 sources and generated
  new ACPI table with iasl.
- The HPET device plugin is now always loaded if the i440FX chipset is selected
  (same as ACPI). We have to rethink this when we have implemented a more
  modern chipset.
- TODO: Rewrite of the virtual timer code for nanosecond support to make the
  realtime synchronization possible with HPET.
2017-04-17 07:26:00 +00:00
Volker Ruppert
89654a4beb Prepared devices and timer code for HPET support
- PIT / CMOS: added methods to control IRQ generation (for HPET legacy mode).
- Added method for activating timer with nanosecond value.
- Removed unused declaration in the keyboard code.
- TODO: virtual timer code also needs to handle nanosecond values.
2017-04-15 20:31:07 +00:00
Volker Ruppert
73bcd4f8ca Added method to convert cpu ticks to nanoseconds (required for HPET).
I/O APIC: no need to call reset() in init().
2017-04-14 19:35:21 +00:00
Stanislav Shwartsman
3d51439090 fixed compilation err for CPU_LEVEL=5 2017-04-13 05:33:29 +00:00
Stanislav Shwartsman
1a3ff4b438 fixed bogus error message 2017-04-11 18:35:17 +00:00
Volker Ruppert
37b7b303a4 Regenerated after release. 2017-04-09 19:50:07 +00:00
Volker Ruppert
089505a5ac Updated after release 2.6.9. 2017-04-09 19:49:37 +00:00
Volker Ruppert
a1c14b2026 Regenerated for release. 2017-04-09 06:46:13 +00:00
Volker Ruppert
40c007e1fc Preparing release 2.6.9 2017-04-09 06:45:39 +00:00
Volker Ruppert
d828741b5b Fixes for building release packages (added missing 'bxhub' entries). 2017-04-08 10:21:09 +00:00
Volker Ruppert
a07b599304 Documentation updates.
- Added FAQ entry about Bochs on mobile devices.
- Some updates in the SB16 documentation.
2017-04-04 19:56:37 +00:00
Volker Ruppert
fbb94de3a3 SDL/SDL2 guis: Always use SDL specific byteorder macros here. This shouldn't
make a difference, but who knows?
2017-04-04 17:57:44 +00:00
Volker Ruppert
100b097c29 Added symbol BX_GUI_CONFIRM_QUIT to enable showing the dialog after pressing
the power button (disabled by default).
2017-04-02 16:16:53 +00:00
Volker Ruppert
12679aeb13 Updated cpu model list in the docs. 2017-04-02 15:43:48 +00:00
Volker Ruppert
ed92dc4dfd Code cleanup: We don't need to copy data here. 2017-04-02 14:01:40 +00:00
Volker Ruppert
912d104a63 Android updates from lubomyr GIT repository (instructions and app settings). 2017-04-02 09:05:21 +00:00
Volker Ruppert
f7b1d77136 Fixed keypad event reporting.
FIXME: Keypad mouse function fails (cannot enable it as removable mouse yet).
2017-04-02 08:47:14 +00:00
Volker Ruppert
bd77824db6 Store configuration and interface values in the USB device object. 2017-04-01 10:35:38 +00:00
Stanislav Shwartsman
bad84e48cd remove redundant memory access from IRET 2017-04-01 05:49:01 +00:00
Volker Ruppert
e023b5896f Partial rewrite of the optional keyboard handling. Now the BX_KEY_* events are
directly sent to the optional keyboard (USB keypad). It is now independent
from the legacy keyboard and the check for supported keys is simplified. The
legacy keyboard still receives the unhandled key event, but now sent from the
common devices code.
2017-03-31 21:32:58 +00:00
Stanislav Shwartsman
e351aaa28a update (c) for tlb.h 2017-03-31 07:34:44 +00:00
Stanislav Shwartsman
a51eb1cc39 added more debug info for TLB through param tree, update year in the (c) 2017-03-31 07:34:08 +00:00
Stanislav Shwartsman
c9c3672509 allow monitor to UC memory type but not MONITORX 2017-03-31 07:00:36 +00:00
Stanislav Shwartsman
566a7aa82b fixed softfloat FUZ condition. fixed/optimized pmaddwd computing function 2017-03-30 22:11:38 +00:00
Stanislav Shwartsman
a6e7ffb284 implemented undefined flags behavior for SHRD instruction matching HW 2017-03-30 22:03:38 +00:00
Stanislav Shwartsman
097310cd00 fixed integer overflow while computing shift flags, avoid using bx_bool while working with flags for more robust code 2017-03-30 21:53:39 +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
cb33607004 Split configure options table into 3 tables (general, cpu, devices) and some
other documenation updates.
2017-03-28 21:13:05 +00:00
Stanislav Shwartsman
862e817884 fixed typo caused compilation err 2017-03-28 19:13:20 +00:00
Stanislav Shwartsman
31d29734d6 some comments about more CPUID leaf 80000008.EBX by Ryzen 2017-03-28 19:11:42 +00:00
Stanislav Shwartsman
b7b0165d3c new naming convention for UD opcodes 2017-03-28 19:00:00 +00:00
Stanislav Shwartsman
a673612784 fixed permission checks performed by CLFLUSH/CLFLUSHOPT/MONITOR* instructions 2017-03-28 18:52:53 +00:00
Volker Ruppert
4bbed47b5d THe ACPI device can use the base class pci_read_handler().
Minor other PCI code changes.
2017-03-27 19:38:37 +00:00
Stanislav Shwartsman
e5c64b3b56 cleanup of warning messages from cpuid code 2017-03-26 20:12:14 +00:00
Stanislav Shwartsman
2b79061127 Implemented MONITORX/MWAITX instructions (AMD), enabled in Ryzen CPU model 2017-03-26 19:14:15 +00:00
Volker Ruppert
dd2d03ec0a The 'del' command doesn't like forward slashes, so the MSVC nmake 'clean'
target skipped files in subfolders. Updated cpu makefile dependencies.
2017-03-26 15:55:57 +00:00
Volker Ruppert
76b54ecb61 Renamed bx_pci_device_stub_c to bx_pci_device_c and derive it now from class
bx_devmodel_c. The early version of the combined vga / svga_cirrus code
required the now obsolete implementation. Some related cleanups in the
devices code.
2017-03-26 08:09:28 +00:00
Stanislav Shwartsman
411ea954b4 implemented CLZERO instruction from AMD Ryzen CPU 2017-03-25 20:12:31 +00:00
Volker Ruppert
880564f6ee Revoved obsolete macros and device stub methods. 2017-03-25 15:23:29 +00:00
Volker Ruppert
d46a9b7205 Some work on the PCI devices code.
- Since the pci_read_handler() method is identical in most devices, move it
  to the base class to reduce code duplication. Only the 'pcidev' device has
  it's own implementation (NOTE: it is not maintained yet).
- Minor other fixes and cleanups in some PCI devices.
2017-03-24 19:57:25 +00:00
Volker Ruppert
bc1b1d4ed5 Continued release preparations:
- Using bochsrc option "load32bitOSImage" now causes a warning. It is not
  maintained yet, not documented and we don't whether it is used or not.
  I guess it was designed to boot a real 32-bit guest OS when the Bochs BIOS
  wasn't able to do it.
- Added config option --enable-busmouse to all shortcut scripts. We have two
  usable models present now (tested with Win95).
2017-03-24 18:23:07 +00:00
Volker Ruppert
f1e90c93b1 Fixed incorrect PAM setup (caused recent SeaBIOS to fail). 2017-03-23 22:44:20 +00:00
Volker Ruppert
994fdbae82 Some cleanups in in the user documentation and the code (obsolete stuff). 2017-03-23 19:09:37 +00:00
Volker Ruppert
f0afd30a9a Fixed Cirrus VGA PCI save/restore when a standard VGA mode is active. The PCI
memory setup doesn't depend on the mode and must always be done after restore.
2017-03-22 21:24:30 +00:00
Volker Ruppert
fef9a3b3f7 Some release preparations:
- Added warnings for currently not maintained features in the configure script,
  the bochsrc sample and the user doc.
- Removed detection of deprecated bochsrc options "i440fxsupport" and
  "vga_update_interval".
- Legacy bochsrc option "user_shortcut" is now deprecated.
- Removed deprecated configure option --enable-misaligned-sse from user doc.
- Updated some TODO items.
2017-03-21 20:12:07 +00:00
Volker Ruppert
a78cb399ac Started preparing documentation for release (to be continued). 2017-03-20 20:56:54 +00:00
Volker Ruppert
8c310f68e1 Documentation updates.
- Added section about the 'socket' networking module.
- Updated and sorted lists of installed files on Windows and Linux.
- Fixed bxhub help message.
2017-03-19 19:08:15 +00:00
Volker Ruppert
df6adaaf1f Added symbol VSIDE in the MSVC workspace files and and the manifest section
of win32res.rc to compile Bochs correctly with both IDE and nmake.
Fixed MSVC warnings in some devices.
2017-03-19 12:22:27 +00:00
Volker Ruppert
9bef555f3e Updated build test script and fixed compilation without FPU. 2017-03-19 09:50:16 +00:00
Volker Ruppert
640f5e2ce9 Fixed compilation error. 2017-03-19 07:26:56 +00:00
Stanislav Shwartsman
2c5588cda0 convert some defines to enums and consts 2017-03-18 21:25:06 +00:00
Stanislav Shwartsman
de7aa70c23 fixed more warning from msvc 2017-03-18 19:28:02 +00:00
Volker Ruppert
23c1263849 Updated MSVC workspace files to compile default setup with current SVN.
FIXME: When using these workspace files it is currently required to disable
the manifest entry in win32res.rc.
2017-03-18 15:49:00 +00:00
Volker Ruppert
a24041d58a Updated devices list. 2017-03-18 09:40:20 +00:00
Volker Ruppert
8e0ea486c9 Reverted 'clean' target optimization. MinGW/MSYS uses targets without ".exe",
but for removing files the extension is required.
2017-03-18 09:27:48 +00:00
Stanislav Shwartsman
2809e7f5ad fixed warnings in the cpu code 2017-03-18 07:32:17 +00:00
Stanislav Shwartsman
c24d5bfa94 fixed warning (and also potential bug when >4G of mem is emulated) for USB code 2017-03-18 07:26:26 +00:00
Volker Ruppert
29e9b54cfd Added dummy waveout class to make sure that resampling and mixing features
are not used. It also fixes a possible crash in the speaker code.
2017-03-17 23:09:18 +00:00
Volker Ruppert
0ac2150920 Network and sound driver plugins are no devmodel devices. 2017-03-17 20:53:31 +00:00
Stanislav Shwartsman
15d9b068a3 fix msvc warnings 2017-03-17 17:35:15 +00:00
Volker Ruppert
78f51adf42 Updated default MSVC workspace to compile default setup with current SVN.
TODO: Update plugins workspace.
2017-03-17 16:05:46 +00:00
Stanislav Shwartsman
99bfbdf139 add xss exiting bitmap to save/restore 2017-03-16 20:23:49 +00:00
Stanislav Shwartsman
3f80447a10 fixed compilation err with x86-64 disabled 2017-03-16 20:13:42 +00:00
Stanislav Shwartsman
be4c6c7ae5 SMAP opcodes are No-SSE-Prefix 2017-03-16 16:20:58 +00:00
Stanislav Shwartsman
172b0106ac imvent a bochs feature for AMD TCE and enable EFER.TCE bit 2017-03-15 22:52:08 +00:00
Stanislav Shwartsman
6edf22e754 finally figured out what TCE means in AMD CPUID - and it has EFER.TCE bit related to it 2017-03-15 22:48:27 +00:00
Stanislav Shwartsman
ebbf8f9e0f adjustments in AMD Ryzen CPUID 2017-03-15 22:14:10 +00:00
Stanislav Shwartsman
3a033fa6db implemented xsaves/xrstors extensions (supported by Intel Skylake core and AMD Ryzen) 2017-03-15 21:44:15 +00:00
Volker Ruppert
8796abeea6 Some fixes in the build system.
- Makefile: cleanup of the 'clean' target (adds missing 'bxhub').
- configure script: create cpudb subdirectories if necessary for building
  outside of the source tree.
- cpudb Makefile: clean object files from new location.
2017-03-15 16:51:32 +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
Stanislav Shwartsman
c0701a6d42 fixup for Ryzen cpuid 2017-03-13 20:23:39 +00:00
Stanislav Shwartsman
f4ebaa4846 update CHANGES 2017-03-13 20:06:26 +00:00
Stanislav Shwartsman
06518e3af9 announce AMD Ryzen CPUID in CHANGES 2017-03-13 20:05:07 +00:00
Stanislav Shwartsman
402e2cfad0 move cpuid warning messages to base cpuid class - reduce code cleanup 2017-03-13 19:59:48 +00:00
Stanislav Shwartsman
07166f14b7 reorg of cpudb folder, added AMD Ryzen CPUID placeholder module (still not 100% correct) 2017-03-13 19:44:14 +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
d73284442f Updated makefile dependencies. 2017-03-10 19:01:11 +00:00
Stanislav Shwartsman
be235c1809 fixed compilation err under cygwin 2017-03-09 21:29:21 +00:00
Stanislav Shwartsman
980eaa7937 move cpuid leaf 80000008 to base bx_cpuid_t class to remove code dupolication 2017-03-09 21:25:18 +00:00
Volker Ruppert
30a20ba50f Fixed compilation errors on Windows. 2017-03-08 22:09:50 +00:00
Volker Ruppert
0d4cba9744 Updated changes. 2017-03-08 16:18:52 +00:00
Volker Ruppert
a037c74071 Added support for connecting the 'bxhub' utility running on another machine.
The format of the 'ethdev' string must be 'host:port' to use this feature.
Using the port number only for connecting 'bxhub' on the same machine is still
supported.
2017-03-07 19:20:35 +00:00
Volker Ruppert
ffb9ef3476 For each WSAStartup() we have to call WSACleanup() on exit. 2017-03-06 21:30:05 +00:00
Volker Ruppert
e67493c58e Some work on the bxhub code.
- Prepared bxhub for connections from other machines.
- Added missing WSACleanup() for Windows.
- TODO: Support for other machines in eth_socket.cc.
2017-03-06 19:00:52 +00:00
Volker Ruppert
a198c01aa9 Some changes in the serial port mode handling.
- Small changes to avoid crash after failure.
- Several cleanups in the socket mode.
- Fixed reporting active mode after init is done.
- Reporting sent/received byte with BX_DEBUG.
2017-03-05 12:45:45 +00:00
Volker Ruppert
c756fed13e Fixed and simplified default IP address generation. 2017-03-04 13:32:41 +00:00
Volker Ruppert
e08024f6a1 Some work on the networking modules and documentation.
- The 'vnet' module now uses the 'script' parameter for an alternative log
  file name.
- Renamed log file names in some networking modules (replaced 'ne2k' by a name
  related to the module name).
- Documentation updates (networking stuff and cmosimage).
2017-03-04 10:26:22 +00:00
Volker Ruppert
e9495af59a Set up VGA palette entries for gui console to make sure the text is visible. 2017-03-03 12:43:20 +00:00
Volker Ruppert
112e9016c2 Some changes in bxhub and related code.
- Increase maximum number of Bochs client sessions to 6.
- Define bx_devmodel_c to 'void' for the bxhub case to simplify netmod code.
- Minor cleanups in bxhub and related vnet code.
2017-03-03 09:56:18 +00:00
Volker Ruppert
00e140f626 Minor IOAPIC changes.
- According to the specs masked edge-sensitive IRQs are not held pending.
- Print BX_DEBUG message in set_irq_level() only in case of level change to
  avoid flooding log file.
2017-03-03 09:06:47 +00:00
Volker Ruppert
9b0abda1f5 Recompiled after MP table fix. 2017-03-02 18:39:35 +00:00
Volker Ruppert
3fe496a3ff Fixed MP config table entry count and added some comments. 2017-03-02 18:38:48 +00:00
Volker Ruppert
06511be14d Added support for up to 4 connections to Bochs sessions (same machine only). 2017-03-02 10:21:14 +00:00
Volker Ruppert
0011092ddb Some work on the eth_vnet and bxhub code to reduce code duplication. Moved some
shared functions to netmod.cc and modified ARP, IPv4 and ICMP code.
2017-03-01 16:53:57 +00:00
Volker Ruppert
b25d050676 Some changes in the socket networking module for Windows compatibility.
- eth_socket.cc: Added missing winsock init.
- bxhub.cc: Added missing CDECL macro to the signal handler.
- Added some definitions for non-Windows platforms similar to the serial and
  rfb code.
2017-02-28 16:52:15 +00:00
Volker Ruppert
f17107957c Added signal handler to terminate bxhub correctly at CTRL+C. 2017-02-28 12:40:39 +00:00
Volker Ruppert
027b3ffd41 Some work on the 'socket' networking module.
- bxhub.cc: Put all client data in a structure and added send_packet() function.
- bxhub.cc: Added SVN ID line.
- netmod.cc: Changed some DHCP messages to BX_DEBUG.
- eth_socket.cc: Minor cleanups.
2017-02-28 10:18:15 +00:00
Volker Ruppert
d6166344eb Added ethernet module 'socket'. designed to connect two Bochs instances with
external program 'bxhub' (simulating a two port ethernet hub). It is based on
an old SF patch and it has been updated and extended:
- Windows support (tested with MinGW/MSYS and MSVC nmake).
- Command line arguments for 'bxhub' (base port number, MAC address, TFTP).
- Added support for DHCP, TFTP, ARP and ICMP echo (ping). It uses parts of the
  code for the 'vnet' module with some additions from the former "slirp backend".
- TODO: code cleanup to reduce duplication, rewrite of the networking plugins
  stuff similar to the work done with the sound drivers.
2017-02-27 22:26:43 +00:00
Volker Ruppert
5366be7030 USB HID devices need to support "clear EP halt" (tested with Win98SE). 2017-02-24 20:19:00 +00:00
Volker Ruppert
a5dc4b050c Fixed compilation with plugins enabled and removed obsolete declaration. 2017-02-24 20:02:18 +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
d501190b73 Minor cleanups in the common sound driver code. 2017-02-23 16:53:17 +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
8310d4f448 Fixed sound plugins support for MSVC
- Added special symbols required for building MSVC plugin DLLs.
- Updated plugin DLL list in makefile.
2017-02-20 22:19:44 +00:00
Volker Ruppert
cd90506fb0 Forgot to remove renamed files. 2017-02-20 18:24:35 +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
ff43979e08 Fixed compilation when using a config with the win32 gui only. 2017-02-20 18:18:44 +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
4502478b50 Changed a lot of malloc() / free() calls to C++ style new / delete. 2017-02-18 11:13:56 +00:00
Volker Ruppert
67896c66ae Recompiled after adding "fastboot" option. 2017-02-16 21:45:07 +00:00
Volker Ruppert
a53b99f5e1 Implemented Bochs BIOS option "fastboot" for skipping the boot menu delay.
Prepared "biosdetect" option in the harddrv code.
TODO #1: Add support for a comma-separated list of BIOS options.
TODO #2: Implement support for at least "biosdetect=none" in the Bochs BIOS.
2017-02-16 21:43:52 +00:00
Volker Ruppert
90dc39eda7 Abort "format track" command if cylinder is out of range to avoid resizing
floppy disk image.
2017-02-15 22:27:34 +00:00
Volker Ruppert
19b98b1145 Simplified code for the "optromimage" and "optramimage" options stuff (saving
configuration, loading images). Cleaned up "romimage" option parsing and
prepared parameter "options" for the behaviour of the Bochs BIOS.
TODO: implement BIOS option "fastboot" to skip the boot menu prompt.
2017-02-14 20:11:58 +00:00
Volker Ruppert
756fde6267 Simplified code for saving BIOS and VGABIOS image configuration. 2017-02-13 21:14:34 +00:00
Volker Ruppert
135d64cb1f Fixed outdated prompt for floppy images. 2017-02-12 16:51:52 +00:00
Volker Ruppert
35a19e4777 Fixed reading extended memory size from CMOS. 2017-02-11 08:53:17 +00:00
Volker Ruppert
f2abe7c033 Fixed reading extended memory size from CMOS. 2017-02-11 08:53:00 +00:00
Volker Ruppert
72b2de2799 Clear DRQ line or NDMA mode bit if write command fails due to write protected
media (fixes SF bug #1338).
2017-02-10 21:28:05 +00:00
Volker Ruppert
0d3b5a129c Print a more detailed list of available hardware on top of the log file. 2017-02-10 19:38:44 +00:00
Volker Ruppert
02b6de6a61 Added byte/word reference macro to produce optimal code and understand
(SF patch #533 by Yeong-uk Jo).
2017-02-10 18:29:00 +00:00
Volker Ruppert
5c50ae9ccc Added byte/word reference macro to produce optimal code and understand
(SF patch #533 by Yeong-uk Jo).
2017-02-10 18:28:34 +00:00
Volker Ruppert
6c1e518044 Updated sound option documentation. 2017-02-09 18:23:36 +00:00
Volker Ruppert
f971dccddb Implemented SDL2 "wavein" service (Audio capture support is new in SDL 2.0.5
and does not yet work on all platforms).
2017-02-08 18:48:49 +00:00
Volker Ruppert
0b47bdd416 Fixed compilation on MSVC (define symbol O_ACCMODE if necessary). 2017-02-07 22:32:30 +00:00
Volker Ruppert
69dcf1c253 Fixed display in 8 bpp modes with doublescan enabled (fixes "Doom" on Win95). 2017-02-07 17:02:52 +00:00
Volker Ruppert
f844e846b7 Added PCM output data resampling in a separate thread. The resampler requires
either libsamplerate or the SoX resampler library installed. If not installed,
the data is only copied to the output buffer and sample rate of the output
driver is changed similar to legacy code. Related changes:
- Added check for libsamplerate or SoX resampler header files in configure
  script.
- Added functions for converting source format to float (requied by resampler)
  and float to output format.
- Added support for float type data in the audio buffer code. Buffer chain #0
  receives float data from sendwavepacket() and buffer #1 receives data for
  mixing and output in format "16-bit signed little endian stereo".
- ALSA: Disable builtin resampling feature if resampler is present to avoid
  doing it twice.
2017-02-05 08:33:03 +00:00
Volker Ruppert
59c828f3d3 Updated devices tree. 2017-02-01 22:03:38 +00:00
Volker Ruppert
3de865c753 Initialize 'pathname' pointer with NULL to avoid crash. 2017-01-30 22:09:13 +00:00
Volker Ruppert
7fd9194d81 Implemented lock mechanism for hard disk images (fixes SF bug #605).
- Create a file with image name plus extension ".lock" if an image is opened
  in read/write mode. This file will be deleted after closing the image.
- Check for a lock file before opening an image and fail if it exists.
- Check for a lock file before creating a undoable/volatile redolog file and
  fail if it exists.
2017-01-30 19:08:37 +00:00
Volker Ruppert
124f521797 Added support for changing the USB printer output file at runtime. 2017-01-29 08:48:08 +00:00
Volker Ruppert
eb48d0698a Updated user plugin example. 2017-01-28 20:31:18 +00:00
Stanislav Shwartsman
8664f8f21e add vex.w into bxInstruction to be used in disasm 2017-01-28 19:25:30 +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
65dc62883c Added symbol to fix the compilation of MSVC plugins. 2017-01-28 00:22:28 +00:00
Volker Ruppert
453991c437 Try opening output file only once to avoid flooding log file. 2017-01-27 16:53:59 +00:00
Volker Ruppert
ccdcb9cd1b Serial 'file' mode: added support for changing output file at runtime. 2017-01-27 16:20:04 +00:00
Volker Ruppert
c1c158c0a2 Added support for changing output file at runtime.
TODO: Do the same for the serial port 'file' mode and the USB printer.
2017-01-26 20:23:13 +00:00
Volker Ruppert
f59eaa2602 Simplified immediate shutdown code by using BX_FATAL. 2017-01-24 21:52:19 +00:00
Stanislav Shwartsman
49c537521a simplify disasm code by splitting it into functions 2017-01-22 19:53:42 +00:00
Volker Ruppert
d0fbfb7d92 Checking the presence of the ACPI plugin makes the error message work again. 2017-01-15 13:31:11 +00:00
Volker Ruppert
628d9db140 X11 gui code cleanup
- Changed the order of functions and methods and added some useful comments.
- TODO: Do the same with the code of other guis if necessary.
2017-01-15 12:57:06 +00:00
Volker Ruppert
1546c8803b Bochs gui code cleanup
- Only keep the comments for the specific gui methods in nogui.cc and add
  references to this file in all other gui sources.
- Changed the order of methods and added some useful comments in gui.cc / gui.h.
- Minor other cleanups
2017-01-15 11:44:43 +00:00
Volker Ruppert
ffd7c4c492 Using names different from "classic" Bochs headerbar fixes compilation and
win32 specific toolbar handling.
2017-01-14 15:11:14 +00:00
Volker Ruppert
787307790f Moved event processing of the "classic" Bochs headerbar to the common gui code
and modified the gui code of rfb, sdl, sdl2, vncsrv and x to use it.
2017-01-14 13:10:20 +00:00
Volker Ruppert
5cd321dd02 Enabled gui console support for sdl2 using SDL_TEXTINPUT event. 2017-01-13 21:37:06 +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
6cf6f6967a Fixed cpu "make clean" target. 2017-01-13 16:13:42 +00:00
Volker Ruppert
f18bb743be Added new symbol BX_USE_GUI_CONSOLE and set it to 1 for all guis with support
for the VGA to be used for textconfig at runtime.
2017-01-13 15:57:36 +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
Volker Ruppert
d7fd586451 In the save/restore handler change the display mode to "config". This fixes the
keyboard usage in the legacy sdl gui after saving state. Now the rfb and vncsrv
guis can also use this feature (dialog capabilities set to default).
2017-01-12 18:11:38 +00:00
Stanislav Shwartsman
af1d83f35d update (c) 2017-01-11 20:54:09 +00:00
Stanislav Shwartsman
521d2d10c4 correctly fixed x32 emu compilation err + bugfix for AVX decoder 2017-01-11 20:51:58 +00:00
Stanislav Shwartsman
72e5213ff4 compilation fix and code simplifcation 2017-01-11 19:12:06 +00:00
Volker Ruppert
28d43a91a6 On Windows only use the runtime config dialog box if the gui console is not
enabled. The rfb and vncsrv guis show the textconfig console instead.
2017-01-10 21:40:05 +00:00
Stanislav Shwartsman
90c4cb31c5 add SVN header to newly added files 2017-01-10 20:16:24 +00:00
Stanislav Shwartsman
10eb193e01 step 1 of rewrite Bochs decoder: legacy decoder tables done. TODO: avx/evex decoder tables, merge decoder and disasm together 2017-01-10 20:15:17 +00:00
Volker Ruppert
9916e37819 The configure script now generates makefile for user plugins if directory
exists. Updated the user plugins example patch.
2017-01-08 09:34:19 +00:00
Volker Ruppert
111158750d Added gui console support to the legacy SDL gui.
TODO: Implement this feature in SDL2 (needs special keyboard handling).
2017-01-07 10:11:57 +00:00
Volker Ruppert
ff776d7c3a Some work on the gui console support for the text runtime configuration.
- Added gui console support to the rfb and vncsrv guis.
- Started preparing the legacy SDL gui for console support.
- TODO: The sdl and sdl2 guis need a special keyboard handling for shifted keys.
2017-01-05 18:20:47 +00:00
Volker Ruppert
48ae057bc9 Some work on the SDL2 gui
- Added support for get/set clipboard text.
- Continued preparing SDL2 gui for console support (TODO: keyboard input).
2017-01-04 22:24:33 +00:00
Volker Ruppert
8e2803f98a Bochs gui code cleanup
- Moved helper function reverse_bitorder to the common gui code.
- In console_refresh() call flush() after text_update().
- Started preparing rfb, sdl, sdl2 and vncsrv gui for using the console.
- Some other small cleanups.
2017-01-03 20:59:59 +00:00
Volker Ruppert
c0f6caa03b Some work on the gui console support for the text runtime configuration.
- vncserv.cc: Fixed sdl font issue.
- Don't check for mouse toggle event if console is active.
- Added support for blinking cursor.
- Added stubs in the gui code to reduce BX_USE_TEXTCONIG usage in x.cc.
2017-01-02 19:11:23 +00:00
Volker Ruppert
5f5f40e3d6 Changing data type sdl fonts to "static const Bit8u" fixes conflict and
simplifies code. The gui code only needs the sdl font for the VGA console.
2017-01-01 19:37:26 +00:00
Volker Ruppert
eff3664fec Implemented VGA console support in the common gui code and the X11 specific
code. Now the runtime configuration runs in the Bochs window instead of
console / xterm. The simulation screen is restored when the
simulation continues. This feature can be implemented for all guis
without gui dialog box support (e.g. sdl2/sdl2 on non-win32 platforms, rfb).
2017-01-01 17:45:06 +00:00
Volker Ruppert
ab20fa1bc2 The USB EHCI and xHCI emulations are now almost stable, so we can remove
"experimental" from description and add them to the shortcut scripts.
2016-12-31 12:17:37 +00:00
Volker Ruppert
21eda8453a Forgot to update changes. 2016-12-30 10:16:33 +00:00
Volker Ruppert
400704d038 Added macro BX_FATAL() that works like BX_PANIC(), but with hardcoded action
"fatal". It can be used for all cases when there is no workaroud present to
avoid application crash or incorrect simulation behaviour. As a first step now
using BX_FATAL() for some data structure size and bit field errors.
2016-12-30 10:04:06 +00:00
Volker Ruppert
90597c2e61 X11 message box dialog rewritten to use it for both the ask dialog and the
yes/no dialog. The ask dialog function now also handles the "warn" and "quit"
cases.
2016-12-29 23:36:15 +00:00
Volker Ruppert
7eee83a1d9 Some work on the logio code.
- Show message box (modified ask dialog) in method fatal() if not called after
  ask dialog or pressing power button.
- Removed code for unsupported actions "ask" and "fatal" from info() method.
- Some related small code cleanups.
2016-12-29 17:22:46 +00:00
Volker Ruppert
b9b9082e86 Rewrite of the "ask" and "warn" dialog framework.
- Added new symbol BX_SYNC_EVT_LOG_DLG and method log_dlg() in siminterface to
  handle the cases "ask", "warn" and "quit".
- Added support to change action from "warn" to "report in the "warn" dialog
  (sdl2, win32 and wx).
- TODO: Add quit message box for the log action "fatal" and add BX_FATAL()
  macro for all cases where continuing after BX_PANIC would be dangerous.
2016-12-29 09:47:07 +00:00
Volker Ruppert
da3b273c04 Documentation updates (USB EHCI, log action 'warn' and related stuff). 2016-12-28 20:05:19 +00:00
Stanislav Shwartsman
9fca141504 update cpu CHANGES 2016-12-28 19:10:50 +00:00
Volker Ruppert
925f53fb41 Added new log action "warn", designed to show a message box on error events.
- Added new logfunctions method warn() similar to ask().
- Added new siminterface method log_warn() similar to log_ask().
- Modified sdl2, wx and win32 ask dialog to make it usable for warnings.
- On X11 use the new message box dialog to display warnings.
- Some related changes in the logio and siminterface code.
2016-12-28 15:17:10 +00:00
Volker Ruppert
85fcabbd8f diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/bochs.h ./bochs.h
--- /home/volker/bochs/bochs/bochs.h	2016-08-12 19:06:18.803209189 +0200
+++ ./bochs.h	2016-12-28 00:41:20.000627252 +0100
@@ -2,7 +2,7 @@
 // $Id: bochs.h 12935 2016-08-12 17:06:14Z vruppert $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2001-2015  The Bochs Project
+//  Copyright (C) 2001-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -276,8 +276,9 @@
   void error(const char *fmt, ...)  BX_CPP_AttrPrintf(2, 3);
   void panic(const char *fmt, ...)  BX_CPP_AttrPrintf(2, 3);
   void ldebug(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
-  void fatal (const char *prefix, const char *fmt, va_list ap, int exit_status);
-  void ask (int level, const char *prefix, const char *fmt, va_list ap);
+  void fatal(const char *prefix, const char *fmt, va_list ap, int exit_status);
+  void warn(int level, const char *prefix, const char *fmt, va_list ap);
+  void ask(int level, const char *prefix, const char *fmt, va_list ap);
   void put(const char *p);
   void put(const char *n, const char *p);
   void setio(class iofunctions *);
@@ -334,7 +335,8 @@
   void set_log_action(int loglevel, int action);
   const char *getlevel(int i) const;
   const char *getaction(int i) const;
-  
+  int isaction(const char *val) const;
+
 protected:
   int n_logfn;
 #define MAX_LOGFNS 512
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/CHANGES ./CHANGES
--- /home/volker/bochs/bochs/CHANGES	2016-12-26 10:45:44.000000000 +0100
+++ ./CHANGES	2016-12-28 15:54:25.127088081 +0100
@@ -1,5 +1,8 @@
 Changes after 2.6.8 release:
 
+- General
+  - Added new log action "warn", designed to show a message box on error events.
+
 - Configure and compile
   - Added Android host platform support.
 
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/config.cc ./config.cc
--- /home/volker/bochs/bochs/config.cc	2016-05-03 21:15:09.158016000 +0200
+++ ./config.cc	2016-12-27 19:53:10.461420368 +0100
@@ -2062,15 +2062,8 @@
     actstr = strtok(NULL, "");
     if (actstr != NULL) {
       def_action = !strcmp(module, "action");
-      if (!strcmp(actstr, "fatal"))
-        action = ACT_FATAL;
-      else if (!strcmp (actstr, "report"))
-        action = ACT_REPORT;
-      else if (!strcmp (actstr, "ignore"))
-        action = ACT_IGNORE;
-      else if (!strcmp (actstr, "ask"))
-        action = ACT_ASK;
-      else {
+      action = SIM->is_action_name(actstr);
+      if (action < ACT_IGNORE) {
         PARSE_ERR(("%s: %s directive malformed.", context, params[0]));
         free(param);
         return -1;
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/sdl2.cc ./gui/sdl2.cc
--- /home/volker/bochs/bochs/gui/sdl2.cc	2016-08-12 19:06:18.811209142 +0200
+++ ./gui/sdl2.cc	2016-12-28 12:33:39.534288819 +0100
@@ -2,7 +2,7 @@
 // $Id: sdl2.cc 12935 2016-08-12 17:06:14Z vruppert $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2014-2015  The Bochs Project
+//  Copyright (C) 2014-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -1478,20 +1478,16 @@
   SDL_MessageBoxData msgboxdata;
   SDL_MessageBoxButtonData buttondata[4];
   int level, retcode;
-#if BX_DEBUGGER || BX_GDBSTUB
-  int defbtn = 3;
-#else
-  int defbtn = 2;
-#endif
   char message[512];
 
   level = event->u.logmsg.level;
-  sprintf(message, "%s %s", event->u.logmsg.prefix, event->u.logmsg.msg);
+  sprintf(message, "Device: %s\nMessage: %s", event->u.logmsg.prefix,
+          event->u.logmsg.msg);
   msgboxdata.flags = SDL_MESSAGEBOX_ERROR;
   msgboxdata.window = window;
   msgboxdata.title = SIM->get_log_level_name(level);
   msgboxdata.message = message;
-  msgboxdata.numbuttons = defbtn + 1;
+  msgboxdata.numbuttons = 2;
   msgboxdata.buttons = buttondata;
   msgboxdata.colorScheme = NULL;
   buttondata[0].flags = 0;
@@ -1500,14 +1496,18 @@
   buttondata[1].flags = 0;
   buttondata[1].buttonid = BX_LOG_ASK_CHOICE_CONTINUE_ALWAYS;
   buttondata[1].text = "Alwayscont";
+  if (event->u.logmsg.flag == BX_LOG_ASK_ASKDLG) {
+    msgboxdata.numbuttons = 3;
+    buttondata[2].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
+    buttondata[2].buttonid = BX_LOG_ASK_CHOICE_DIE;
+    buttondata[2].text = "Quit";
 #if BX_DEBUGGER || BX_GDBSTUB
-  buttondata[2].flags = 0;
-  buttondata[2].buttonid = BX_LOG_ASK_CHOICE_ENTER_DEBUG;
-  buttondata[2].text = "Debugger";
-#endif
-  buttondata[defbtn].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
-  buttondata[defbtn].buttonid = BX_LOG_ASK_CHOICE_DIE;
-  buttondata[defbtn].text = "Quit";
+    msgboxdata.numbuttons = 4;
+    buttondata[3].flags = 0;
+    buttondata[3].buttonid = BX_LOG_ASK_CHOICE_ENTER_DEBUG;
+    buttondata[3].text = "Debugger";
+#endif
+  }
   if (SDL_ShowMessageBox(&msgboxdata, &retcode) < 0) {
     return -1;
   } else {
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/siminterface.cc ./gui/siminterface.cc
--- /home/volker/bochs/bochs/gui/siminterface.cc	2016-12-05 19:56:56.729685000 +0100
+++ ./gui/siminterface.cc	2016-12-28 11:14:02.004075717 +0100
@@ -2,7 +2,7 @@
 // $Id: siminterface.cc 12981 2016-12-05 18:56:56Z sshwarts $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2002-2015  The Bochs Project
+//  Copyright (C) 2002-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -100,6 +100,7 @@
   virtual int get_log_action(int mod, int level);
   virtual void set_log_action(int mod, int level, int action);
   virtual const char *get_action_name(int action);
+  virtual int is_action_name(const char *val);
   virtual int get_default_log_action(int level) {
     return logfunctions::get_default_action(level);
   }
@@ -123,6 +124,7 @@
   virtual void set_notify_callback(bxevent_handler func, void *arg);
   virtual void get_notify_callback(bxevent_handler *func, void **arg);
   virtual BxEvent* sim_to_ci_event(BxEvent *event);
+  virtual int log_warn(const char *prefix, int level, const char *msg);
   virtual int log_ask(const char *prefix, int level, const char *msg);
   virtual void log_msg(const char *prefix, int level, const char *msg);
   virtual void set_log_viewer(bx_bool val) { bx_log_viewer = val; }
@@ -420,6 +422,11 @@
   return io->getaction(action);
 }
 
+int bx_real_sim_c::is_action_name(const char *val)
+{
+  return io->isaction(val);
+}
+
 const char *bx_real_sim_c::get_log_level_name(int level)
 {
   return io->getlevel(level);
@@ -575,6 +582,21 @@
   }
 }
 
+int bx_real_sim_c::log_warn(const char *prefix, int level, const char *msg)
+{
+  BxEvent be;
+  be.type = BX_SYNC_EVT_LOG_ASK;
+  be.u.logmsg.prefix = prefix;
+  be.u.logmsg.level = level;
+  be.u.logmsg.msg = msg;
+  be.u.logmsg.flag = BX_LOG_ASK_MSGBOX_WARN;
+  // default return value in case something goes wrong.
+  be.retcode = BX_LOG_NOTIFY_FAILED;
+  // calling notify
+  sim_to_ci_event(&be);
+  return be.retcode;
+}
+
 // returns 0 for continue, 1 for alwayscontinue, 2 for die.
 int bx_real_sim_c::log_ask(const char *prefix, int level, const char *msg)
 {
@@ -583,6 +605,7 @@
   be.u.logmsg.prefix = prefix;
   be.u.logmsg.level = level;
   be.u.logmsg.msg = msg;
+  be.u.logmsg.flag = BX_LOG_ASK_ASKDLG;
   // default return value in case something goes wrong.
   be.retcode = BX_LOG_NOTIFY_FAILED;
   // calling notify
@@ -1157,16 +1180,10 @@
             } else if (!strncmp(string, "PANIC=", 6)) {
               type = LOGLEV_PANIC;
             }
-            if (!strcmp(string+j, "ignore")) {
-              action = ACT_IGNORE;
-            } else if (!strcmp(string+j, "report")) {
-              action = ACT_REPORT;
-            } else if (!strcmp(string+j, "ask")) {
-              action = ACT_ASK;
-            } else if (!strcmp(string+j, "fatal")) {
-              action = ACT_FATAL;
+            action = is_action_name(string+j);
+            if (action >= ACT_IGNORE) {
+              set_log_action(dev, type, action);
             }
-            set_log_action(dev, type, action);
           } else {
             if (i == 1) {
               BX_ERROR(("restore_logopts(): log module '%s' not found", devname));
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/siminterface.h ./gui/siminterface.h
--- /home/volker/bochs/bochs/gui/siminterface.h	2016-03-31 19:24:37.451025427 +0200
+++ ./gui/siminterface.h	2016-12-28 11:11:21.036683362 +0100
@@ -168,6 +168,7 @@
 typedef enum {
   ACT_IGNORE = 0,
   ACT_REPORT,
+  ACT_WARN,
   ACT_ASK,
   ACT_FATAL,
   N_ACT
@@ -178,11 +179,11 @@
 // normally all action choices are available for all event types. The exclude
 // expression allows some choices to be eliminated if they don't make any
 // sense.  For example, it would be stupid to ignore a panic.
-#define BX_LOG_OPTS_EXCLUDE(type, choice)  (                           \
-   /* can't die or ask, on debug or info events */                     \
-   (type <= LOGLEV_INFO && (choice == ACT_ASK || choice == ACT_FATAL)) \
-   /* can't ignore panics */                                           \
-   || (type == LOGLEV_PANIC && choice == ACT_IGNORE)                   \
+#define BX_LOG_OPTS_EXCLUDE(type, choice)  (             \
+   /* can't die, ask or warn, on debug or info events */ \
+   (type <= LOGLEV_INFO && (choice >= ACT_WARN))         \
+   /* can't ignore panics */                             \
+   || (type == LOGLEV_PANIC && choice == ACT_IGNORE)     \
    )
 
 // floppy / cdrom media status
@@ -392,6 +393,7 @@
 // synchronizing threads, etc. for each.
 typedef struct {
   Bit8u level;
+  Bit8u flag;
   const char *prefix;
   const char *msg;
 } BxLogMsgEvent;
@@ -419,6 +421,12 @@
   BX_LOG_NOTIFY_FAILED
 };
 
+enum {
+  BX_LOG_ASK_ASKDLG,
+  BX_LOG_ASK_MSGBOX_WARN,
+  BX_LOG_ASK_MSGBOX_QUIT
+};
+
 // Event type: BX_SYNC_EVT_GET_DBG_COMMAND
 //
 // This is a synchronous event sent from the simulator to the debugger
@@ -675,6 +683,7 @@
   virtual int get_default_log_action(int level) {return -1;}
   virtual void set_default_log_action(int level, int action) {}
   virtual const char *get_action_name(int action) {return NULL;}
+  virtual int is_action_name(const char *val) {return -1;}
   virtual const char *get_log_level_name(int level) {return NULL;}
   virtual int get_max_log_level() {return -1;}
 
@@ -715,6 +724,9 @@
   // send an event from the simulator to the CI.
   virtual BxEvent* sim_to_ci_event(BxEvent *event) {return NULL;}
 
+  // called from simulator when it hits errors, to warn the user
+  // before continuing simulation
+  virtual int log_warn(const char *prefix, int level, const char *msg) {return -1;}
   // called from simulator when it hits serious errors, to ask if the user
   // wants to continue or not
   virtual int log_ask(const char *prefix, int level, const char *msg) {return -1;}
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/textconfig.cc ./gui/textconfig.cc
--- /home/volker/bochs/bochs/gui/textconfig.cc	2016-12-05 20:15:59.112637000 +0100
+++ ./gui/textconfig.cc	2016-12-28 12:44:43.079411258 +0100
@@ -2,7 +2,7 @@
 // $Id: textconfig.cc 12983 2016-12-05 19:15:59Z sshwarts $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2002-2013  The Bochs Project
+//  Copyright (C) 2002-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -552,8 +552,8 @@
 }
 
 static const char *log_options_prompt1 = "Enter the ID of the device to edit, or -1 to return: [-1] ";
-static const char *log_level_choices[] = { "ignore", "report", "ask", "fatal", "no change" };
-static int log_level_n_choices_normal = 4;
+static const char *log_level_choices[N_ACT+1] = { "ignore", "report", "warn", "ask", "fatal", "no change" };
+static int log_level_n_choices_normal = N_ACT;
 
 void bx_log_options(int individual)
 {
@@ -589,7 +589,7 @@
     bx_print_log_action_table();
     for (int level=0; level<SIM->get_max_log_level(); level++) {
       char prompt[1024];
-      int action, default_action = 4;  // default to no change
+      int action, default_action = N_ACT;  // default to no change
       sprintf(prompt, "Enter action for %s event on all devices: [no change] ", SIM->get_log_level_name(level));
       // do show the no change choice (choices=4)
       if (ask_menu(prompt, "", log_level_n_choices_normal+1, log_level_choices, default_action, &action)<0)
@@ -718,47 +718,50 @@
       event->retcode = event->u.param.param->text_ask(stdin, stderr);
       return event;
     case BX_SYNC_EVT_LOG_ASK:
-    {
-      int level = event->u.logmsg.level;
-      fprintf(stderr, "========================================================================\n");
-      fprintf(stderr, "Event type: %s\n", SIM->get_log_level_name (level));
-      fprintf(stderr, "Device: %s\n", event->u.logmsg.prefix);
-      fprintf(stderr, "Message: %s\n\n", event->u.logmsg.msg);
-      fprintf(stderr, "A %s has occurred.  Do you want to:\n", SIM->get_log_level_name (level));
-      fprintf(stderr, "  cont       - continue execution\n");
-      fprintf(stderr, "  alwayscont - continue execution, and don't ask again.\n");
-      fprintf(stderr, "               This affects only %s events from device %s\n", SIM->get_log_level_name (level), event->u.logmsg.prefix);
-      fprintf(stderr, "  die        - stop execution now\n");
-      fprintf(stderr, "  abort      - dump core %s\n",
-              BX_HAVE_ABORT ? "" : "(Disabled)");
+      if (event->u.logmsg.flag == BX_LOG_ASK_ASKDLG) {
+        int level = event->u.logmsg.level;
+        fprintf(stderr, "========================================================================\n");
+        fprintf(stderr, "Event type: %s\n", SIM->get_log_level_name (level));
+        fprintf(stderr, "Device: %s\n", event->u.logmsg.prefix);
+        fprintf(stderr, "Message: %s\n\n", event->u.logmsg.msg);
+        fprintf(stderr, "A %s has occurred.  Do you want to:\n", SIM->get_log_level_name (level));
+        fprintf(stderr, "  cont       - continue execution\n");
+        fprintf(stderr, "  alwayscont - continue execution, and don't ask again.\n");
+        fprintf(stderr, "               This affects only %s events from device %s\n", SIM->get_log_level_name (level), event->u.logmsg.prefix);
+        fprintf(stderr, "  die        - stop execution now\n");
+        fprintf(stderr, "  abort      - dump core %s\n",
+                BX_HAVE_ABORT ? "" : "(Disabled)");
 #if BX_DEBUGGER
-      fprintf(stderr, "  debug      - continue and return to bochs debugger\n");
+        fprintf(stderr, "  debug      - continue and return to bochs debugger\n");
 #endif
 #if BX_GDBSTUB
-      fprintf(stderr, "  debug      - hand control to gdb\n");
+        fprintf(stderr, "  debug      - hand control to gdb\n");
 #endif
 
-      int choice;
+        int choice;
 ask:
-      if (ask_menu("Choose one of the actions above: [%s] ", "",
-                   log_action_n_choices, log_action_ask_choices, 2, &choice) < 0)
-	event->retcode = -1;
-      // return 0 for continue, 1 for alwayscontinue, 2 for die, 3 for debug.
-      if (!BX_HAVE_ABORT && choice==BX_LOG_ASK_CHOICE_DUMP_CORE) goto ask;
-      fflush(stdout);
-      fflush(stderr);
-      event->retcode = choice;
-    }
-    return event;
-  case BX_ASYNC_EVT_REFRESH:
-  case BX_ASYNC_EVT_DBG_MSG:
-  case BX_ASYNC_EVT_LOG_MSG:
-    // The text mode interface does not use these events, so just ignore
-    // them.
-    return event;
-  default:
-    fprintf(stderr, "textconfig: notify callback called with event type %04x\n", event->type);
-    return event;
+        if (ask_menu("Choose one of the actions above: [%s] ", "",
+                     log_action_n_choices, log_action_ask_choices, 2, &choice) < 0)
+        event->retcode = -1;
+        // return 0 for continue, 1 for alwayscontinue, 2 for die, 3 for debug.
+        if (!BX_HAVE_ABORT && choice==BX_LOG_ASK_CHOICE_DUMP_CORE) goto ask;
+        fflush(stdout);
+        fflush(stderr);
+        event->retcode = choice;
+      } else {
+        // warning prompt not implemented
+        event->retcode = 0;
+      }
+      return event;
+    case BX_ASYNC_EVT_REFRESH:
+    case BX_ASYNC_EVT_DBG_MSG:
+    case BX_ASYNC_EVT_LOG_MSG:
+      // The text mode interface does not use these events, so just ignore
+      // them.
+      return event;
+    default:
+      fprintf(stderr, "textconfig: notify callback called with event type %04x\n", event->type);
+      return event;
   }
   assert(0); // switch statement should return
 }
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/win32dialog.cc ./gui/win32dialog.cc
--- /home/volker/bochs/bochs/gui/win32dialog.cc	2014-06-20 11:32:02.034026376 +0200
+++ ./gui/win32dialog.cc	2016-12-28 12:50:14.148888740 +0100
@@ -2,7 +2,7 @@
 // $Id: win32dialog.cc 12381 2014-06-20 09:31:56Z vruppert $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2003-2014  The Bochs Project
+//  Copyright (C) 2003-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@
 #include "win32res.h"
 #include "win32paramdlg.h"
 
-const char log_choices[5][16] = {"ignore", "log", "ask user", "end simulation", "no change"};
+const char log_choices[N_ACT+1][16] = {"ignore", "log", "warn user", "ask user", "end simulation", "no change"};
 
 HWND GetBochsWindow()
 {
@@ -97,12 +97,16 @@
       SetWindowText(GetDlgItem(hDlg, IDASKMSG), event->u.logmsg.msg);
       SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue");
       SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue and don't ask again");
-      SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Kill simulation");
-      SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Abort (dump core)");
+      if (event->u.logmsg.flag == BX_LOG_ASK_ASKDLG) {
+        SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Kill simulation");
+        SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Abort (dump core)");
 #if BX_DEBUGGER
-      SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue and return to debugger");
+        SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue and return to debugger");
 #endif
-      SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_SETCURSEL, 2, 0);
+        SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_SETCURSEL, 2, 0);
+      } else {
+        SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_SETCURSEL, 0, 0);
+      }
       SetFocus(GetDlgItem(hDlg, IDASKLIST));
       return FALSE;
     case WM_CLOSE:
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/wxdialog.cc ./gui/wxdialog.cc
--- /home/volker/bochs/bochs/gui/wxdialog.cc	2015-01-07 17:17:40.447882000 +0100
+++ ./gui/wxdialog.cc	2016-12-27 20:30:44.997609007 +0100
@@ -2,7 +2,7 @@
 // $Id: wxdialog.cc 12594 2015-01-07 16:17:40Z sshwarts $
 /////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2002-2014  The Bochs Project
+//  Copyright (C) 2002-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -208,7 +208,6 @@
   : wxDialog(parent, id, wxT(""), wxDefaultPosition, wxDefaultSize,
     wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
 {
-  //static int integers[LOG_OPTS_N_CHOICES_NORMAL] = {0, 1, 2, 3};
   static wxString names[] = ADVLOG_OPTS_TYPE_NAMES;
   SetTitle(ADVLOG_OPTS_TITLE);
   vertSizer = new wxBoxSizer(wxVERTICAL);
@@ -1563,7 +1562,7 @@
     bool includeNoChange)
 {
   static wxString choices[] = LOG_OPTS_CHOICES;
-  static int integers[LOG_OPTS_N_CHOICES] = {0, 1, 2, 3, 4};
+  static int integers[LOG_OPTS_N_CHOICES] = {0, 1, 2, 3, 4, 5};
   wxChoice *control = new wxChoice(parent, id, wxDefaultPosition, wxDefaultSize);
   int lastChoice = 0;  // remember index of last choice
   int nchoice = includeNoChange? LOG_OPTS_N_CHOICES : LOG_OPTS_N_CHOICES_NORMAL;
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/wxdialog.h ./gui/wxdialog.h
--- /home/volker/bochs/bochs/gui/wxdialog.h	2014-12-23 20:30:12.896090221 +0100
+++ ./gui/wxdialog.h	2016-12-27 20:34:28.518389938 +0100
@@ -2,7 +2,7 @@
 // $Id: wxdialog.h 12576 2014-12-23 19:30:03Z vruppert $
 ////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2002-2014  The Bochs Project
+//  Copyright (C) 2002-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -354,10 +354,10 @@
 #define LOG_OPTS_PROMPT wxT("How should Bochs respond to each type of event?")
 #define LOG_OPTS_TYPE_NAMES { wxT("Debug events"), wxT("Info events"), wxT("Error events"), wxT("Panic events") }
 #define LOG_OPTS_N_TYPES 4
-#define LOG_OPTS_CHOICES { wxT("ignore"), wxT("log"), wxT("ask user"), wxT("end simulation"), wxT("no change") }
-#define LOG_OPTS_N_CHOICES_NORMAL 4
-#define LOG_OPTS_N_CHOICES 5   // number of choices, including "no change"
-#define LOG_OPTS_NO_CHANGE 4   // index of "no change"
+#define LOG_OPTS_CHOICES { wxT("ignore"), wxT("log"), wxT("warn user"), wxT("ask user"), wxT("end simulation"), wxT("no change") }
+#define LOG_OPTS_N_CHOICES_NORMAL 5
+#define LOG_OPTS_N_CHOICES 6   // number of choices, including "no change"
+#define LOG_OPTS_NO_CHANGE 5   // index of "no change"
 #define LOG_OPTS_ADV wxT("For additional control over how each device responds to events, use the menu option \"Log ... By Device\".")
   wxFlexGridSizer *gridSizer;
   wxChoice *action[LOG_OPTS_N_TYPES];
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/wxmain.cc ./gui/wxmain.cc
--- /home/volker/bochs/bochs/gui/wxmain.cc	2016-12-26 17:12:57.470174541 +0100
+++ ./gui/wxmain.cc	2016-12-28 12:15:26.035961463 +0100
@@ -2,7 +2,7 @@
 // $Id: wxmain.cc 13006 2016-12-26 16:12:54Z vruppert $
 /////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2002-2014  The Bochs Project
+//  Copyright (C) 2002-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -1158,6 +1158,10 @@
 #if !BX_DEBUGGER && !BX_GDBSTUB
   dlg.EnableButton(dlg.DEBUG, FALSE);
 #endif
+  if (be->u.logmsg.flag != BX_LOG_ASK_ASKDLG) {
+    dlg.EnableButton(dlg.DIE, FALSE);
+    dlg.EnableButton(dlg.DUMP, FALSE);
+  }
   dlg.SetContext(wxString(be->u.logmsg.prefix, wxConvUTF8));
   dlg.SetMessage(wxString(be->u.logmsg.msg, wxConvUTF8));
   int n = dlg.ShowModal();
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/gui/x.cc ./gui/x.cc
--- /home/volker/bochs/bochs/gui/x.cc	2016-12-27 17:26:59.622665119 +0100
+++ ./gui/x.cc	2016-12-28 12:03:10.963351647 +0100
@@ -2687,11 +2687,7 @@
   } else {
     size_x = 30 + maxlen * 6;
   }
-  if (lines < 3) {
-    size_y = 90;
-  } else {
-    size_y = 60 + lines * 15;
-  }
+  size_y = 70 + lines * 15;
   x11_dialog_c *xdlg = new x11_dialog_c(name, size_x, size_y,
                                         (mode == XDLG_SIMPLE) ? 1 : 2);
   ypos = 34;
@@ -2729,11 +2725,21 @@
   bx_param_string_c *sparam;
   bx_param_enum_c *eparam;
   bx_list_c *list;
+  char message[256];
 
   switch (event->type)
   {
     case BX_SYNC_EVT_LOG_ASK:
-      event->retcode = x11_ask_dialog(event);
+      if (event->u.logmsg.flag == BX_LOG_ASK_ASKDLG) {
+        event->retcode = x11_ask_dialog(event);
+      } else if (event->u.logmsg.flag == BX_LOG_ASK_MSGBOX_WARN) {
+        const char *title = SIM->get_log_level_name(event->u.logmsg.level);
+        sprintf(message, "Device: %s\n\nMessage: %s", event->u.logmsg.prefix,
+                event->u.logmsg.msg);
+        bx_param_bool_c bparam(NULL, "warn", title, message, 1);
+        x11_message_box(&bparam, XDLG_SIMPLE);
+        event->retcode = 0;
+      }
       return event;
     case BX_SYNC_EVT_ASK_PARAM:
       param = event->u.param.param;
diff -urNX /home/volker/exclude-bochs /home/volker/bochs/bochs/logio.cc ./logio.cc
--- /home/volker/bochs/bochs/logio.cc	2015-05-10 08:55:18.678940963 +0200
+++ ./logio.cc	2016-12-28 00:40:40.395736643 +0100
@@ -2,7 +2,7 @@
 // $Id: logio.cc 12759 2015-05-10 06:55:16Z vruppert $
 /////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2001-2014  The Bochs Project
+//  Copyright (C) 2001-2016  The Bochs Project
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -50,11 +50,25 @@
   else return "?";
 }
 
+static const char *act_name[N_ACT] = { "ignore", "report", "warn", "ask", "fatal" };
+
 const char* iofunctions::getaction(int i) const
 {
-  static const char *name[] = { "ignore", "report", "ask", "fatal" };
   assert (i>=ACT_IGNORE && i<N_ACT);
-  return name[i];
+  return act_name[i];
+}
+
+int iofunctions::isaction(const char *val) const
+{
+  int action = -1;
+
+  for (int i = 0; i < N_ACT; i++) {
+    if (!strcmp(val, act_name[i])) {
+      action = ACT_IGNORE + i;
+      break;
+    }
+  }
+  return action;
 }
 
 void iofunctions::flush(void)
@@ -414,6 +428,11 @@
   logio->out(LOGLEV_ERROR, prefix, fmt, ap);
   va_end(ap);
 
+  if (onoff[LOGLEV_ERROR] == ACT_WARN) {
+    va_start(ap, fmt);
+    warn(LOGLEV_ERROR, prefix, fmt, ap);
+    va_end(ap);
+  }
   if (onoff[LOGLEV_ERROR] == ACT_ASK) {
     va_start(ap, fmt);
     ask(LOGLEV_ERROR, prefix, fmt, ap);
@@ -438,6 +457,11 @@
   logio->out(LOGLEV_PANIC, prefix, fmt, ap);
   va_end(ap);
 
+  if (onoff[LOGLEV_PANIC] == ACT_WARN) {
+    va_start(ap, fmt);
+    warn(LOGLEV_PANIC, prefix, fmt, ap);
+    va_end(ap);
+  }
   if (onoff[LOGLEV_PANIC] == ACT_ASK) {
     va_start(ap, fmt);
     ask(LOGLEV_PANIC, prefix, fmt, ap);
@@ -465,6 +489,36 @@
   // the actions ask() and fatal() are not supported here
 }
 
+void logfunctions::warn(int level, const char *prefix, const char *fmt, va_list ap)
+{
+  // Guard against reentry on warn() function.  The danger is that some
+  // function that's called within warn() could trigger another
+  // BX_ERROR that could call warn() again, leading to infinite
+  // recursion and infinite asks.
+  static char in_warn_already = 0;
+  char buf1[1024];
+  if (in_warn_already) {
+    fprintf(stderr, "logfunctions::warn() should not reenter!!\n");
+    return;
+  }
+  in_warn_already = 1;
+  vsnprintf(buf1, sizeof(buf1), fmt, ap);
+  // FIXME: facility set to 0 because it's unknown.
+
+  // update vga screen.  This is useful because sometimes useful messages
+  // are printed on the screen just before a panic.  It's also potentially
+  // dangerous if this function calls ask again...  That's why I added
+  // the reentry check above.
+  SIM->refresh_vga();
+
+  // ensure the text screen is showing
+  SIM->set_display_mode(DISP_MODE_CONFIG);
+  SIM->log_warn(prefix, level, buf1);
+  // return to simulation mode
+  SIM->set_display_mode(DISP_MODE_SIM);
+  in_warn_already = 0;
+}
+
 void logfunctions::ask(int level, const char *prefix, const char *fmt, va_list ap)
 {
   // Guard against reentry on ask() function.  The danger is that some
2016-12-28 15:06:34 +00:00
Volker Ruppert
91e1ed5bf6 Fixed building Bochs from outside of the source tree (second try). 2016-12-28 08:34:59 +00:00
Volker Ruppert
b05904b4a4 Fixed building Bochs from outside of the source tree. 2016-12-28 08:19:19 +00:00
Volker Ruppert
b5b0ec503c Some work on the X11 dialogs
- Rewrite of the existing yes/no dialog to support more button options. Now it
  can be used with OK/Cancel buttons or as a simple message box with OK or
  Cancel. This message box that can be used to show error messages with a
  new action "warn" or for critical panics when continuing would be dangerous
  ("BX_FATAL"). These features are not implemented yet.
- Partial rewrite of the button handling code (e.g. new method add_button()).
- some malloc/free to new/delete changes.
2016-12-27 16:26:57 +00:00
Volker Ruppert
97a4909b73 When reading configuration from the wx gui, an error no longer closes the whole
app. Now only the bochsrc parsing terminates with an error. Improved message box
shown at this point.
2016-12-26 16:12:54 +00:00
Volker Ruppert
e1d8aa4b56 Updated changes after latest release. 2016-12-26 09:48:16 +00:00
Volker Ruppert
a3cbba7006 Some changes in the USB xHCI device
- The retry timer now calls process_transfer_ring() for enabled slots only.
- On USB3-only ports ignore device speed setup and try to enable super-speed mode.
2016-12-26 08:07:32 +00:00
Volker Ruppert
110a8d134e Implemented retry timer for NAK'ed transfers on xHCI. If a device returns NAK,
the transfer is retried with the given interval (stored in the endpoint context)
until it is successful. This fixes the HID device usage on xHCI.
2016-12-24 17:30:45 +00:00
Volker Ruppert
2712de0f19 Some changes in USB device descriptors depending on speed.
- Added support for HID devices in high-speed mode.
- Added separate descriptors for MSD devices in high-speed mode.
- NOTE: USB 2.0 values ported from Qemu / tested with USB EHCI.
2016-12-24 00:45:54 +00:00
Volker Ruppert
f828d3c23b Some changes in USB device speed setup
- Define minimum and maximum speed per device and panic if setting out of range.
- Allow speed value "full" for HID devices.
2016-12-21 18:35:38 +00:00
Volker Ruppert
e3e1665d6a Since all HCs now support asynchronous packet completion, we can enable the
async mode by default for all USB devices (used by disk, cdrom and floppy).
Whenever we implement a new HC model, it is still possible to set the async mode
to 0 until the async packet completion is working correctly.
2016-12-19 21:53:45 +00:00
Volker Ruppert
9cdf42d152 Asynchronous packet support implemented in the USB xHCI device. 2016-12-18 20:49:12 +00:00
Stanislav Shwartsman
9bd99a604f implemented recently announced AVX-512 extension VPOPCNT 2016-12-17 13:47:45 +00:00
Volker Ruppert
9377281239 Prepare async packet code for the usage with xHCI. 2016-12-17 08:14:04 +00:00
Volker Ruppert
c1eb6f9ff8 Fixed compilation error on MSVC. 2016-12-13 20:22:28 +00:00
Stanislav Shwartsman
e613e9ff86 fixed compilation err when no AVX is enabled 2016-12-12 06:18:57 +00:00
Volker Ruppert
8edfb58c04 Updated makefile dependencies for USB EHCI (now complete and usable). 2016-12-11 18:54:01 +00:00
Volker Ruppert
35c61a8252 Create "Port Status Change" event only when the xHCI is initialized and running. 2016-12-11 18:27:12 +00:00
Volker Ruppert
cc1fa2bc61 Implemented USB remote wakeup mechanism in xHCI and the external hub. 2016-12-11 12:26:12 +00:00
Volker Ruppert
1f5222e096 Fixed string usage after delete. 2016-12-11 07:51:21 +00:00
Volker Ruppert
c3b608a3c9 Implemented USB remote wakeup mechanism.
- Extended USB callback definition to support different event types sent from
  device to HC. Currently we only have the two events "async completion" and
  "remote wakeup".
- Implemented event handlers in the UHCI, OHCI and EHCI. For the EHCI version
  we currently have no test case.
- The external USB hub now uses this feature at device connect/disconnect.
  Now the device change on the hub is correctly detected by the guest OS.
- TODO #1: remote wakeup and async completion for the xHCI.
- TODO #2: event handler for the external hub to make a USB device work on
  a chain of hubs.
- TODO #3: the event handler possibly could be used for the packet copy code.
2016-12-10 13:45:49 +00:00
Stanislav Shwartsman
7b2a8bb340 added missing EPT misconfig condition check 2016-12-10 05:06:59 +00:00
Stanislav Shwartsman
46b4a76cd3 fetchdecode rework step 0.1, no impact on correctness, small speedup 2016-12-09 12:34:37 +00:00
Volker Ruppert
974c8d5124 Fixed compilation errors that occur with debugger enabled. 2016-12-06 18:07:05 +00:00
Stanislav Shwartsman
7ccc859b00 static code analysis: remove redundant include 2016-12-05 19:15:59 +00:00
Stanislav Shwartsman
98c69ce6ae c++ better to use new/delete and not malloc 2016-12-05 19:05:31 +00:00
Stanislav Shwartsman
0059d33102 c++ better to use new/delete and not malloc 2016-12-05 18:56:56 +00:00
Stanislav Shwartsman
2895031c7e c++ better to use new/delete and not malloc 2016-12-05 18:51:12 +00:00
Stanislav Shwartsman
20efa2ddec c++ better to use new/delete and not malloc 2016-12-05 18:49:22 +00:00
Stanislav Shwartsman
ca403b69c4 c++ better to use delete and not malloc 2016-12-05 18:47:16 +00:00