Commit Graph

2290 Commits

Author SHA1 Message Date
Volker Ruppert
21643ff419 Some work on the USB EHCI emulation
- added a hack to make EHCI work in Bochs, but without asynchronous packet
  support (tested with "high-speed" USB disk).
- added missing list for connected USB device state.
2016-11-13 20:57:57 +00:00
Volker Ruppert
b95ca006b8 Some work on the USB xHCI emulation
- fixed some of the endianness issues
- fixed some of the GCC warnings
- changed some BX_INFO to BX_DEBUG
- FIXME: non-bulk devices not yet working on xHCI. Linux guest hangs during boot
  when HID or hub device is connected.
2016-11-13 09:22:25 +00:00
Volker Ruppert
17b4e65bef The save/restore list for USB devices is now cleared by the device destructor
instead of the hub's remove_device() method. The external hub removes connected
devices before clearing it's own list. This fixes crash on exit when devices
are present on external hub.
2016-11-12 14:17:46 +00:00
Volker Ruppert
364bf9362c Changed handling of unsupported/invalid device speed setup. The UHCI core now
ignores connected high speed device (fixes panic with EHCI on guest OS init or
shutdown). The other HC's now panic and disconnect device if the user decides
to continue.
2016-11-11 16:11:52 +00:00
Volker Ruppert
6ba530e461 Ported most of the remaining EHCI methods to Bochs, including some ugly hacks.
Asynchronous transfers are not yet working properly (tested with USB disk device
in high speed mode). That's why the support for "speed:high" is still disabled.
Since we have no test case for the isosynchronous mode, I have not yet ported
the main code for it.
2016-11-07 21:57:56 +00:00
Volker Ruppert
5458e66f85 Added USB device method 'find_device' required for EHCI. No functional changes yet. 2016-08-20 14:20:07 +00:00
Volker Ruppert
cd68194269 Added Android host platform support to Bochs based on SF patch #534.
- added Android case to the configure script.
- renamed file memory.h to memory-bochs.h to fix conflict with NDK.
- fixed Android issues in some files.
2016-08-12 17:06:14 +00:00
Stanislav Shwartsman
7cf38247e4 fixed warnings and errors which pop up when compiling Bochs with TRUE bool as boolean type instead of Bit32u 2016-06-01 20:29:44 +00:00
Volker Ruppert
fc41b20dfe Applied current state of porting EHCI from Qemu. No functional changes yet. 2016-05-16 17:25:29 +00:00
Volker Ruppert
45232b1860 Added standard bus mouse support and inproved existing InPort mouse support
(Ben Lunt). Added new mouse type choice 'inport' for the existing one and changed
'bus' type to the new standard bus mouse,
2016-03-31 17:24:34 +00:00
Volker Ruppert
ce7afe050f Applied current state of porting EHCI from Qemu. No functional changes yet. 2016-02-09 17:11:59 +00:00
Volker Ruppert
60d5aaaacf Added QEMU queue macros (required for EHCI) as a separate file. Removed already
existing defines from the Slirp compatibility header.
2016-01-08 18:58:27 +00:00
Volker Ruppert
0ba744b9fe Started implementing USB EHCI support. The PCI and MMIO register behaviour is
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.
2015-12-06 20:03:42 +00:00
Volker Ruppert
5e635a87bb Fixed IRQ sharing for multi-function PCI devices and removed workaround in the
UHCI core code.
2015-11-28 10:24:22 +00:00
Volker Ruppert
93f9584b1b Load USB core plugin before parsing bochsrc, since USB HC devices depend on
it's symbols. Unload this plugin in the devices init if unused.
TODO: Similar changes may be required for the networking and sound stuff.
2015-11-20 18:07:27 +00:00
Volker Ruppert
e19f28dad7 Call DEV_pci_set_irq() only if the IRQ level really changes. The Bochs IRQ
routing code is possibly buggy, since it can make multiple UHCI devices fail
in a multi-function device (like EHCI).
2015-11-12 21:45:44 +00:00
Volker Ruppert
2f94f55a82 Some work in the UHCI core for the usage as a companion controller of EHCI.
- added method to change port ownership.
- fixed UHCI reset and initialized device pointers.
- added symbol UHCI_FULL_DEBUG to reduce debug output if not set.
- renamed connection handling method.
2015-11-08 18:54:30 +00:00
Volker Ruppert
d455659bd1 Split the USB UHCI code in two parts: uhci_core.cc implements the device
emulation and usb_uhci.cc implements the setup for the PIIX3 chipset and the
runtime device change code. The UHCI core is required for the EHCI emulation,
since there can be multiple "companion" controllers for USB 1.1 device handling.
2015-11-05 21:20:54 +00:00
Volker Ruppert
aefccb14ab Added support for registering master PCI devices with function > 0 (required
for implementing EHCI).
2015-11-04 16:32:16 +00:00
Volker Ruppert
76c065dd89 Fixed usage of MSD device on xHCI hub.
- implemented xHCI TRB command "Reset Device".
- fixed SCSI read/write commands in non-async mode.
2015-11-02 21:36:38 +00:00
Volker Ruppert
c2b790809d Simplify xHCI code, since the capability registers are readonly.
- Moved initialization from reset_hc() to init().
- Removed save/restore registration.
- Removed extra debug output.
2015-11-01 08:55:03 +00:00
Volker Ruppert
be304bf4af Definition of maximum nuber of USB ports moved from bochs.h to device. 2015-10-31 15:12:36 +00:00
Volker Ruppert
234f10f159 The OHCI async support works fine in all tests, so some BX_INFO messages
can be changed now to BX_DEBUG.
2015-10-26 20:23:33 +00:00
Volker Ruppert
7cf7ee8293 Block device detection fixes for Linux.
- now using macro S_ISBLK() to detect block device (cdrom/hdimage).
- re-implemented recently removed check for block device in concat mode.
2015-10-25 17:02:12 +00:00
Volker Ruppert
cbd147fca3 Fixed and improved text mode CO40.
- vgacore: double font and screen width at half dot clock.
- X gui: improved font bitmap generation to support width > 9.
- win32 gui: adjust values to use existing stretching feature.
- guis rfb, sdl, sdl2, vncsrv and wx: double pixels if font width > 9.
2015-10-24 22:03:51 +00:00
Volker Ruppert
fcf9b8285b Added seek emulation for USB disk write commands (async mode required).
Fixed MSD status handling (required for seek emulation).
2015-10-22 18:13:59 +00:00
Volker Ruppert
3c7260a01b Improved panic message for unavailable image mode.
Removed disabled code in the 'sparse' section.
2015-10-18 07:13:56 +00:00
Volker Ruppert
2420ba499e Fixed 'concat' mode lseek() for whence != SEEK_SET. 2015-10-17 14:08:23 +00:00
Volker Ruppert
141aea5f1b Fixed and improved 'concat' disk image mode. 2015-10-17 10:06:36 +00:00
Volker Ruppert
c3397b15d7 Fixed read() and write() methods of most disk images modes to support multiple
sector transfers (buffer pointer update was missing). Multiple sectors transfers
could for the USB disk emulation and for image conversion with bximage.
2015-10-15 17:21:34 +00:00
Volker Ruppert
708e946cb8 As a workaround for possibly buggy hdimage code, read() and write() calls
transfer only one disk sector. Moved disk write code to the seek_complete()
method (seek emulation for write commands is not ready yet).
2015-10-13 19:49:09 +00:00
Volker Ruppert
b22023838c Completed save/restore support for the USB xHCI device.
TODO: reduce size of saved file (find a way to skip unused slots).
2015-10-11 17:07:18 +00:00
Volker Ruppert
3fc71ec131 Now using BXRS_* macros for all USB devices.
TODO: This should be used everywhere in register_state() if possible.
2015-10-11 07:33:22 +00:00
Volker Ruppert
eed2bb15b8 Simplified register_state() for for small byte arrays in remaining i/o devices. 2015-10-06 18:20:16 +00:00
Volker Ruppert
9bc8651328 Extended functionality of class bx_shadow_data_c to simplify saving small byte
arrays. Changed register_state() code in a few devices to use this feature.
TODO: Use this feature in all devices with small byte arrays.
2015-10-05 18:09:58 +00:00
Volker Ruppert
12915a48f2 Added missing update of 'curr_lba' for the harddisk read seek emulation.
Added comments to the MSD / SCSI members similar to usb_cbi.
Now using BXRS_* macros for save/restore.
2015-10-04 08:54:36 +00:00
Volker Ruppert
b754d72ab2 Some work on the USB disk/cdrom emulation.
- More accurate seek emulation for read commands.
- Moved status indicator code to the SCSI layer.
- Fixed dump size for async packets.
TODO: Seek emulation for disk write commands.
2015-10-03 07:19:48 +00:00
Volker Ruppert
256fd99d12 USB floppy "format unit" timing implemented similar to read/write timing.
Added latency time for the "implied seek" of read/write/format commands. Both
features can be used when asynchronous packet handling is available. Some
related changes in the non-async read and write code.
2015-09-28 18:15:18 +00:00
Volker Ruppert
71774c57bb Some work on the USB floppy emulation.
- Added support for changing image mode at runtime (flat <-> vvfat).
- Added device buffer to save/restore list.
2015-09-27 15:02:38 +00:00
Volker Ruppert
b22a57d4df Some work on the USB floppy emulation.
- Added missing update of the write protection flag after runtime config.
- Added sense codes for invalid cases of some commands.
- Added buffer pointer save/restore handling and use BXRS macros now.
2015-09-27 08:32:54 +00:00
Volker Ruppert
e8d045ad30 USB floppy sector write timing implemented similar to read timing. It can be
used when asynchronous packet handling is available. Some changes in the
non-async read and write code.
TODO: seek timing (similar to legacy floppy).
2015-09-26 09:19:56 +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
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
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