Commit Graph

11324 Commits

Author SHA1 Message Date
Stanislav Shwartsman
8232928096 small code optimization and simplification 2015-09-23 19:25:07 +00:00
Stanislav Shwartsman
c44cb6ed81 more cases applicable for BX_TLB_ENTRY_OF 2015-09-22 20:10:22 +00:00
Stanislav Shwartsman
49e1b69502 added svn id tag for tlb.h 2015-09-21 20:07:51 +00:00
Stanislav Shwartsman
a66ed15d26 added missing tlb.h 2015-09-21 20:07:06 +00:00
Stanislav Shwartsman
be4b73c6d2 extracted tlb specific code to tlb.h; extracted xsave cpuid leaf function to base cpuid class 2015-09-21 13:16:17 +00:00
Volker Ruppert
2232dd23d6 USB floppy sector read timing implemented based on the drive speed 300 RPM.
It can be used when asynchronous packet handling is available. Some changes in
the non-async read and write code.
TODO: sector write timing, seek timing (similar to legacy floppy).
2015-09-20 10:53:16 +00:00
Volker Ruppert
6cbd6e247a USB floppy command FORMAT UNIT implemented and read commands fixed. Formatting
media in USB floppy works now with XP guest.
2015-09-19 12:45:54 +00:00
Volker Ruppert
12cace4c5a Some work on async packet and seek emulation support.
- deactivate seek timer when operation is cancelled.
- set async packet mode with a separate method at connection time.
- renamed some variables and prepared seek emulation for USB disk writes.
2015-09-16 17:08:50 +00:00
Volker Ruppert
0b432b313f Added seek emulation support for USB harddisk reads and cleaned up the
MSD / SCSI code.
TODO list (async packet and seek support):
- seek emulation for USB harddisk write commands
- seek emulation for floppy
- async packet support for UHCI and xHCI
- improve and clean up OHCI async packet code
2015-09-15 17:55:32 +00:00
Stanislav Shwartsman
c8cf4f956d fix halt cpu indication from debugger 2015-09-14 19:17:20 +00:00
Volker Ruppert
491dc311ca Some work for asynchronus USB packet handling (needed by disk/cdrom seek emulation).
- Common USB code prepared for async USB packet handling (ported from an earlier
  Qemu version).
- Added simple async packet handling to OHCI (partly ported from earlier Qemu).
- Implemented USB cdrom seek emulation for hubs with async packet support. The
  legacy code is still present for hubs without this feature.
- For UHCI and xHCI the callback is set to NULL to force the usage of the
  legacy cdrom read code.
TODO: clean up OHCI code, async support for UHCI and xHCI, seek emulation for
USB harddisk and floppy.
2015-09-13 20:04:41 +00:00
Volker Ruppert
8db5305b18 Updated MSVC workspaces after adding USB floppy support. 2015-09-12 08:06:20 +00:00
Stanislav Shwartsman
da39e57196 comment fixes 2015-09-08 19:14:58 +00:00
Volker Ruppert
6dbd4c37a9 Some USB debug output (packet dump) changes
- rewrite of usb_dump_packet(), execute code only if debug output is enabled.
- OHCI: removed packet dump, it should be done in the devices code if necessary.
2015-09-06 06:54:07 +00:00
Volker Ruppert
a536aa8286 Fixed format capacities list for the "no medium" case. 2015-09-05 11:35:05 +00:00
Volker Ruppert
f54feb5b91 Some variables should not be handled by the xHCI internal save/restore, moving
them out of the hub structure.
Fixed a warning.
2015-09-05 07:23:25 +00:00
Volker Ruppert
b69e40d584 The USB host controllers have no asynchronus packet completion support yet.
TODO: implement this feature (useful for cdrom, disk and floppy devices).
2015-09-05 06:30:28 +00:00
Volker Ruppert
4b83f9e899 If the debug mode is enabled for usb_msd, turn it on for the SCSI device, too,
Don't try to insert cdrom media if device/image path is empty.
2015-09-03 18:54:51 +00:00
Stanislav Shwartsman
f76b972fed bugfix in call gate handling from call far instruction - found with rdos 2015-09-02 19:14:47 +00:00
Volker Ruppert
b5355d3ba7 Added infos and example for the USB floppy to the documentation. 2015-09-01 19:01:37 +00:00
Volker Ruppert
44d0e8f911 Added media change support for the USB floppy. 2015-08-31 20:51:54 +00:00
Volker Ruppert
c136fa1618 Added framework for USB floppy media change support based on the USB cdrom
code (not yet functional).
Minor related changes in the USB cdrom code.
2015-08-30 08:37:27 +00:00
Volker Ruppert
2dbfae1b1c Fixes and improvements for the USB cdrom runtime options.
- Add a special list to the MSD state and add pointers to the runtime-only
  options for the cdrom. The restore handler of this list calls runtime_config()
  to make sure the media path and status are correctly updated.
- Registering a runtime config handler for the USB cdrom is not necessary since
  runtime_config() is always called from the hub it is connected to.
- Restore a string parameter value only if it's different from the initial one.
2015-08-29 14:02:13 +00:00
Volker Ruppert
946a6bf50e Fixed USB device disconnect: clear save/restore list before deleting device
(bug found with valgrind).
2015-08-28 18:52:54 +00:00
Volker Ruppert
7da8cfa4b0 Fixed save/restore support of the USB subsystem when using an external hub
with devices conected at runtime.
- Added restore handler support for the bx_list_c class. If a handler is
  registered, it will be called after restoring all of the list's members.
- USB hub: add special lists to the port state and add pointers to the
  runtime-only options for each port. The restore handler of this list calls
  init_device() to make sure all connected devices can be restored.
- Call restore_logopts() after restoring hardware to make sure all saved
  modules have been created.
- TODO: the USB cdrom also needs a fix for it's runtime-only options.
2015-08-28 17:37:38 +00:00
Volker Ruppert
cc3020ab53 Added support for connecting USB floppy without media present.
Fixed status indicator activity.
TODO: add media change support without disconnect.
2015-08-24 20:26:08 +00:00
Volker Ruppert
38fbdaa7e8 Added runtime config handler for the USB cdrom and modified parameter handling
similar to the ATAPI implementation (including locked tray case).
Fixed status indicator activity and minor other changes.
2015-08-23 16:09:24 +00:00
Volker Ruppert
1df014a8ae Implemented unregister mechanism for runtime config handlers.
TODO: use it for removable devices with removable media (USB floppy / cdrom).
2015-08-23 07:04:56 +00:00
Volker Ruppert
f7726990f2 Fixed MTRR setup for memory size > 4 GB. 2015-08-22 06:19:13 +00:00
Volker Ruppert
22c674ef7a Fixed MTRR setup for memory size > 4 GB. 2015-08-22 06:18:38 +00:00
Volker Ruppert
9596717f3c Fixed MTRR setup for memory size > 4 GB. 2015-08-22 06:17:39 +00:00
Volker Ruppert
1ac159ba52 Modified sleep rate in conversion thread to get more continuous output. 2015-08-18 17:26:25 +00:00
Volker Ruppert
792c5bdec2 Set default device speed for floppy, cdrom and disk to 'full'. 2015-08-16 16:15:46 +00:00
Volker Ruppert
823ba769fb Some work on the USB floppy emulation.
- Removed USB device type handling from constructor and init code, since we
  only the 'floppy' type here.
- Write commands now using the device buffer for one sector.
TODO: support for starting without media and runtime media change.
2015-08-16 06:44:16 +00:00
Volker Ruppert
5bc1717adc Removed the data tranfer limit for read/write commands.
- The read buffer is now limited to 16 sectors and the read commands can fill
  it multiple times until all sectors have been read.
- The write commands are currently not using the device buffer, so no panic
  should happen here.
2015-08-14 17:43:25 +00:00
Volker Ruppert
639f361d02 Fix the fix: force a status bar update after registering an item, too. 2015-08-11 17:48:18 +00:00
Volker Ruppert
16fb8317bd Fixed parameter handler issues found with runtime changes while cdrom tray locked.
- bx_param_num_c: set the value returned from the handler.
- bx_param_string_c: set the new value after processing the handler.
- harddrv param handler: check lock state of cdrom and modify value if true.
2015-08-10 18:44:16 +00:00
Volker Ruppert
8a1e31ef08 Added common USB device option "debug" to turn on BX_DEBUG reporting at
connection time.
Fixed USB floppy capacity entries for 1.44 MB (last LBA, not LBA count).
2015-07-31 19:01:09 +00:00
Volker Ruppert
46d2c0adad Started implementing save/restore support for the USB floppy.
Fixed status indicator handling in case of connect failure.
2015-07-28 18:44:08 +00:00
Stanislav Shwartsman
250cf02981 x86-64: Fixed bug in OR_EqGqM handler used with FS or GS segment 2015-07-26 19:20:21 +00:00
Volker Ruppert
5e714cdd34 Handle illegal and unimplemented cases of the 'verify' command. 2015-07-26 06:48:55 +00:00
Volker Ruppert
fa5353698d CMOS boot setup moved to the floppy init code to make Bochs BIOS boot work in
case no harddrv plugin is loaded (no ata controller enabled). The floppy and
boot parameters are only set up if no CMOS image is enabled.
2015-07-26 06:48:33 +00:00
Volker Ruppert
20aeed208b Fixed some panics when Bochs is used without the harddrv plugin (ata* disabled).
TODO: Fix Bochs BIOS for that case (SeaBIOS is okay).
2015-07-15 10:20:22 +00:00
Volker Ruppert
87d40fe673 Some work on the status LED support for removable devices.
- Force a status bar update after unregistering an item.
- Added status indicators for USB disk and cdrom.
- Handle USB device disconnect in the runtime config handler, too.
2015-07-13 21:57:09 +00:00
Stanislav Shwartsman
f6af0443bb small optimization and elimination of several defines from cpu.h - replace by inline functions and const variables 2015-07-13 20:24:14 +00:00
Volker Ruppert
3986a0b703 Extended status bar LED feature to support dynamic indicators for removable
devices like USB disk, cdrom or floppy. Using this feature for the new USB
floppy. Removed static indicators for port activity from the USB HC code.
TODO: Implement status LEDs for USB disk and cdrom.
2015-07-13 16:56:06 +00:00
Volker Ruppert
6161ffea73 Added initial version of UFI/CBI floppy disk storage device support written
by Ben Lunt. To connect a USB floppy you can use the 'floppy' device with the
path to the image separated with a colon. VVFAT is also supported.
FIXME: The device detection fails on some recent Linux distributions.
FIXME: Only 1.44M media format is currently supported.
TODO: Media change without disconnect is not implemented yet.
2015-07-13 08:37:45 +00:00
Stanislav Shwartsman
ea255b5bf7 fixed VMCS memory type calculation 2015-07-12 20:10:43 +00:00
Stanislav Shwartsman
129db3bfaf fixed typo in the list of the vmcs exits 2015-07-12 15:26:34 +00:00
Volker Ruppert
9b0af67606 Added static variable 'vvfat_count' for generating a unique FAT ID. 2015-07-12 14:46:00 +00:00