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>
First step into implementing UINTR - User Level Interrupts ISA extension
To be continued
---------
Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
- Added check in config.h whether or not Bochs is configured and compiled for
the same target platform (WIN32 / WIN64).
- Fixed some warnings that occur in the MSVC WIN64 case.
The latest release is from 2001 and it will not work on modern Linux systems.
Parts of the SVGALib code have been moved to the Linux kernel and the X11 and
SDL libraries are using it as a video driver.
old SF patches this solution is compatible with the plugin architecture. The
ne2k plugin is loaded only once and a new ne2k_main_c object creates up to 4
ne2k device objects depending on the config. The new ne2k parameter "card"
specifies the zero-based card number to configure. If not given, the default
is card #0 for compatibility. The new ne2k parameter "type" specifies the bus
it is connected to ("isa" or "pci"). Card #0 defaults to PCI, the others to
ISA. In the PCI slot configuration the ne2k device can be used multiple times
if more than one card is configured.
Related changes:
- removed SMF stuff for ne2k
- always convert device prefix to uppercase (ne2k uses NE2K0 ... NE2K3)
- removed unused BXPN values
- TODO: add multiple NICs support for the E1000
Only missing items (to be added soon):
- Supervisor Shadow Stack EPT Control is not implemented yet
- SMM placing for SSP
Currently have to be added manually to some CPUID model, for example to ICL-U
To enable configure with --enable-cet
- if wxGTK uses GTK 3.x, also use it for the gui debugger to avoid trouble
- the name of the include file for GDK keysyms now depends on GDK version, so
the temporary translation table can be removed
- small fix to compile the gui debugger with GTK 3.x (warnings still exist)
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.
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.
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.
almost implemented, the port owner handling and the UHCI companion controllers
are present. High speed devices are not yet supported, since the EHCI scheduler
code has not been written yet (e.g. porting from Qemu). Low and full speed
devices should be detected correctly and work after port ownership change to
UHCI. 6 ports are available and the bochsrc syntax is similar to other HCs.
USB UHCI and the E1000 NIC are known to work fine on some guest systems, so
it's safe to remove this attribute.
TODO: Some other Bochs features need to be reviewed for this.
implemented important CPU statistics which were used for Bochs CPU model performance analysis.
old statistics code from paging.cc and cpu.cc is replaced with new infrastructure.
In order to enale statitics collection in Bochs CPU:
- Enable statistics @ compilation time in cpu/cpustats.h
- Dump statistics periodically by adding -dumpstats N into Bochs command line
- added new symbol BX_WITH_SDL2 and prepared build system
- TODO #1: add new option --with-sdl2 to configure script
- TODO #2: add new file sdl2.cc (porting seems hard to do - writing from scratch
might be better)
required an external binary and it couldn't be ported to Windows. Now the new
builtin and portable slirp support based on Qemu's implementation is almost
stable and all the 'vnet' DHCP and TFTP features have been ported to the new
slirp module.
TODO: rename all the "slirp_new" stuff to "slirp"
is almost a port of the Qemu 1.1.2 implementation. It has been tested successfully
on Linux and Windows (MinGW/MSYS). The networking module is currently called
"slirp_new", since the "slirp" backend module still exists.
TODO list:
- MSVC support (requires container_of() macro replacement)
- apply fixes and improvements from recent Qemu releases
- use our TFTP implementation to reduce code duplication
- check if we can share ARP and DHCP support with "vnet"
- add SMB support on Linux
- finally remove the slirp backend module support