- Fixes in MAP13 disabled mode (VGA mode 6): half dot clock, color support
- Modified method get_vga_pixel(): now using row start address as an argument
- 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.
- 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).
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>
The WIN32 configuration for the cdrom was not closing the image file on
eject. This left the handle open while Bochs was running, not allowing
the image file to be modified.
This improves and enhances the floppy emulation.
This adds the ability to specify a controller type.
This adds all but one, known, controller command.
This fixes the format command. Issue #123
This fixes the error with older Windows guests.
When the user presses the "Reset" button on the gui ribbon, we need to
clear the active status of all statusbar items or they remain set after
the reset occurs.
This is mentioned in issue https://github.com/bochs-emu/Bochs/issues/136
This allows you to change the CD-ROM via the Bochs Ribbon, as well as
properly "ejecting" a CD from the guest.
Before the CD path would change, but the guest (tested with WinXP and
DOS as guests) would not see the change.
This fix simulates an open tray and then a closed tray for all CD
changes.
avoid using ull modifyer for consts, use BX_CONST64() instead
move definitions from header file to cpp file when possible
add 'const' modifyer for obviosly const methods and pointers
This adds support for the UFI_SEND_DIAGNOSTIC command in USB_FLOPPY.CC
and
This changes the list of defines to enum to match the current changes
made to recent files.
This fixes the CD-ROM hardware by making sure the `drive_ready` flag is
zero after an `ATAPI_DEVICE_RESET` command. As far as I know, no other
Guest needed this fix except for the TEAC-CDI driver referred to below.
This also adds an assumption fix so that the TEAC_CDI driver will work.
The TEAC_CDI driver relies on the fact that the TEAC drive it is
designed for, sets the `interrupt reason` register (`sector count`
register) after the `ATAPI_IDENTIFY` command is issued. It uses this
`i_o` bit of this register to determine the direction of transfer for
the 0xA1 command, even though this is a read-only direction command.
Through other tests, I see no other Guests effected by this addition.
I also added a few minor syntax modifications, tab spacing, and
comments. The DEBUG out string will display the ATAPI command as well as
the 0xA0 command.
This PR adds the ability to choose which companion controller the EHCI
uses.
`#usb_ehci: enabled=1, companion=uhci`
`#usb_ehci: enabled=1, companion=ohci`
UHCI is enabled by default:
`#usb_ehci: enabled=1`
This breaks up `usb_ohci.cc/h` into `usb_ohci.cc/h` and `ohci_core.cc/h`
to be like the existing `usb_uhci.cc/h` and `uhci_core.cc/h`.
This adds the ability to define a Port Routing string in the
`HcspPortRoute` register, and is optional via the `EHCI_PORT_ROUTE`
define.
Currently `EHCI_N_CC` and `EHCI_N_PCC` must remain as currently set (3
and 2 respectively), however with a little more work, I think these can
be modified and have up to 7 companion controllers with more ports per
companion, as long as the combined total is <= 15 total ports.
Please verify the `Makefile.in` changes. I do not use GCC and can not
verify it is correct.
Made all devices pass USB 2.0 Compliance on WinXP (old version of the
compliance test).
USB Hub still needs a little work to be in complete compliance.
Fixed potential bug in EHCI to UHCI hand-off.
Fixed compilation error with Floppy CB/CBI emulation.
Minor syntax fixes (tabulation, old irrelevant comments)
MSD serial numbers must be 12 chars.
Added to CHANGES file
This changes a BX_INFO to a BX_DEBUG. It does not needed to be a
BX_INFO.
Second, this adds (very) minimal support for SCSI command 0xAC.
When emulating a .iso image via USB CD-ROM on Win10, without this
command, the emulation freezes when trying to access the CD-ROM. I don't
know if it is Bochs or Win10. I think Win10 expects the command to work,
or Bochs is not failing correctly.
This PR simply adds code to acknowledge the command and returns a zero
length report. This SCSI (MMC) specification states that a zero length
report is allowed.
The 8 byte header is returned, but the header indicates a zero byte
return: No report segments returned.
This seems to keep Win10 from freezing at USB CD-ROM device access time.
The code also BX_DEBUG's the command sent to the "controller", for
future use when adding the actual support of the command.
This PR allows larger VHD image files. The size in question doesn't
necessarily mean the size of the VHD file on disk. The size is the total
size of the image emulated. This total size is in question.
Without this patch, the total size allowed is 65535 * 16 * 255, or
roughly 32gig.
With this patch, the total size is calculated by who the creator of the
image is, what the CHS values are, and possibly a total size of up to a
limit of 2TB.
Since the original code was ported from QEMU, I ported an updated QEMU
code snippet.
https://gitlab.com/qemu-project/qemu/-/blob/master/block/vpc.c?ref_type=heads#L305
This PR now allows VHD image files with a total size emulated less than
or equal to 2TB.