Commit Graph

13085 Commits

Author SHA1 Message Date
Volker Ruppert
0d49d2a8df Added 'flash_data' parameter to the romimage option.
This parameter defines the file name for the flash BIOS config space loaded
startup if existing and saved on exit if modified. The Bochs BIOS doesn't
use this feature yet. Updated 'romimage' option documentation.
2023-12-09 17:52:33 +01:00
Volker Ruppert
8c89528617 Fixed assertion failure on exit (#164).
The io object should never been deleted.
2023-12-09 14:22:02 +01:00
Volker Ruppert
b03e901206 Update CHANGES 2023-12-08 14:32:26 +01:00
Volker Ruppert
20b61b31f2 Improved parsing bochsrc options passed on the command line (see issue #160).
If the last char of an argument is a colon, equal sign or comma and there is
at least one more argument, then concatenate these arguments to one and pass
it to parse_line_unformatted().
2023-12-08 14:17:40 +01:00
Volker Ruppert
edb9c7aad8
Added save/restore support for the ESCD space in the flash BIOS ROM. (#162)
These changes only have an effect when using a BIOS image designed for
real hardware (tested with asus_p6np5.bin). When using Bochs BIOS no
data will be saved / restored, since the 'flash_modified' value is
always set to 'false'. Saving ESCD data on exit is not implemented yet,
but it shouldn't be hard to do.
2023-12-07 21:45:39 +01:00
Stanislav Shwartsman
2eccb25e8f x87: Implemented special behavior for 287-compatibility FSTP opcode: D9D8..D9DF - Behaves the same as FSTP but won't cause a stack underflow exception. 2023-12-07 12:56:02 +02:00
Volker Ruppert
54aeba83d3 Moved CMOS image runtime options setup to cmos.cc. 2023-12-05 18:16:24 +01:00
Volker Ruppert
7fcf4a419a Added support for saving CMOS image at runtime.
- Added CMOS image options to runtime menu (except RTC init).
- Fixed default size of Bochs CMOS RAM (s.max_reg).
- Fixed bochsrc parse to make 'rtc_init' parameter work.
- In textconfig now using SERIES_ASK for CMOS image options.
2023-12-04 20:39:24 +01:00
Volker Ruppert
c8b370d206 Added split screen support to the 256-color VGA mode called "modeX". 2023-12-03 19:42:05 +01:00
Volker Ruppert
77eaf072b4 Update CHANGES 2023-12-03 17:20:35 +01:00
Shwartsman
9e68546126 cleanup more leafs in CPUDB 2023-12-03 17:59:48 +02:00
Shwartsman
624a7a33a4 fixed compilation 2023-12-03 16:57:58 +02:00
Shwartsman
d6e60afd9f remove configure scripts which were used only for CI/DI and not part of the new CI/DI configuration script 2023-12-03 16:50:45 +02:00
Shwartsman
4462ff5abe updated in CI/DI scripts 2023-12-03 16:49:40 +02:00
Shwartsman
a1060a0825 cleanups in CPUDB cpuid definitions 2023-12-03 16:46:39 +02:00
Volker Ruppert
18d1e76444 X gui: a short delay makes it show the modeless message box correctly. 2023-12-03 15:28:23 +01:00
Volker Ruppert
7f420fc260 Added modeless message box in the restore code and some related fixes.
- Show message box while restoring hardware state.
- Set modeless message box handle to NULL after destroying it.
- Reset all config options to default before restoring config.
- Fixed CMOS RTC value after restore if in 12-hour-mode.
- Fixed possible segfault in the plugins code caused by Voodoo plugin in VGA mode
  (found at restore code testing).
2023-12-03 12:34:03 +01:00
Vort
9ac605e411
Enable asserts for MSVC Debug builds (#158)
Enabling `assert`s in Debug MSVC builds (removing of `NDEBUG` defines)
allows to catch more bugs.
No changes were made to `BX_ASSERT` handling.
Also I did not touched `vs2019-plugins` because it looks broken for me.
2023-12-03 11:16:48 +02:00
Vort
5147c20eaa
Enable static library linking for MinGW builds (#152)
This change allows to build Windows binaries without dependencies on
toolchain-specific libraries (like `libc++.dll`).
It allows to perform version updates by copying of single `bochs.exe`,
without the need for searching and distribution of linked DLLs.

---------

Co-authored-by: Volker Ruppert <Volker.Ruppert@t-online.de>
2023-12-03 09:00:23 +02:00
Benjamin David Lunt
d9bee7d87a
Added warning note (#156)
The Legacy BIOS is incapable of handling a PCI enabled VGA rom, so added
a warning to not use this particular combination.
2023-12-03 07:41:41 +02:00
Volker Ruppert
9216d228be Treat configure script as binary file 2023-12-02 17:47:55 +01:00
Volker Ruppert
98f4180764 Added shortcut script for Github build tests.
In addition to release, nothing and everything, I have added "i686" for the
maximum possible i686 config and "x86-64" for the minimal 64-bit cpu config.
2023-12-02 16:26:05 +01:00
Volker Ruppert
af47384d96 Regenerated configure script and updated CHANGES. 2023-12-02 15:13:39 +01:00
Volker Ruppert
fc0992ac40 Added capability to select config with command line argument (.conf.linux).
TODO #1: some other shortcut scripts should support this.
TODO #2: add a special script for Github test builds this way.
2023-12-02 14:49:21 +01:00
Stanislav Shwartsman
fcea81a042 fixed compilation in cmos.cc 2023-12-02 08:43:56 +02:00
Stanislav Shwartsman
ffc722f4e8
Porting #SF patch #565 Real Time Clock /CMOS fix (#4)
by Michele Giacomone

Detailed description:

  -Observed issues

   Due to some limitations only dates between 1980 and 2038 can be
   used in a reliable way.
   Also, bochs incorrectly assumes a linear correspondence between
   the data returned by the <time.h> functions localtime() and
   mktime(), and isn't setting the latter properly.
   Bochs keeps its internal time value dependent to these functions
   after setup, assuming that their internal settings won't change
   on the go - which is not the case.
   In my OS, and in my timezone, this leads to incorrect startup values
   for 5 months each year and unreliable values if the simulation is
   kept going for a long time. (a feedback between localtime() and
   mktime() is created which keeps shifting back the time)
   Also, the RTC simulation is not realistic since the clock fixes
   itself across DST changes, without updating any DST related flag,
   a behavior that no guest OS expects.

  -Proposed fix

   This is implemented in such way that no bochs' previous behavior
   is changed, a part from the broken ones, with legacy in mind
   == the user can keep using bochs exactly as before knowing nothing
      of this patch

   +Make the internal s.timeval variable a Bit64s, so it can fit all
    values that the cmos can correctly represent, reported below:
    MIN     setting  -62167219200 =>  0000/01/01 SAT  0:00:00
    MAX BCD setting  253402300799 =>  9999/12/31 FRI 23:59:59
    MAX BIN setting  745690751999 => 25599/12/31 FRI 23:59:59
    And then fix each reference to these so it can handle such values
    And make bochs correctly wrap around for under/overflows, so that
    only the most significant bits of the century are lost.

   +Do the same thing to the bochs time0 parameter, so all the above
    values can be chosen at startup (despite being now legal values,
    1 and 2 will still be treated as "local" and "utc"). Note that
    normally only BCD settings are valid since bochs' CMOS defaults
    to such operating mode - the only way to use the binary range
    is by loading a cmos memory map.

   +Make the internal s.timeval variable independent from external
    factors. This means providing a small set of time handling
    functions, contained in "iodev/utctime.h", which must work in
    any environment in which bochs compiles, accessing no external
    resource. This also means that after startup, s.timeval will only
    be changed internally, and no call to the OS time functions will
    be made.

   +Make the internal s.timeval variable timezone independent, to
    have a linear correlation between its values and valid CMOS
    settings. To make it easier, s.timeval is gonna be treated as
    if the current timezone was UTC: so,
     - if the user selects UTC as time0, s.timeval will become current
       time(NULL)
     - if the user selects localtime, s.timeval will be computed as
       the value which will display the same broken down time as
       localtime(&now)
     - if the user inputs a time formatted string the proper s.timeval
       to displayed will be easily calculated,
     - if the user inputs a starting time value, s.timeval will be
       computed as the value which will display the same broken down
       time as localtime(&user_input) to ensure the same operation as
       before.
    A "tz=utc" is displayed when bochs prints out the current time
    value, to warn users about the difference in meaning between the
    internally kept time value and the value they can set through
    the "time0=" parameter. This might be changed to communicate
    instead the time value they can input to get the same setting,
    but performing such calculation (except for the startup time)
    suffers from all the mktime()/localtime() problems listed above
    so I did not do it.
    The range of "time0" is automatically adjusted so all users in
    all time zones can set any legal value despite "time0=" having a
    local meaning.

  A thorough explanation of what I did and why can be found in the
  "iodev/utctime.h" library header.

---------

Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
Co-authored-by: Volker Ruppert <Volker.Ruppert@t-online.de>
2023-12-01 22:55:35 +01:00
Shwartsman
4de6c097a4 use true/false instead of 0/1 for boolean variables
cleanups in code
2023-12-01 23:01:11 +02:00
Stanislav Shwartsman
0653c5ba75 fixed compilation when x86_64 not compiled in but mwait is 2023-12-01 21:45:17 +02:00
Stanislav Shwartsman
00e8e0bca0 implemented MOVDIR64B instruction and enabled in TigerLake model 2023-12-01 18:03:25 +02:00
Stanislav Shwartsman
2e89b9bcba
implemented WAITPKG instruction set (#150)
still missing : UMWAIT/TPAUSE should set CF flag if it was using OS
deadline and woken up after deadline (i.e. not from monitored store)
also not clear in the spec: should UWAITX/TPAUSE always wait until
deadline due to 'while(tsc<deadline)' statement ?
+include small fixes for AMD's MONITORX/MWAITX
2023-12-01 18:00:03 +02:00
Stanislav Shwartsman
97a63b0414 fix name of ifdef guarding include 2023-12-01 12:27:21 +02:00
Stanislav Shwartsman
2a3321d012 remove apic.h from dependencies in cpudb folder 2023-11-28 16:22:02 +02:00
Stanislav Shwartsman
9ef235c338 compilation fix with --enable-memtype disabled 2023-11-28 16:20:03 +02:00
Shwartsman
3c857f2ad1 make APIC from static object to dynamic so many cc files won't need to be dependent on apic.h 2023-11-28 11:08:42 +02:00
Shwartsman
8dd9649389 fixed compilation for VMX=1 X86_64=1
updated (c) for many files
2023-11-28 10:36:56 +02:00
Shwartsman
4efcabb1a1 reduce code duplication with making new simpler to use physical access methods 2023-11-28 10:24:11 +02:00
Shwartsman
685a033d2d fixed compilation with BX_SUPPORT_VMX=1 (x86_64 = 0) 2023-11-28 09:07:32 +02:00
Stanislav Shwartsman
6e1e04e2a5 update CHANGES 2023-11-27 20:15:00 +02:00
Stanislav Shwartsman
47edb90b02 remove in_repeat obsolete usages 2023-11-27 20:15:00 +02:00
Stanislav Shwartsman
e0802b31d2 remove redundant code
VMENTER already ensure that POSTED INTR implies
PIN_VMEXIT(VMX_PIN_BASED_VMEXEC_CTRL_EXTERNAL_INTERRUPT_VMEXIT) = 1
and
(vm->vmexit_ctrls & VMX_VMEXIT_CTRL1_INTA_ON_VMEXIT) != 0
2023-11-27 20:15:00 +02:00
Shwartsman
f37049903b fixed compilation 2023-11-27 20:15:00 +02:00
Shwartsman
cc4f594ede implemented process-posted-interrupts VMX extension 2023-11-27 20:15:00 +02:00
Stanislav Shwartsman
9a5dfb10c1 fixed 'misleading indentation' warning
move variable definitions closer to their use
2023-11-27 19:05:12 +02:00
Stanislav Shwartsman
a5c6bcfd15 remove in_repeat variable and replace it with correct EFLAGS.RF management 2023-11-27 13:51:25 +02:00
Stanislav Shwartsman
ca4ca03be8 remove #ifdef around in_repeat variable, it is always needed 2023-11-26 23:21:51 +02:00
Volker Ruppert
e82316c490 Memory leak fix in the win32 gui code.
In exit() method always call terminateEmul(), but the argument depends on the
value of bx_user_quit.
2023-11-26 22:04:07 +01:00
Stanislav Shwartsman
4ee9d37a5f prevent access to non-existing VMCS fields 2023-11-26 20:29:56 +02:00
Stanislav Shwartsman
ad7a85d11a updates for SVM INVLPGA instruction
- decoding and disasm
 - invalidate only pages pointed by RAX and not entire TLB
2023-11-26 19:45:07 +02:00
Volker Ruppert
48b3b7e7a5 If any device is still loaded, plugin_cleanup() calls bx_unload_plugins(). 2023-11-26 18:36:07 +01:00
Shwartsman
b013b389ea fixed code duplication, extract some code to functions
make special phy memory read methods which help to write cleaner code
2023-11-26 18:25:54 +02:00