Initial start of the USB Debugger (#165)
This is the start of the Experimental USB Debugger (currently for the Windows platform only). Currently only supports the UHCI and xHCI controllers. The remaining function of these two controllers and the two remaining controllers are in the works and will be added to when time allows. The User.dbk has been updated with (temporary) html files at https://www.fysnet.net/bochs/user/index.html showing the process to invoke and use the USB debugger (Section 5.8). In its completion, this debugger will allow you to view and modify most aspects of the specified USB controller. For example, currently you can view and modify a TRB listed in the xHCI's Command or Event Ring. Other aspects will be added. I do not use and am not fluent in the use of `configure`, `configure.ac`, and associated configuration files. I also don't use the `gui/Makefile.in` file. Someone that is more fluent in the way these files work, please add the necessary items to successfully compile this PR. --------- Co-authored-by: Shwartsman <stanislav.shwartsman@intel.com>
This commit is contained in:
parent
167bc2f450
commit
557976bee1
@ -1281,6 +1281,23 @@ speaker: enabled=1, mode=sound, volume=15
|
||||
#usb_xhci: port1=disk, options1="speed:super, path:hdd.img, proto:uasp"
|
||||
#usb_xhci: port3=disk, options3="speed:high, path:hdd.img, proto:uasp"
|
||||
|
||||
#=======================================================================
|
||||
# USB Debugger:
|
||||
# This is the experimental USB Debugger for the Windows Platform.
|
||||
# Specify a type (none, uhci, ohci, ehci, xhci) and one or more triggers.
|
||||
# (Currently, only xhci is supported, with some uhci in the process)
|
||||
# Triggers:
|
||||
# reset: will break and load the debugger on a port reset
|
||||
# enable: will break and load the debugger on a port enable
|
||||
# start_frame: will break and load the debugger on start of frame
|
||||
# (this is different for each controller type)
|
||||
# doorbell: will break and load the debugger a xHCI Command Ring addition
|
||||
# event: will break and load the debugger on a xHCI Event Ring addition
|
||||
# non_exist: will break and load the debugger on a non-existant port access
|
||||
# (experimental and is under development)
|
||||
#=======================================================================
|
||||
#usb_debug: type=xhci, reset, enable, start_frame, doorbell, event, non_exist
|
||||
|
||||
#=======================================================================
|
||||
# PCIDEV:
|
||||
# PCI host device mapping
|
||||
|
39
bochs/.conf.win32-cygwin-debugger
Normal file
39
bochs/.conf.win32-cygwin-debugger
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# These are the steps I typically use to configure and compile Bochs
|
||||
# on a Win32 system with Cygwin (v1.7.28) or MinGW/MSYS.
|
||||
#
|
||||
|
||||
CC="gcc"
|
||||
CXX="g++"
|
||||
#CFLAGS="-O3 -Wall -Wno-format -mno-cygwin" # for GCC versions < 4.7
|
||||
CFLAGS="-O3 -Wall -Wno-format -mno-ms-bitfields"
|
||||
CXXFLAGS="$CFLAGS"
|
||||
|
||||
export CC
|
||||
export CXX
|
||||
export CFLAGS
|
||||
export CXXFLAGS
|
||||
|
||||
./configure --enable-sb16 \
|
||||
--enable-ne2000 \
|
||||
--enable-all-optimizations \
|
||||
--enable-cpu-level=6 \
|
||||
--enable-x86-64 \
|
||||
--enable-vmx=2 \
|
||||
--enable-avx \
|
||||
--enable-pci \
|
||||
--enable-clgd54xx \
|
||||
--enable-voodoo \
|
||||
--enable-usb \
|
||||
--enable-usb-ohci \
|
||||
--enable-usb-ehci \
|
||||
--enable-usb-xhci \
|
||||
--enable-busmouse \
|
||||
--enable-es1370 \
|
||||
--enable-e1000 \
|
||||
--enable-show-ips \
|
||||
--with-win32 --with-rfb --with-nogui \
|
||||
--enable-debugger \
|
||||
--enable-debugger-gui \
|
||||
${CONFIGURE_ARGS}
|
@ -26,6 +26,7 @@ Brief summary :
|
||||
- USB: xHCI: added the ability to have more than one model of xHCI hardware. Currently there are two.
|
||||
- USB: Added experimental MSD UASP emulation
|
||||
- USB: Added OHCI as an EHCI Companion option. Now allows UHCI or OHCI specified as a configuration parameter.
|
||||
- USB: Added the USB Debugger support for xHCI and UHCI
|
||||
- Disk images: Allows large VHD image files
|
||||
- Fixed and enhanced the Floppy Disk emulation, VGA emulation fixes
|
||||
- Expand maximum resolution for Banshee and Voodoo 3 from 1600x1280 to 1920x1440
|
||||
@ -213,6 +214,7 @@ Detailed change log :
|
||||
- xHCI: added checks to the Evaluate Context and Address Device commands.
|
||||
- xHCI: fixed/updated the Port Status Change Event emulation.
|
||||
- xHCI: fixed/updated the port bandwidth emulation.
|
||||
- Now includes the USB Debugger support for the xHCI and UHCI controllers.
|
||||
- Many documentation additions.
|
||||
|
||||
- Networking
|
||||
|
@ -234,6 +234,12 @@ ports
|
||||
(same options as ports.usb.uhci)
|
||||
model
|
||||
n_ports
|
||||
usb_debug
|
||||
type
|
||||
reset
|
||||
enable
|
||||
start_frame
|
||||
non_exist
|
||||
|
||||
network
|
||||
ne2k
|
||||
|
@ -31,6 +31,9 @@
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
#include "iodev/usb/usb_common.h"
|
||||
#endif
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/win32usb.h"
|
||||
#endif
|
||||
#include "param_names.h"
|
||||
#include <assert.h>
|
||||
|
||||
@ -1664,6 +1667,47 @@ void bx_init_options()
|
||||
#endif
|
||||
// parallel / serial / USB options initialized in the device plugin code
|
||||
|
||||
// usb debugging
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
static const char *usb_debug_type[] = { "none", "uhci", "ohci", "ehci", "xhci", NULL };
|
||||
bx_list_c *usb_debug = new bx_list_c(root_param, "usb_debug", "USB Debug Options");
|
||||
new bx_param_enum_c(usb_debug,
|
||||
"type", "HC type",
|
||||
"Select Host Controller type",
|
||||
usb_debug_type, 0, 0);
|
||||
new bx_param_bool_c(usb_debug,
|
||||
"reset", "trigger on reset",
|
||||
"Trigger on Reset",
|
||||
0
|
||||
);
|
||||
new bx_param_bool_c(usb_debug,
|
||||
"enable", "trigger on enable",
|
||||
"Trigger on Enable",
|
||||
0
|
||||
);
|
||||
new bx_param_num_c(usb_debug,
|
||||
"start_frame", "trigger on start of frame",
|
||||
"Trigger on start of frame",
|
||||
BX_USB_DEBUG_SOF_NONE, BX_USB_DEBUG_SOF_TRIGGER,
|
||||
BX_USB_DEBUG_SOF_NONE
|
||||
);
|
||||
new bx_param_bool_c(usb_debug,
|
||||
"doorbell", "trigger on doorbell",
|
||||
"Trigger on Doorbell",
|
||||
0
|
||||
);
|
||||
new bx_param_bool_c(usb_debug,
|
||||
"event", "trigger on event",
|
||||
"Trigger on Event",
|
||||
0
|
||||
);
|
||||
new bx_param_bool_c(usb_debug,
|
||||
"non_exist", "trigger on non exist",
|
||||
"Trigger on write to non-existant port",
|
||||
0
|
||||
);
|
||||
#endif
|
||||
|
||||
#if BX_NETWORKING
|
||||
// network subtree
|
||||
bx_list_c *network = new bx_list_c(root_param, "network", "Network Configuration");
|
||||
@ -2230,6 +2274,34 @@ int get_floppy_type_from_image(const char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
static Bit32s parse_usb_debug_options(const char *context, int num_params, char *params[])
|
||||
{
|
||||
for (int i=1; i<num_params; i++) {
|
||||
if (!strncmp(params[i], "type=", 5)) {
|
||||
SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->set_by_name(¶ms[i][5]);
|
||||
} else if (!strcmp(params[i], "reset")) {
|
||||
SIM->get_param_bool(BXPN_USB_DEBUG_RESET)->set(1);
|
||||
} else if (!strcmp(params[i], "enable")) {
|
||||
SIM->get_param_bool(BXPN_USB_DEBUG_ENABLE)->set(1);
|
||||
} else if (!strcmp(params[i], "start_frame")) {
|
||||
SIM->get_param_num(BXPN_USB_DEBUG_START_FRAME)->set(BX_USB_DEBUG_SOF_SET);
|
||||
} else if (!strcmp(params[i], "doorbell")) {
|
||||
SIM->get_param_bool(BXPN_USB_DEBUG_DOORBELL)->set(1);
|
||||
} else if (!strcmp(params[i], "event")) {
|
||||
SIM->get_param_bool(BXPN_USB_DEBUG_EVENT)->set(1);
|
||||
} else if (!strcmp(params[i], "non_exist")) {
|
||||
SIM->get_param_bool(BXPN_USB_DEBUG_NON_EXIST)->set(1);
|
||||
} else {
|
||||
PARSE_ERR(("%s: %s directive malformed.", context, params[i]));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Bit32s parse_log_options(const char *context, int num_params, char *params[])
|
||||
{
|
||||
int level, action, i;
|
||||
@ -3321,6 +3393,29 @@ static int parse_line_formatted(const char *context, int num_params, char *param
|
||||
}
|
||||
#else
|
||||
PARSE_WARN(("%s: Bochs is not compiled with iodebug support", context));
|
||||
#endif
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
} else if (!strcmp(params[0], "usb_debug")) {
|
||||
if (num_params < 2) {
|
||||
PARSE_ERR(("%s: usb_debug directive malformed.", context));
|
||||
}
|
||||
// check that we haven't already defined the type
|
||||
// we can only debug one controller at a time
|
||||
Bit32s type = SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get();
|
||||
if (type > 0) {
|
||||
PARSE_ERR(("%s: usb_debug: type='%s' previously defined.", context,
|
||||
SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get_choice(type)));
|
||||
}
|
||||
if (parse_usb_debug_options(context, num_params, params) < 0) {
|
||||
return -1;
|
||||
}
|
||||
// we currently only support the xHCI controller type, so give
|
||||
// an error if it is something else.
|
||||
type = SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get();
|
||||
if ((type == USB_DEBUG_OHCI) || (type == USB_DEBUG_EHCI)) {
|
||||
PARSE_ERR(("%s: usb_debug: type='%s' not supported yet.", context,
|
||||
SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get_choice(type)));
|
||||
}
|
||||
#endif
|
||||
} else if (!strcmp(params[0], "load32bitOSImage")) {
|
||||
PARSE_ERR(("%s: load32bitOSImage: This legacy feature is no longer supported.", context));
|
||||
|
@ -812,6 +812,11 @@ typedef Bit32u bx_phy_address;
|
||||
#error To enable EHCI, you must also enable UHCI
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
// set to 1 to include the USB DEBUG CONFIG Interface
|
||||
#define BX_USE_WIN32USBDEBUG 0
|
||||
#endif
|
||||
|
||||
// MS bus mouse support
|
||||
#define BX_SUPPORT_BUSMOUSE 0
|
||||
|
||||
|
110
bochs/configure
vendored
110
bochs/configure
vendored
@ -869,6 +869,7 @@ DLLTOOL
|
||||
EXPORT_DYNAMIC
|
||||
CI_SUPPORT_OBJS
|
||||
CI_PLUGIN_OBJS
|
||||
USB_DBG_OBJS
|
||||
ENH_DBG_OBJS
|
||||
CXXFLAGS_CONSOLE
|
||||
BXHUB_LINK_OPTS
|
||||
@ -1085,6 +1086,7 @@ enable_usb
|
||||
enable_usb_ohci
|
||||
enable_usb_ehci
|
||||
enable_usb_xhci
|
||||
enable_win32usbdbg
|
||||
enable_ne2000
|
||||
enable_pnic
|
||||
enable_e1000
|
||||
@ -1826,6 +1828,8 @@ Optional Features:
|
||||
--enable-usb-ohci enable USB OHCI support (no)
|
||||
--enable-usb-ehci enable USB EHCI support (no)
|
||||
--enable-usb-xhci enable USB xHCI support (no)
|
||||
--enable-win32usbdbg compile in support for Bochs Win32 USB debugger
|
||||
(yes, if debugger is on and USB is on)
|
||||
--enable-ne2000 enable NE2000 support (no)
|
||||
--enable-pnic enable PCI pseudo NIC support (no)
|
||||
--enable-e1000 enable Intel(R) Gigabit Ethernet support (no)
|
||||
@ -6164,7 +6168,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 6167 "configure"' > conftest.$ac_ext
|
||||
echo '#line 6171 "configure"' > conftest.$ac_ext
|
||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -7661,11 +7665,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7664: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7668: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:7668: \$? = $ac_status" >&5
|
||||
echo "$as_me:7672: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -7895,11 +7899,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7898: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7902: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:7902: \$? = $ac_status" >&5
|
||||
echo "$as_me:7906: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -7963,11 +7967,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7966: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7970: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:7970: \$? = $ac_status" >&5
|
||||
echo "$as_me:7974: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -9758,7 +9762,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 9761 "configure"
|
||||
#line 9765 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -9853,7 +9857,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 9856 "configure"
|
||||
#line 9860 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11971,11 +11975,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:11974: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:11978: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:11978: \$? = $ac_status" >&5
|
||||
echo "$as_me:11982: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -12039,11 +12043,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:12042: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:12046: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:12046: \$? = $ac_status" >&5
|
||||
echo "$as_me:12050: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -13062,7 +13066,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 13065 "configure"
|
||||
#line 13069 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13157,7 +13161,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 13160 "configure"
|
||||
#line 13164 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13977,11 +13981,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13980: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13984: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:13984: \$? = $ac_status" >&5
|
||||
echo "$as_me:13988: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -14045,11 +14049,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14048: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14052: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:14052: \$? = $ac_status" >&5
|
||||
echo "$as_me:14056: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -16013,11 +16017,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:16016: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:16020: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:16020: \$? = $ac_status" >&5
|
||||
echo "$as_me:16024: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -16247,11 +16251,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:16250: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:16254: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:16254: \$? = $ac_status" >&5
|
||||
echo "$as_me:16258: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -16315,11 +16319,11 @@ else $as_nop
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:16318: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:16322: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:16322: \$? = $ac_status" >&5
|
||||
echo "$as_me:16326: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -18110,7 +18114,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18113 "configure"
|
||||
#line 18117 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -18205,7 +18209,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18208 "configure"
|
||||
#line 18212 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -19975,7 +19979,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 19978 "configure"
|
||||
#line 19982 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -23478,6 +23482,7 @@ fi
|
||||
|
||||
|
||||
|
||||
gui_debugger=0
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking enable Bochs internal debugger GUI" >&5
|
||||
printf %s "checking enable Bochs internal debugger GUI... " >&6; }
|
||||
# Check whether --enable-debugger-gui was given.
|
||||
@ -24703,6 +24708,40 @@ fi
|
||||
|
||||
|
||||
|
||||
usb_debugger=0
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking enable Bochs Win32 USB debugger" >&5
|
||||
printf %s "checking enable Bochs Win32 USB debugger... " >&6; }
|
||||
# Check whether --enable-win32usbdbg was given.
|
||||
if test ${enable_win32usbdbg+y}
|
||||
then :
|
||||
enableval=$enable_win32usbdbg; if test "$enableval" = yes; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
printf "%s\n" "yes" >&6; }
|
||||
usb_debugger=1
|
||||
else
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
|
||||
|
||||
usb_debugger=0
|
||||
fi
|
||||
else $as_nop
|
||||
|
||||
if test "$bx_debugger" = 1 -a "$use_usb" = 1; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
printf "%s\n" "yes" >&6; }
|
||||
usb_debugger=1
|
||||
else
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
|
||||
|
||||
usb_debugger=0
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
networking=no
|
||||
NETDEV_OBJS=''
|
||||
@ -26519,6 +26558,21 @@ printf "%s\n" "$as_me: WARNING: The Bochs debugger gui cannot be compiled here,
|
||||
fi
|
||||
|
||||
|
||||
USB_DBG_OBJS=""
|
||||
if test "$usb_debugger" = 1; then
|
||||
if test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then
|
||||
USB_DBG_OBJS="win32usb.o"
|
||||
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The USB debugger supported only for Win32 cannot be compiled here, disabling it" >&5
|
||||
printf "%s\n" "$as_me: WARNING: The USB debugger supported only for Win32 cannot be compiled here, disabling it" >&2;}
|
||||
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
CI_PLUGIN_OBJS="textconfig.o"
|
||||
EXPORT_DYNAMIC="-export-dynamic"
|
||||
case $target in
|
||||
|
@ -830,6 +830,7 @@ AC_ARG_ENABLE(debugger,
|
||||
)
|
||||
AC_SUBST(DEBUGGER_VAR)
|
||||
|
||||
gui_debugger=0
|
||||
AC_MSG_CHECKING(enable Bochs internal debugger GUI)
|
||||
AC_ARG_ENABLE(debugger-gui,
|
||||
AS_HELP_STRING([--enable-debugger-gui], [compile in support for Bochs internal debugger GUI (yes, if debugger is on)]),
|
||||
@ -1649,6 +1650,29 @@ fi
|
||||
AC_SUBST(USBHC_OBJS)
|
||||
AC_SUBST(USBHC_DLL_TARGETS)
|
||||
|
||||
usb_debugger=0
|
||||
AC_MSG_CHECKING(enable Bochs Win32 USB debugger)
|
||||
AC_ARG_ENABLE(win32usbdbg,
|
||||
AS_HELP_STRING([--enable-win32usbdbg], [compile in support for Bochs Win32 USB debugger (yes, if debugger is on and USB is on)]),
|
||||
[if test "$enableval" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
usb_debugger=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
|
||||
usb_debugger=0
|
||||
fi],
|
||||
[
|
||||
if test "$bx_debugger" = 1 -a "$use_usb" = 1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
usb_debugger=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
|
||||
usb_debugger=0
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
networking=no
|
||||
NETDEV_OBJS=''
|
||||
@ -2903,6 +2927,18 @@ if test "$gui_debugger" = 1; then
|
||||
fi
|
||||
AC_SUBST(ENH_DBG_OBJS)
|
||||
|
||||
USB_DBG_OBJS=""
|
||||
if test "$usb_debugger" = 1; then
|
||||
if test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then
|
||||
USB_DBG_OBJS="win32usb.o"
|
||||
AC_DEFINE(BX_USE_WIN32USBDEBUG, 1)
|
||||
else
|
||||
AC_MSG_WARN([The USB debugger supported only for Win32 cannot be compiled here, disabling it])
|
||||
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(USB_DBG_OBJS)
|
||||
|
||||
CI_PLUGIN_OBJS="textconfig.o"
|
||||
EXPORT_DYNAMIC="-export-dynamic"
|
||||
case $target in
|
||||
|
@ -3815,7 +3815,7 @@ The start address is optional, since it can be calculated from image size.
|
||||
The Bochs BIOS currently supports only the option "fastboot" to skip the
|
||||
boot menu delay.
|
||||
</para>
|
||||
<para><command>flash_dats</command></para>
|
||||
<para><command>flash_data</command></para>
|
||||
<para>
|
||||
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
|
||||
@ -5025,8 +5025,8 @@ available in the runtime configuration.
|
||||
<para>
|
||||
The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is
|
||||
sent to a file specified in the 'file' option with the options<replaceable>X</replaceable>
|
||||
parameter. The current code appends the PCL code to the file if the file already
|
||||
existed. The output file can be changed at runtime.
|
||||
parameter. Note that an existing file will be over-written when Bochs starts
|
||||
again. The output file can be changed at runtime.
|
||||
</para>
|
||||
<para>
|
||||
The options<replaceable>X</replaceable> parameter can also be used to assign
|
||||
@ -5098,6 +5098,8 @@ The options<replaceable>X</replaceable> parameter is also available on OHCI.</pa
|
||||
<para>
|
||||
Example:
|
||||
<screen>
|
||||
usb_ehci: enabled=1, companion=uhci
|
||||
usb_ehci: enabled=1, companion=ohci
|
||||
usb_ehci: enabled=1, port1=tablet, options1="speed:high"
|
||||
usb_ehci: enabled=1, port1=disk, options1="speed:high, path:hdd.img, proto:bbb"
|
||||
usb_ehci: enabled=1, port1=disk, options1="speed:high, path:hdd.img, proto:uasp"
|
||||
@ -5105,9 +5107,17 @@ Example:
|
||||
usb_ehci: enabled=1, port1=cdrom, options1="speed:high, path:bootcd.iso, proto:uasp"
|
||||
</screen>
|
||||
This option controls the presence of the USB EHCI host controller with a
|
||||
6-port hub. The port<replaceable>X</replaceable> parameter accepts the same device types with the same
|
||||
6-port root hub. The port<replaceable>X</replaceable> parameter accepts the same device types with the same
|
||||
syntax as the UHCI controller (see the <link linkend="bochsopt-usb-uhci">usb_uhci option</link>).
|
||||
The options<replaceable>X</replaceable> parameter is also available on EHCI.</para>
|
||||
The options<replaceable>X</replaceable> parameter is also available on EHCI.
|
||||
</para>
|
||||
<para>
|
||||
The EHCI will default to three UHCI companion controllers, but you can specify either UHCI or OHCI.
|
||||
</para>
|
||||
<para>
|
||||
Either companion with allocate there first two ports to the first companion, the second pair to the next
|
||||
companion, and the last pair to the third companion. Currently, there is no way to change this.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-xhci"><title>usb_xhci</title>
|
||||
@ -5115,7 +5125,9 @@ The options<replaceable>X</replaceable> parameter is also available on EHCI.</pa
|
||||
Example:
|
||||
<screen>
|
||||
usb_xhci: enabled=1, model="uPD720202", n_ports=4
|
||||
usb_xhci: enabled=1, port1="disk:usbdisk.img" # defaults to the BBB protocol
|
||||
usb_xhci: port1="disk:usbdisk.img" # defaults to super-speed
|
||||
usb_xhci: port3="disk:usbdisk.img" # defaults to high-speed
|
||||
usb_xhci: port1="speed:super, disk:usbdisk.img" # defaults to the BBB protocol
|
||||
usb_xhci: port1=disk, options1="speed:super, path:usbdisk.img, proto:uasp"
|
||||
usb_xhci: port1=disk, options1="speed:super, path:usbdisk.img, proto:bbb"
|
||||
usb_xhci: port1=cdrom, options1="speed:super, path:bootcd.iso, proto:uasp"
|
||||
@ -5149,6 +5161,79 @@ On an xHCI, the number of ports used is the number of port register sets, one se
|
||||
protocol and a paired set for the USB2 protocol. An 'n_ports=' specification of 4 defines
|
||||
<emphasis>two</emphasis> physical sockets.
|
||||
</para></note>
|
||||
<para>
|
||||
Since the register sets are paired on the xHCI, for example if you have 2 sockets (4 register sets),
|
||||
Bochs has Port 1 and Port 3 paired. Port 1 is for Super-speed devices while Port 3 is for high-,
|
||||
full-, and low-speed devices. With this in mind, if you have a device on Port 1, you <emphasis>must
|
||||
not</emphasis> have a device on Port 3. If you have a (super-speed) device on Port 1 and a (non-super-speed)
|
||||
device on Port 3, Bochs will Panic with a string similar to:
|
||||
<screen>
|
||||
>>PANIC<< Port #3: Paired port number #1 already in use.
|
||||
</screen>
|
||||
</para>
|
||||
<para>
|
||||
With an example of 4 register sets (ports), this means there are only 2 physical sockets. You may
|
||||
only have two devices at a time. To remedy the above Panic, take the following in mind:
|
||||
</para>
|
||||
<para>
|
||||
<table frame='all'><title>Valid Port definitions (4-port example)</title>
|
||||
<?dbhtml table-width="50%" ?>
|
||||
<tgroup cols='5' align='left' colsep='1' rowsep='1'>
|
||||
<colspec colname='c1' colwidth='100pt'>
|
||||
<colspec colname='c2' colwidth='175pt'>
|
||||
<colspec colname='c3' colwidth='175pt'>
|
||||
<colspec colname='c4' colwidth='175pt'>
|
||||
<colspec colname='c5' colwidth='175pt'>
|
||||
<thead>
|
||||
<row>
|
||||
<entry align="center">Scenario</entry>
|
||||
<entry align="center">Port 1 (Paired with Port 3)</entry>
|
||||
<entry align="center">Port 2 (Paired with Port 4)</entry>
|
||||
<entry align="center">Port 3 (Paired with Port 1)</entry>
|
||||
<entry align="center">Port 4 (Paired with Port 2)</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="center">1</entry>
|
||||
<entry align="center">Super</entry>
|
||||
<entry align="center">Super</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">none</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center">2</entry>
|
||||
<entry align="center">Super</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">High/Full/Low</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center">3</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">Super</entry>
|
||||
<entry align="center">High/Full/Low</entry>
|
||||
<entry align="center">none</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center">4</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">none</entry>
|
||||
<entry align="center">High/Full/Low</entry>
|
||||
<entry align="center">High/Full/Low</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-debug"><title>usb debug</title>
|
||||
<para>
|
||||
See <xref linkend="bochsopt-usb-debugger"> for this item.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section><title>pcidev</title>
|
||||
@ -6343,7 +6428,10 @@ byte 3: WWWWWWWW 8-bit Wheel displacement (-127 -> 127)
|
||||
Using the 'model:xxxx" parameter, you can set the mouse to report a different type packet. See below.
|
||||
</para>
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'low', 'full', or 'high'. (see model 'm388phy')
|
||||
This device may be used on all Host Controller types using a speed of 'low', 'full', or 'high' (see model 'm388phy').
|
||||
<note><para>
|
||||
Only one mouse/tablet device may be used at one time per emulation session.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=mouse, options1="speed:low" # default report packet shown above
|
||||
usb_ohci: enabled=1, port1=mouse, options1="speed:full, model:m228" # 3-byte report packet, 2 button, 8-bits
|
||||
@ -6428,11 +6516,11 @@ byte 6: WWWWWWWW 8-bit Wheel displacement (-128 -> 127)
|
||||
This report is deliberately irregular by design, so that a Guest can test its HID Report Descriptor Parser.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para> - the button fields are not consecutive and are at arbitrary positions in the report.</para></listitem>
|
||||
<listitem><para> - the coords fields are not byte aligned or consecutively spaced.</para></listitem>
|
||||
<listitem><para> - the coords fields are of an irregular size, each a different size.</para></listitem>
|
||||
<listitem><para> - there are padding fields between entries that <command>do not</command> align the next field on a byte boundary.</para></listitem>
|
||||
<listitem><para> - this also uses the push/pop mechanism to test the function of your parser.</para></listitem>
|
||||
<listitem><para> the button fields are not consecutive and are at arbitrary positions in the report.</para></listitem>
|
||||
<listitem><para> the coords fields are not byte aligned or consecutively spaced.</para></listitem>
|
||||
<listitem><para> the coords fields are of an irregular size, each a different size.</para></listitem>
|
||||
<listitem><para> there are padding fields between entries that <command>do not</command> align the next field on a byte boundary.</para></listitem>
|
||||
<listitem><para> this also uses the push/pop mechanism to test the function of your parser.</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Again, this is deliberate. A correctly written parser will extract the neccessary fields no matter the irregularity.</para>
|
||||
<para>Returns the 5-byte packet shown below.</para>
|
||||
@ -6449,9 +6537,15 @@ Please note that this model is not for normal use. It is <command>intentionally<
|
||||
</section>
|
||||
|
||||
<section><title>mouse: misc</title>
|
||||
<para>
|
||||
Please note that most physical USB mice will be 'low-speed' only.
|
||||
</para>
|
||||
<note><para>
|
||||
Note that most physical USB mice will be 'low-speed' only.
|
||||
</para></note>
|
||||
<note><para>
|
||||
Note that the mouse is known to not function correctly in a Windows 2000 Guest. Clearing HANDLE_TOGGLE_CONTROL to zero
|
||||
in usb_common.h and rebuilding Bochs allows this guest to function more regularly, though there are still some issues.
|
||||
Since the USB mouse and keyboard work in all other regulary tested Guests, it must be a quirk with Win2k that needs to
|
||||
be investigated.
|
||||
</para></note>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@ -6493,6 +6587,9 @@ byte 0: 00000LLL Lock States
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'low', 'full',
|
||||
or 'high'.
|
||||
<note><para>
|
||||
Only one keyboard/keypad device may be used at one time per emulation session.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=keyboard, options1="speed:low"
|
||||
usb_ohci: enabled=1, port1=keyboard, options1="speed:full"
|
||||
@ -6523,6 +6620,9 @@ Only the key range noted before will be sent via the USB emulation.
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'low', 'full',
|
||||
or 'high'.
|
||||
<note><para>
|
||||
Only one keyboard/keypad device may be used at one time per emulation session.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=keypad, options1="speed:low"
|
||||
usb_ohci: enabled=1, port1=keypad, options1="speed:full"
|
||||
@ -6555,6 +6655,9 @@ Please note that the X and Y Displacement values are absolute, not relative valu
|
||||
</para></note>
|
||||
This device may be used on all Host Controller types using a speed of 'low', 'full',
|
||||
or 'high'.
|
||||
<note><para>
|
||||
Only one mouse/tablet device may be used at one time per emulation session.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=tablet, options1="speed:low"
|
||||
usb_ohci: enabled=1, port1=tablet, options1="speed:full"
|
||||
@ -6577,6 +6680,10 @@ high- and super-speed devices, you can specify the "UASP" protocol, also known a
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'full', 'high',
|
||||
or 'super'.
|
||||
<note><para>
|
||||
Any number of disk/CD-ROM devices may be used as long as there is an available HC/Hub port,
|
||||
and that each instance uses its own image file, i.e.: image files cannot be shared.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=disk, options1="speed:full, path:hdd.img" # defaults to the BBB protocol
|
||||
usb_ohci: enabled=1, port1=disk, options1="speed:full, path:hdd.img"
|
||||
@ -6602,7 +6709,7 @@ Specifying 'proto:uasp' does not guarantee that the Guest will use that protocol
|
||||
See a <link linkend="bochsopt-usb-uhci">previous section</link> for more information.
|
||||
</para></note>
|
||||
<note><para>
|
||||
Please note that this device is not allowed as a low-speed only device. Low-speed should be specified.
|
||||
Please note that this device is not allowed as a low-speed only device. Low-speed should not be specified.
|
||||
</para></note>
|
||||
</para>
|
||||
</section>
|
||||
@ -6610,11 +6717,15 @@ Please note that this device is not allowed as a low-speed only device. Low-spee
|
||||
<section><title>Floppy</title>
|
||||
<para>
|
||||
This emulates a media device in the form of an external Floppy drive. By default,
|
||||
the emulation uses the "Control/Bulk/Interrupt" transport, aka "CBI". Bochs can be
|
||||
re-compiled to use the "Control/Bulk" transport, aka "CB".
|
||||
the emulation uses the "Control/Bulk/Interrupt" transport, aka "CBI". A compile-time option can be
|
||||
given to use the "Control/Bulk" transport, aka "CB".
|
||||
</para>
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'full'.
|
||||
<note><para>
|
||||
Any number of floppy devices may be used as long as there is an available HC/Hub
|
||||
port, and that each instance uses its own image file, i.e.: image files cannot be shared.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=floppy, options1="speed:full, path:floppy.img"
|
||||
usb_ohci: enabled=1, port1=floppy, options1="speed:full, path:floppy.img, model:teac"
|
||||
@ -6629,19 +6740,36 @@ usb_uhci: enabled=1, port1=floppy, options1="speed:full, path:<emphasis>mode</em
|
||||
The 'model:teac' option can be used to emulate that specific model, else a default
|
||||
model will be used. If a guest does not see the attached floppy, try specifying the 'teac'
|
||||
model.
|
||||
</para>
|
||||
<para>
|
||||
The 'nofail' option can be used to disable the INQUIRY quirk. This quirk is enabled by default.
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=floppy, options1="speed:full, path:floppy.img, nofail"
|
||||
</screen>
|
||||
To be consistant with real hardware, we need to fail with a STALL twice for any command after the first
|
||||
INQUIRY command except for the INQUIRY command itself and the REQUEST SENSE command. (I don't know why,
|
||||
and will document further when I know more.)
|
||||
</para>
|
||||
<para>
|
||||
Bochs allows more than one USB floppy devices to be used at one time, one on each available port.
|
||||
Each will be displayed in the status bar, the first as USB-FD1, the second as USB-FD2, etc.
|
||||
</para>
|
||||
<note><para>
|
||||
Please note that this device is a full-speed only device. No other speed should be specified.
|
||||
</para></note>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section><title>Printer</title>
|
||||
<para>
|
||||
This emulates a simple USB printer. All data sent to the printer will be appended
|
||||
This emulates a simple USB printer. All data sent to the printer will be written
|
||||
to a specified file on the Host.
|
||||
</para>
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'full'.
|
||||
<note><para>
|
||||
Any number of printer devices may be used as long as there is an available HC/Hub port,
|
||||
and that each instance uses its own target file, i.e.: target files cannot be shared.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=printer, options1="speed:full, file:printdata.bin"
|
||||
usb_ohci: enabled=1, port1=printer, options1="speed:full, file:printdata.bin"
|
||||
@ -6661,6 +6789,9 @@ changed, with a range of 2 to 8.
|
||||
</para>
|
||||
<para>
|
||||
This device may be used on all Host Controller types using a speed of 'full'.
|
||||
<note><para>
|
||||
Any number of hub devices may be used as long as there is an available HC/Hub port.
|
||||
</para></note>
|
||||
<screen>
|
||||
usb_uhci: enabled=1, port1=hub, options1="speed:full"
|
||||
usb_ohci: enabled=1, port1=hub, options1="speed:full, ports:4"
|
||||
@ -6727,10 +6858,183 @@ interface has problems when double-quotes are used. Therefore, don't use them in
|
||||
runtime configuration interface.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
When adjusting an xHCI port within the runtime configuration, you must remove a device
|
||||
from a companion port before adding to the other associated port. For example, if port
|
||||
1 and port 3 are paired and you currently have something on port 3, you must remove it
|
||||
from port 3, continue the emulation, then come back and add something to port 1. You cannot
|
||||
remove something from port 3 and add something to port 1 at the same time.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The USB emulation has been tested on numerous Guests. You can find these results at
|
||||
<ulink url="http://www.fysnet.net/bochs/images/supported.htm">here</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-debugger"><title>USB Debugger</title>
|
||||
<para>
|
||||
<emphasis>This debugger implementation is experimental. Please take caution when using it.</emphasis>
|
||||
</para>
|
||||
<para>
|
||||
<screen>
|
||||
usb_debug: type=none|uhci|ohci|ehci|xhci, reset, enable, start_frame, doorbell, event, non_exist
|
||||
</screen>
|
||||
</para>
|
||||
<para>
|
||||
Currently only <emphasis>none</emphasis>, <emphasis>uhci</emphasis>, or <emphasis>xhci</emphasis> can be specified as the type.
|
||||
Future additions will include the other two controller types.
|
||||
</para>
|
||||
<para>
|
||||
Only one type may be specified. You can only debug one controller type at a time.
|
||||
</para>
|
||||
<para>
|
||||
<screen>
|
||||
triggers: (one or more must be specified)
|
||||
'reset' -- When the controller resets a port, the debugger will halt the emulation and display
|
||||
the debugger. This does not include when the HC gets reset, which in turn would reset
|
||||
the downstream ports.
|
||||
The debugger is triggered at the write of the port before the port value is updated by the write.
|
||||
'enable' -- When the controller enables a port, the debugger will halt the emulation and display
|
||||
the debugger. For an EHCI port, the controller automatically enables the port when
|
||||
a high-speed device is detected.
|
||||
The debugger is triggered at the write of the port before the port value is updated by the write.
|
||||
'start_frame' -- When the controller starts a new frame, the debugger will halt the emulation
|
||||
and display the debugger. Please note that the implementation of this feature is/will
|
||||
be different with each controller type. Also, if the frame is not active, this trigger will
|
||||
never be called. i.e.: In the UHCI, if the schedule is not in the RUN state, this trigger will
|
||||
not be active.
|
||||
-- uhci: Load the next Frame Index and process the TD/Queue pointed by it.
|
||||
-- ohci: ** TODO **
|
||||
-- ehci: ** TODO **
|
||||
-- xhci: Start/Continue to process Transfer Rings.
|
||||
'doorbell' -- When the xHCI controller receives a doorbell ring indicator (for the Command Ring),
|
||||
the debugger will halt the emulation and display the debugger.
|
||||
-- When the EHCI controller is to execute a single TD, the debugger will halt the
|
||||
emulation and display the debugger.
|
||||
-- When the OHCI controller is to execute a single TD, the debugger will halt the
|
||||
emulation and display the debugger.
|
||||
-- When the UHCI controller is to execute a single TD, the debugger will halt the
|
||||
emulation and display the debugger.
|
||||
'event' -- When the xHCI controller posts an event on the event ring, the debugger will
|
||||
halt the emulation and display the debugger. This is only used in the xHCI controller
|
||||
type. Other types will ignore this trigger.
|
||||
'non_exist' -- When the guest writes to a non-existent port, the debugger will halt the emulation
|
||||
and display the debugger. This is so you can trigger the debugger via software.
|
||||
Write to the first non-existent port and the debugger will be triggered.
|
||||
Reads have no affect.
|
||||
</screen>
|
||||
</para>
|
||||
<para>
|
||||
The USB Debugger also has a button-bar icon that when clicked will trigger the debugger. However, please
|
||||
note that if the debugger is currently unavailable, due to the controller state for example, the icon
|
||||
will change to squiggly lines and then at the next available controller state, the debugger will display.
|
||||
If the icon has an 'X' through it, the debugger is unavailable.
|
||||
</para>
|
||||
<para>
|
||||
If you modify any value within the debugger's display, any change that might trigger a change to
|
||||
the controller's state will take place. For example, if you change the Current Connect Status
|
||||
<emphasis>and</emphasis> the Current Enable Status, both will be triggered at the same time by
|
||||
the controller. To keep this from happening, change one and hit the Apply Button. Then trigger
|
||||
the debugger again and change another.
|
||||
</para>
|
||||
<para>
|
||||
When the Debugger dialog is displayed, you can view/modify different aspects of the controller, the
|
||||
controller root hub ports, as well as other items. For example, with the xHCI debugger, you can view
|
||||
and modify TRBs on the Command Ring. Simply set the 'doorbell' trigger, and when a doorbell is written,
|
||||
the emulation will stop and display the current Command Ring with any available TRBs.
|
||||
</para>
|
||||
<para>
|
||||
You can turn off or on any trigger (listed above) while within the Debugger dialog. If all of them
|
||||
are off, you can use the Ribbon Trigger button to display the Debugger, then set any triggers active.
|
||||
</para>
|
||||
<para>
|
||||
The figure below is an example of an xHCI controller using the Doorbell trigger to stop when the
|
||||
Controller receives a TRB in the Command Ring with the Command Ring Doorbell being triggered.
|
||||
<figure><title>USB Debugger Example0</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="../images/usb_debugger0.png">
|
||||
</imageobject>
|
||||
<textobject><phrase>USB Debugger Example 0</phrase></textobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
The three register sets are displayed allowing you to modify their values. Please note that modifying
|
||||
the Capability Register set will produce undefined results. It is recommended that you do not modify
|
||||
this register set.
|
||||
</para>
|
||||
<para>
|
||||
The Debug Flags box allows you to set or clear a trigger. If the checkbox is checked, the trigger is active.
|
||||
</para>
|
||||
<para>
|
||||
The Port Register set displays the used registers allowing you to modify them as you see fit. Again, undefined
|
||||
results may happen if you modify these registers.
|
||||
</para>
|
||||
<para>
|
||||
The Tree List shows the current TRB list of the Command Ring. Notice that six TRBs have already been executed.
|
||||
(You should have had the Debugger triggered six times already). The TRB listed in bold is the current TRB to
|
||||
be executed. If you select that item and then click the "View TRB" button, you can modify the TRB before the
|
||||
controller has a chance to execute it. Note that you cannot change the TRB's type, though you can modify its
|
||||
attributes.
|
||||
</para>
|
||||
<para>
|
||||
The "Continue" button will exit the debugger and continue the emulation. The "Quit" button will quit the entire
|
||||
emulation.
|
||||
</para>
|
||||
|
||||
<section id="bochsopt-usb-debugger-xhci"><title>USB Debugger: xHCI</title>
|
||||
<para>
|
||||
Notes on the xHCI USB Debugger will go here.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-debugger-ehci"><title>USB Debugger: EHCI</title>
|
||||
<para>
|
||||
Notes on the EHCI USB Debugger will go here.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-debugger-ohci"><title>USB Debugger: OHCI</title>
|
||||
<para>
|
||||
Notes on the OHCI USB Debugger will go here.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-usb-debugger-uhci"><title>USB Debugger: UHCI</title>
|
||||
<para>
|
||||
When the 'doorbell' trigger is used, the debugger will trigger before the controller processes the TD *and* again
|
||||
after the controller processes the TD. This is so you can see the TD before it is processed, allowing you to make
|
||||
changes, and then see the results. Please note that the *before* and *after* status only effects the currently
|
||||
executing TD. All other TDs have either already been executed or have not yet been executed.
|
||||
</para>
|
||||
<para>
|
||||
Changing the 'Active' bit before the controller processes the TD is not allowed since the controller has already
|
||||
found the TD active and is processing it. Changing it after the controller has processed it is allowed, but why
|
||||
would you?
|
||||
</para>
|
||||
<para>
|
||||
Changing any items in a TD *after* the TD has been processed is not recommended and undefined results may occur.
|
||||
</para>
|
||||
<para>
|
||||
You normally would not have both the 'start_frame' and 'doorbell' triggers active when using the UHCI. If they
|
||||
are, the 'doorbell' trigger will trigger the first TD in the frame anyway. The 'start_frame' trigger is only used
|
||||
when you want to see the frame's list once at start of frame. The 'doorbell' trigger is used on every active TD found.
|
||||
</para>
|
||||
<para>
|
||||
If the TD is using BreadthFirst processing, the debugger will not display any TDs linked by the LINK PTR. This is
|
||||
because some drivers point the LINK PTR to itself to make sure the TD is executed. If the TD is executed, the active
|
||||
bit will be clear, so the next TD will be processed anyway.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter id="common-problems">
|
||||
|
@ -70,7 +70,7 @@ CI_OBJS_WIN32 = win32config.o
|
||||
CI_OBJS_WIN32_SUPPORT = win32paramdlg.o scrollwin.o
|
||||
|
||||
GUI_DLL_TARGETS = @GUI_DLL_TARGETS@
|
||||
OBJS_THAT_CANNOT_BE_PLUGINS = keymap.o gui.o siminterface.o paramtree.o @ENH_DBG_OBJS@
|
||||
OBJS_THAT_CANNOT_BE_PLUGINS = keymap.o gui.o siminterface.o paramtree.o @ENH_DBG_OBJS@ @USB_DBG_OBJS@
|
||||
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
@ -318,6 +318,14 @@ win32paramdlg.o: win32paramdlg.@CPP_SUFFIX@ win32dialog.h ../config.h ../bochs.h
|
||||
../config.h ../osdep.h ../gui/paramtree.h ../logio.h \
|
||||
../misc/bswap.h siminterface.h \
|
||||
win32res.h
|
||||
win32usb.o: win32usb.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../gui/paramtree.h ../logio.h ../misc/bswap.h win32dialog.h ../config.h \
|
||||
../iodev/iodev.h ../plugin.h ../extplugin.h ../param_names.h \
|
||||
../pc_system.h ../bx_debug/debug.h ../osdep.h ../cpu/decoder/decoder.h \
|
||||
../memory/memory-bochs.h ../gui/siminterface.h ../gui/gui.h \
|
||||
win32usbres.h win32usb.h ../iodev/usb/usb_common.h \
|
||||
../iodev/usb/usb_pcap.h ../iodev/usb/uhci_core.h ../iodev/usb/usb_uhci.h \
|
||||
../iodev/usb/usb_xhci.h
|
||||
wx.o: wx.@CPP_SUFFIX@ ../config.h ../bochs.h ../config.h ../osdep.h \
|
||||
../gui/paramtree.h ../logio.h \
|
||||
../misc/bswap.h ../param_names.h \
|
||||
@ -439,6 +447,14 @@ win32paramdlg.lo: win32paramdlg.@CPP_SUFFIX@ win32dialog.h ../config.h ../bochs.
|
||||
../config.h ../osdep.h ../gui/paramtree.h ../logio.h \
|
||||
../misc/bswap.h siminterface.h \
|
||||
win32res.h
|
||||
win32usb.lo: win32usb.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../gui/paramtree.h ../logio.h ../misc/bswap.h win32dialog.h ../config.h \
|
||||
../iodev/iodev.h ../plugin.h ../extplugin.h ../param_names.h \
|
||||
../pc_system.h ../bx_debug/debug.h ../osdep.h ../cpu/decoder/decoder.h \
|
||||
../memory/memory-bochs.h ../gui/siminterface.h ../gui/gui.h \
|
||||
win32usbres.h win32usb.h ../iodev/usb/usb_common.h \
|
||||
../iodev/usb/usb_pcap.h ../iodev/usb/uhci_core.h ../iodev/usb/usb_uhci.h \
|
||||
../iodev/usb/usb_xhci.h
|
||||
wx.lo: wx.@CPP_SUFFIX@ ../config.h ../bochs.h ../config.h ../osdep.h \
|
||||
../gui/paramtree.h ../logio.h \
|
||||
../misc/bswap.h ../param_names.h \
|
||||
|
48
bochs/gui/bitmaps/usb.h
Normal file
48
bochs/gui/bitmaps/usb.h
Normal file
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id:$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_USB_BMAP_X 32
|
||||
#define BX_USB_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_usb_bmap[(BX_USB_BMAP_X * BX_USB_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0x03,
|
||||
0xE0, 0xFF, 0xFF, 0x07, 0xF0, 0x01, 0x80, 0x0F, 0xF0, 0x00, 0x00, 0x0F,
|
||||
0xF0, 0x01, 0x80, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F,
|
||||
0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F,
|
||||
0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F,
|
||||
0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F,
|
||||
0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0x0F,
|
||||
0xF0, 0xFF, 0xFF, 0x0F, 0xE0, 0xFF, 0xFF, 0x07, 0xC0, 0x00, 0x00, 0x03,
|
||||
0xC0, 0x00, 0x00, 0x03, 0xC0, 0x0C, 0x30, 0x03, 0xC0, 0x0C, 0x30, 0x03,
|
||||
0xC0, 0x0C, 0x30, 0x03, 0xC0, 0x0C, 0x30, 0x03, 0xC0, 0x00, 0x00, 0x03,
|
||||
0xC0, 0xFF, 0xFF, 0x03, 0x80, 0xFF, 0xFF, 0x01
|
||||
};
|
||||
|
||||
static const unsigned char bx_usb_eject_bmap[(BX_USB_BMAP_X * BX_USB_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x40, 0xC4, 0xFF, 0xFF, 0x23,
|
||||
0xE8, 0xFF, 0xFF, 0x17, 0xE0, 0x01, 0x80, 0x07, 0xD0, 0x00, 0x00, 0x0B,
|
||||
0xB0, 0x01, 0x80, 0x0D, 0x70, 0xFF, 0xFF, 0x0E, 0xF0, 0xFE, 0x7F, 0x0F,
|
||||
0xF0, 0xFD, 0xBF, 0x0F, 0xF0, 0xFB, 0xDF, 0x0F, 0xF0, 0xF7, 0xEF, 0x0F,
|
||||
0xF0, 0xEF, 0xF7, 0x0F, 0xF0, 0xDF, 0xFB, 0x0F, 0xF0, 0xBF, 0xFD, 0x0F,
|
||||
0xF0, 0x7F, 0xFE, 0x0F, 0xF0, 0x7F, 0xFE, 0x0F, 0xF0, 0xBF, 0xFD, 0x0F,
|
||||
0xF0, 0xDF, 0xFB, 0x0F, 0xF0, 0xEF, 0xF7, 0x0F, 0xF0, 0xF7, 0xEF, 0x0F,
|
||||
0xF0, 0xFB, 0xDF, 0x0F, 0xE0, 0xFD, 0xBF, 0x07, 0xC0, 0x01, 0x80, 0x03,
|
||||
0x40, 0x00, 0x00, 0x02, 0x80, 0x0C, 0x30, 0x01, 0xE0, 0x0C, 0x30, 0x07,
|
||||
0xD0, 0x0C, 0x30, 0x0B, 0xC8, 0x0C, 0x30, 0x13, 0xC4, 0x00, 0x00, 0x23,
|
||||
0xC2, 0xFF, 0xFF, 0x43, 0x80, 0xFF, 0xFF, 0x01
|
||||
};
|
||||
|
||||
static const unsigned char bx_usb_trigger_bmap[(BX_USB_BMAP_X * BX_USB_BMAP_Y)/8] = {
|
||||
0x08, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x40, 0xC2, 0xFF, 0xFF, 0x23,
|
||||
0xE4, 0xFF, 0xFF, 0x47, 0xF8, 0x01, 0x80, 0x8F, 0xF4, 0x00, 0x00, 0x4F,
|
||||
0xF2, 0x01, 0x80, 0x2F, 0xF4, 0xFF, 0xFF, 0x4F, 0xF8, 0xFF, 0xFF, 0x8F,
|
||||
0xF4, 0xFF, 0xFF, 0x4F, 0xF2, 0xFF, 0xFF, 0x2F, 0xF4, 0xFF, 0xFF, 0x4F,
|
||||
0xF8, 0xFF, 0xFF, 0x8F, 0xF4, 0xFF, 0xFF, 0x4F, 0xF2, 0xFF, 0xFF, 0x2F,
|
||||
0xF4, 0xFF, 0xFF, 0x4F, 0xF8, 0xFF, 0xFF, 0x8F, 0xF4, 0xFF, 0xFF, 0x4F,
|
||||
0xF2, 0xFF, 0xFF, 0x2F, 0xF4, 0xFF, 0xFF, 0x4F, 0xF8, 0xFF, 0xFF, 0x8F,
|
||||
0xF4, 0xFF, 0xFF, 0x4F, 0xE2, 0xFF, 0xFF, 0x27, 0xC4, 0x00, 0x00, 0x43,
|
||||
0xC8, 0x00, 0x00, 0x83, 0xC4, 0x0C, 0x30, 0x43, 0xC2, 0x0C, 0x30, 0x23,
|
||||
0xC4, 0x0C, 0x30, 0x43, 0xC8, 0x0C, 0x30, 0x83, 0xC4, 0x00, 0x00, 0x43,
|
||||
0xC2, 0xFF, 0xFF, 0x23, 0x84, 0xFF, 0xFF, 0x41
|
||||
};
|
41
bochs/gui/bitmaps/usb.xpm
Normal file
41
bochs/gui/bitmaps/usb.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *usb_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"................................",
|
||||
"......####################......",
|
||||
".....######################.....",
|
||||
"....#####..............#####....",
|
||||
"....####................####....",
|
||||
"....#####..............#####....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
"....########################....",
|
||||
".....######################.....",
|
||||
"......##................##......",
|
||||
"......##................##......",
|
||||
"......##..##........##..##......",
|
||||
"......##..##........##..##......",
|
||||
"......##..##........##..##......",
|
||||
"......##..##........##..##......",
|
||||
"......##................##......",
|
||||
"......####################......",
|
||||
".......##################......."
|
||||
};
|
@ -33,6 +33,9 @@
|
||||
#include "gui/bitmaps/paste.h"
|
||||
#include "gui/bitmaps/configbutton.h"
|
||||
#include "gui/bitmaps/cdromd.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/bitmaps/usb.h"
|
||||
#endif
|
||||
#include "gui/bitmaps/userbutton.h"
|
||||
#include "gui/bitmaps/saverestore.h"
|
||||
|
||||
@ -232,6 +235,15 @@ void bx_gui_c::init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
|
||||
BX_GUI_THIS save_restore_bmap_id = create_bitmap(bx_save_restore_bmap,
|
||||
BX_SAVE_RESTORE_BMAP_X, BX_SAVE_RESTORE_BMAP_Y);
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
BX_GUI_THIS usb_bmap_id = create_bitmap(bx_usb_bmap,
|
||||
BX_USB_BMAP_X, BX_USB_BMAP_Y);
|
||||
BX_GUI_THIS usb_eject_bmap_id = create_bitmap(bx_usb_eject_bmap,
|
||||
BX_USB_BMAP_X, BX_USB_BMAP_Y);
|
||||
BX_GUI_THIS usb_trigger_bmap_id = create_bitmap(bx_usb_trigger_bmap,
|
||||
BX_USB_BMAP_X, BX_USB_BMAP_Y);
|
||||
#endif
|
||||
|
||||
// Add the initial bitmaps to the headerbar, and enable callback routine, for use
|
||||
// when that bitmap is clicked on. The floppy and cdrom devices are not
|
||||
// initialized yet. so we just set the bitmaps to ejected for now.
|
||||
@ -260,6 +272,25 @@ void bx_gui_c::init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
|
||||
BX_GRAVITY_LEFT, toggle_mouse_enable);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS mouse_hbar_id, "Enable mouse capture");
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
// USB button
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_USB) {
|
||||
if ((SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() > 0) && (
|
||||
SIM->get_param_bool(BXPN_UHCI_ENABLED)->get() ||
|
||||
SIM->get_param_bool(BXPN_OHCI_ENABLED)->get() ||
|
||||
SIM->get_param_bool(BXPN_EHCI_ENABLED)->get() ||
|
||||
SIM->get_param_bool(BXPN_XHCI_ENABLED)->get())) {
|
||||
BX_GUI_THIS usb_hbar_id = headerbar_bitmap(BX_GUI_THIS usb_bmap_id,
|
||||
BX_GRAVITY_LEFT, usb_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS usb_hbar_id, "Trigger the USB Debugger");
|
||||
} else {
|
||||
BX_GUI_THIS usb_hbar_id = headerbar_bitmap(BX_GUI_THIS usb_eject_bmap_id,
|
||||
BX_GRAVITY_LEFT, usb_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS usb_hbar_id, "USB support not enabled");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// These are the buttons on the right side. They are created in order
|
||||
// of right to left.
|
||||
|
||||
@ -682,6 +713,18 @@ void bx_gui_c::config_handler(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "win32usb.h"
|
||||
void bx_gui_c::usb_handler(void)
|
||||
{
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_USB) {
|
||||
// Once we set the trigger, don't allow the user to press the button again
|
||||
if (SIM->get_param_num(BXPN_USB_DEBUG_START_FRAME)->get() < BX_USB_DEBUG_SOF_TRIGGER)
|
||||
SIM->usb_config_interface(USB_DEBUG_FRAME, 0, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void bx_gui_c::toggle_mouse_enable(void)
|
||||
{
|
||||
int old = SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get();
|
||||
|
@ -26,8 +26,13 @@
|
||||
// header bar and status bar stuff
|
||||
#define BX_HEADER_BAR_Y 32
|
||||
|
||||
#define BX_MAX_PIXMAPS 17
|
||||
#define BX_MAX_HEADERBAR_ENTRIES 12
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#define BX_MAX_PIXMAPS 19
|
||||
#define BX_MAX_HEADERBAR_ENTRIES 13
|
||||
#else
|
||||
#define BX_MAX_PIXMAPS 17
|
||||
#define BX_MAX_HEADERBAR_ENTRIES 12
|
||||
#endif
|
||||
|
||||
// align pixmaps towards left or right side of header bar
|
||||
#define BX_GRAVITY_LEFT 10
|
||||
@ -42,7 +47,12 @@
|
||||
#define BX_GUI_DLG_RUNTIME 0x08
|
||||
#define BX_GUI_DLG_USER 0x10
|
||||
#define BX_GUI_DLG_SAVE_RESTORE 0x20
|
||||
#define BX_GUI_DLG_ALL 0x3F
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#define BX_GUI_DLG_USB 0x40
|
||||
#define BX_GUI_DLG_ALL 0x7F
|
||||
#else
|
||||
#define BX_GUI_DLG_ALL 0x3F
|
||||
#endif
|
||||
|
||||
// text mode blink feature
|
||||
#define BX_TEXT_BLINK_MODE 0x01
|
||||
@ -70,6 +80,13 @@
|
||||
#define BX_GUI_MT_F12 (BX_MT_KEY_F12)
|
||||
#define BX_GUI_MT_CTRL_ALT (BX_MT_KEY_CTRL | BX_MT_KEY_ALT)
|
||||
|
||||
// usb_debug items
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#define BX_USB_DEBUG_SOF_NONE 0
|
||||
#define BX_USB_DEBUG_SOF_SET 1
|
||||
#define BX_USB_DEBUG_SOF_TRIGGER 2
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
Bit16u start_address;
|
||||
Bit8u cs_start;
|
||||
@ -235,6 +252,9 @@ protected:
|
||||
static void paste_handler(void);
|
||||
static void snapshot_handler(void);
|
||||
static void config_handler(void);
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
static void usb_handler(void);
|
||||
#endif
|
||||
static void userbutton_handler(void);
|
||||
static void save_restore_handler(void);
|
||||
// process clicks on the "classic" Bochs headerbar
|
||||
@ -268,6 +288,12 @@ protected:
|
||||
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
|
||||
unsigned user_bmap_id, user_hbar_id;
|
||||
unsigned save_restore_bmap_id, save_restore_hbar_id;
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
// TODO: this is a lousy hack. we need to keep these protected....
|
||||
public:
|
||||
unsigned usb_bmap_id, usb_eject_bmap_id, usb_trigger_bmap_id, usb_hbar_id;
|
||||
protected:
|
||||
#endif
|
||||
// the "classic" Bochs headerbar
|
||||
unsigned bx_headerbar_entries;
|
||||
struct {
|
||||
|
@ -69,6 +69,9 @@ class bx_real_sim_c : public bx_simulator_interface_c {
|
||||
const char *registered_ci_name;
|
||||
config_interface_callback_t ci_callback;
|
||||
void *ci_callback_data;
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
usb_interface_callback_t usbi_callback;
|
||||
#endif
|
||||
rt_conf_entry_t *rt_conf_entries;
|
||||
addon_option_t *addon_options;
|
||||
bool init_done;
|
||||
@ -176,6 +179,10 @@ public:
|
||||
config_interface_callback_t callback,
|
||||
void *userdata);
|
||||
virtual int configuration_interface(const char* name, ci_command_t command);
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
virtual void register_usb_interface(usb_interface_callback_t callback, void *data);
|
||||
virtual int usb_config_interface(int type, int wParam, int lParam);
|
||||
#endif
|
||||
virtual int begin_simulation(int argc, char *argv[]);
|
||||
virtual int register_runtime_config_handler(void *dev, rt_conf_handler_t handler);
|
||||
virtual void unregister_runtime_config_handler(int id);
|
||||
@ -932,6 +939,27 @@ int bx_real_sim_c::configuration_interface(const char *ignore, ci_command_t comm
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
void bx_real_sim_c::register_usb_interface(usb_interface_callback_t callback, void *data)
|
||||
{
|
||||
usbi_callback = callback;
|
||||
}
|
||||
|
||||
int bx_real_sim_c::usb_config_interface(int type, int wParam, int lParam)
|
||||
{
|
||||
if (!usbi_callback) {
|
||||
BX_PANIC(("no usb interface was loaded"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
set_display_mode(DISP_MODE_CONFIG);
|
||||
int retval = (*usbi_callback)(type, wParam, lParam);
|
||||
set_display_mode(DISP_MODE_SIM);
|
||||
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
int bx_real_sim_c::begin_simulation(int argc, char *argv[])
|
||||
{
|
||||
return bx_begin_simulation(argc, argv);
|
||||
|
@ -570,6 +570,9 @@ enum ci_return_t {
|
||||
CI_ERR_NO_TEXT_CONSOLE // err: can't work because there's no text console
|
||||
};
|
||||
typedef int (*config_interface_callback_t)(void *userdata, ci_command_t command);
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
typedef int (*usb_interface_callback_t)(int type, int wParam, int lParam);
|
||||
#endif
|
||||
typedef BxEvent* (*bxevent_handler)(void *theclass, BxEvent *event);
|
||||
typedef void (*rt_conf_handler_t)(void *this_ptr);
|
||||
typedef Bit32s (*addon_option_parser_t)(const char *context, int num_params, char *params[]);
|
||||
@ -710,6 +713,10 @@ public:
|
||||
config_interface_callback_t callback,
|
||||
void *userdata) {}
|
||||
virtual int configuration_interface(const char* name, ci_command_t command) {return -1; }
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
virtual void register_usb_interface(usb_interface_callback_t callback, void *data) {}
|
||||
virtual int usb_config_interface(int type, int wParam, int lParam) { return -1; }
|
||||
#endif
|
||||
virtual int begin_simulation(int argc, char *argv[]) {return -1;}
|
||||
virtual int register_runtime_config_handler(void *dev, rt_conf_handler_t handler) {return 0;}
|
||||
virtual void unregister_runtime_config_handler(int id) {}
|
||||
|
@ -159,7 +159,7 @@ static BOOL hideIPS = FALSE;
|
||||
static char ipsText[20];
|
||||
#endif
|
||||
#define BX_SB_MAX_TEXT_ELEMENTS 2
|
||||
#define SIZE_OF_SB_ELEMENT 50
|
||||
#define SIZE_OF_SB_ELEMENT 60
|
||||
#define SIZE_OF_SB_MOUSE_MESSAGE 170
|
||||
#define SIZE_OF_SB_IPS_MESSAGE 90
|
||||
Bit32u SB_Led_Colors[3] = {0x0000FF00, 0x000040FF, 0x0000FFFF};
|
||||
@ -1218,6 +1218,13 @@ void SetMouseCapture()
|
||||
SetMouseToggleInfo();
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
BOOL GetMouseCaptureMode()
|
||||
{
|
||||
return mouseCaptureMode;
|
||||
}
|
||||
#endif
|
||||
|
||||
LRESULT CALLBACK simWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hdc, hdcMem;
|
||||
|
@ -31,6 +31,10 @@
|
||||
#include "win32res.h"
|
||||
#include "win32paramdlg.h"
|
||||
#include "plugin.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "win32usb.h"
|
||||
static int win32_usbi_callback(int type, int wParam, int lParam);
|
||||
#endif
|
||||
|
||||
#if BX_USE_WIN32CONFIG
|
||||
|
||||
@ -41,6 +45,9 @@ PLUGIN_ENTRY_FOR_MODULE(win32config)
|
||||
{
|
||||
if (mode == PLUGIN_INIT) {
|
||||
SIM->register_configuration_interface("win32config", win32_ci_callback, NULL);
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
SIM->register_usb_interface(win32_usbi_callback, NULL);
|
||||
#endif
|
||||
SIM->set_notify_callback(win32_notify_callback, NULL);
|
||||
} else if (mode == PLUGIN_PROBE) {
|
||||
return (int)PLUGTYPE_CI;
|
||||
@ -798,4 +805,34 @@ static int win32_ci_callback(void *userdata, ci_command_t command)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
static int win32_usbi_callback(int type, int wParam, int lParam) {
|
||||
if (!bx_gui->has_gui_console()) {
|
||||
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() > 0) {
|
||||
// if "start_frame" is 0, do the debug_window
|
||||
// if "start_frame" is 1, wait for the trigger from the HC
|
||||
// (set the value to 2, then return, allowing the trigger to envoke it)
|
||||
// if "start_frame" is 2, the HC triggered the debug
|
||||
if (SIM->get_param_num(BXPN_USB_DEBUG_START_FRAME)->get() == BX_USB_DEBUG_SOF_SET) {
|
||||
SIM->get_param_num(BXPN_USB_DEBUG_START_FRAME)->set(BX_USB_DEBUG_SOF_TRIGGER);
|
||||
bx_gui->replace_bitmap(bx_gui->usb_hbar_id, bx_gui->usb_trigger_bmap_id);
|
||||
} else {
|
||||
bx_gui->replace_bitmap(bx_gui->usb_hbar_id, bx_gui->usb_bmap_id);
|
||||
if (win32_usb_start(GetBochsWindow(), type, wParam, lParam) < 0) {
|
||||
bx_user_quit = 1;
|
||||
#if !BX_DEBUGGER
|
||||
bx_atexit();
|
||||
SIM->quit_sim(1);
|
||||
#else
|
||||
bx_dbg_exit(1);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // BX_USE_WIN32CONFIG
|
||||
|
3875
bochs/gui/win32usb.cc
Normal file
3875
bochs/gui/win32usb.cc
Normal file
File diff suppressed because it is too large
Load Diff
161
bochs/gui/win32usb.h
Normal file
161
bochs/gui/win32usb.h
Normal file
@ -0,0 +1,161 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 Benjamin David Lunt
|
||||
// Copyright (C) 2003-2021 The Bochs Project
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef BX_WIN32_USB_H
|
||||
#define BX_WIN32_USB_H
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
|
||||
#define COMMON_STR_SIZE 128
|
||||
|
||||
#define USB_DEBUG_NONE 0
|
||||
#define USB_DEBUG_UHCI 1
|
||||
#define USB_DEBUG_OHCI 2
|
||||
#define USB_DEBUG_EHCI 3
|
||||
#define USB_DEBUG_XHCI 4
|
||||
|
||||
int win32_usb_start(HWND hwnd, int break_type, int wParam, int lParam);
|
||||
|
||||
// USB debug break_type
|
||||
#define USB_DEBUG_FRAME 1
|
||||
#define USB_DEBUG_COMMAND 2
|
||||
#define USB_DEBUG_EVENT 3
|
||||
#define USB_DEBUG_NONEXIST 4
|
||||
#define USB_DEBUG_RESET 5
|
||||
#define USB_DEBUG_ENABLE 6
|
||||
|
||||
void win32_usb_trigger(int type, int trigger, int wParam, int lParam);
|
||||
|
||||
// lParam flags
|
||||
#define USB_LPARAM_FLAG_BEFORE 0x00000001
|
||||
#define USB_LPARAM_FLAG_AFTER 0x00000002
|
||||
|
||||
struct CALLBACK_PARAMS {
|
||||
int type;
|
||||
int break_type;
|
||||
int wParam;
|
||||
int lParam;
|
||||
};
|
||||
|
||||
struct DUMP_PARAMS {
|
||||
char title[COMMON_STR_SIZE];
|
||||
bx_phy_address address;
|
||||
int size; // amount to dump (no more than 512)
|
||||
bool big; // use 64-bit addresses?
|
||||
};
|
||||
INT_PTR CALLBACK dump_dialog_callback(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// UHCI
|
||||
//
|
||||
INT_PTR CALLBACK hc_uhci_callback(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
void hc_uhci_do_item(Bit32u FrameAddr, Bit32u FrameNum);
|
||||
int hc_uhci_init(HWND hwnd);
|
||||
int hc_uhci_save(HWND hwnd);
|
||||
void uhci_display_td(HWND hwnd);
|
||||
|
||||
INT_PTR CALLBACK hc_uhci_callback_queue(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_uhci_callback_td(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OHCI
|
||||
//
|
||||
INT_PTR CALLBACK hc_ohci_callback(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
int hc_ohci_init(HWND hwnd);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// EHCI
|
||||
//
|
||||
INT_PTR CALLBACK hc_ehci_callback(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
int hc_ehci_init(HWND hwnd);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// XHCI
|
||||
//
|
||||
#define VIEW_TRB_TYPE_NONE 0
|
||||
#define VIEW_TRB_TYPE_COMMAND 1
|
||||
#define VIEW_TRB_TYPE_EVENT 2
|
||||
#define VIEW_TRB_TYPE_TRANSFER 4
|
||||
|
||||
struct VIEW_TRB_TYPE {
|
||||
Bit8u allowed_mask;
|
||||
char name[22];
|
||||
};
|
||||
|
||||
#define MAX_TRBS_ALLOWED 4096
|
||||
|
||||
INT_PTR CALLBACK hc_xhci_callback(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
int hc_xhci_init(HWND hwnd);
|
||||
int hc_xhci_save(HWND hwnd);
|
||||
void hc_xhci_do_ring(const char *ring_str, Bit64u RingPtr, Bit64u dequeue_ptr);
|
||||
void hc_xhci_do_event_ring(const char *ring_str, int interrupter);
|
||||
void xhci_display_trb(HWND hwnd, int type_mask);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_normal(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_setup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_data(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_status(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_link(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_event(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_noop(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_enslot(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_disslot(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_address(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_configep(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_evaluate(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_resetep(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_stopep(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_settrptr(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_resetdev(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_forceevent(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_setlat(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_getband(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_forcehdr(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_transevent(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_compcompletion(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_pschange(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_bandrequ(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_doorbell(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_hostevent(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_devnotevent(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_necfw(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_necun(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_trb_necfwevent(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
INT_PTR CALLBACK hc_xhci_callback_context(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
INT_PTR CALLBACK hc_xhci_callback_str_context(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Attributes
|
||||
struct S_ATTRIBUTES {
|
||||
DWORD64 attrb;
|
||||
DWORD64 mask;
|
||||
int index;
|
||||
char str[32];
|
||||
int groups[10]; // up to 10 items can be grouped. Increase if we need more.
|
||||
};
|
||||
void do_attributes(HWND hwnd, DWORD id, const int size, const char *title, const struct S_ATTRIBUTES *attribs);
|
||||
|
||||
|
||||
#endif // BX_USE_WIN32USBDEBUG
|
||||
#endif // BX_WIN32_USB_H
|
345
bochs/gui/win32usbres.h
Normal file
345
bochs/gui/win32usbres.h
Normal file
@ -0,0 +1,345 @@
|
||||
|
||||
|
||||
#define USB_DEBUG_UHCI_DLG 3900
|
||||
#define USB_DEBUG_OHCI_DLG 3901
|
||||
#define USB_DEBUG_EHCI_DLG 3902
|
||||
#define USB_DEBUG_XHCI_DLG 3903
|
||||
|
||||
#define USB_DEBUG_UHCI_DLG_QUEUE 4000
|
||||
#define USB_DEBUG_UHCI_DLG_TD 4001
|
||||
|
||||
#define USB_DEBUG_DLG_DUMP 4010
|
||||
|
||||
|
||||
#define USB_DEBUG_XHCI_DLG_NORM_TRB 4104
|
||||
#define USB_DEBUG_XHCI_DLG_SETUP_TRB 4105
|
||||
#define USB_DEBUG_XHCI_DLG_DATA_TRB 4106
|
||||
#define USB_DEBUG_XHCI_DLG_STATUS_TRB 4107
|
||||
#define USB_DEBUG_XHCI_DLG_LINK_TRB 4108
|
||||
#define USB_DEBUG_XHCI_DLG_EVENT_TRB 4109
|
||||
#define USB_DEBUG_XHCI_DLG_NOOP_TRB 4110
|
||||
#define USB_DEBUG_XHCI_DLG_ENSLOT_TRB 4111
|
||||
#define USB_DEBUG_XHCI_DLG_DISSLOT_TRB 4112
|
||||
#define USB_DEBUG_XHCI_DLG_ADDRESS_TRB 4113
|
||||
#define USB_DEBUG_XHCI_DLG_CONFIGEP_TRB 4114
|
||||
#define USB_DEBUG_XHCI_DLG_EVALUATE_TRB 4115
|
||||
#define USB_DEBUG_XHCI_DLG_RESETEP_TRB 4116
|
||||
#define USB_DEBUG_XHCI_DLG_STOPEP_TRB 4117
|
||||
#define USB_DEBUG_XHCI_DLG_SETTRPTR_TRB 4118
|
||||
#define USB_DEBUG_XHCI_DLG_RESETDEV_TRB 4119
|
||||
#define USB_DEBUG_XHCI_DLG_FORCE_TRB 4120
|
||||
#define USB_DEBUG_XHCI_DLG_SETLAT_TRB 4121
|
||||
#define USB_DEBUG_XHCI_DLG_GETBAND_TRB 4122
|
||||
#define USB_DEBUG_XHCI_DLG_FORCEHDR_TRB 4123
|
||||
#define USB_DEBUG_XHCI_DLG_TRANSEVENT_TRB 4124
|
||||
#define USB_DEBUG_XHCI_DLG_CMNDCOMP_TRB 4125
|
||||
#define USB_DEBUG_XHCI_DLG_PSCHANGE_TRB 4126
|
||||
#define USB_DEBUG_XHCI_DLG_BANDREQU_TRB 4127
|
||||
#define USB_DEBUG_XHCI_DLG_DOORBELL_TRB 4128
|
||||
#define USB_DEBUG_XHCI_DLG_HOSTEVENT_TRB 4129
|
||||
#define USB_DEBUG_XHCI_DLG_DEVNOTEVENT_TRB 4130
|
||||
|
||||
#define USB_DEBUG_XHCI_DLG_NECFW_TRB 4140
|
||||
#define USB_DEBUG_XHCI_DLG_NECUN_TRB 4141
|
||||
#define USB_DEBUG_XHCI_DLG_NECFWEVENT_TRB 4142
|
||||
|
||||
#define IDD_ATTRIBUTE 4150
|
||||
#define USB_DEBUG_XHCI_DLG_CONTEXT 4151
|
||||
#define USB_DEBUG_XHCI_DLG_STR_CONTEXT 4152
|
||||
|
||||
#define IDC_LIST 4160
|
||||
#define IDC_CAPTION 4161
|
||||
#define IDC_DUMP 4162
|
||||
|
||||
// common to all for HCs
|
||||
#define ID_QUIT_EMU 4200
|
||||
#define ID_CONTINUE_EMU 4201
|
||||
#define IDC_PORT_ADDR 4202
|
||||
#define IDC_FRAME_ADDRESS 4203
|
||||
#define ID_APPLY 4204
|
||||
#define IDC_STACK 4205
|
||||
#define IDC_TREE_COMMENT 4206
|
||||
|
||||
#define IDC_STATIC -1
|
||||
|
||||
|
||||
// UHCI items start with 5000
|
||||
// (items that we want to trigger an EN_CHANGE must start with 5000
|
||||
// and end in 5020)
|
||||
#define IDC_U_EN_START 5000
|
||||
#define IDC_U_REG_COMMAND 5000
|
||||
#define IDC_U_REG_STATUS 5001
|
||||
#define IDC_U_REG_INTERRUPT 5002
|
||||
#define IDC_U_REG_FRAME_NUM 5003
|
||||
#define IDC_U_REG_FRAME_ADDRESS 5004
|
||||
#define IDC_U_REG_SOF 5005
|
||||
#define IDC_U_REG_PORT0 5006
|
||||
#define IDC_U_REG_PORT1 5007
|
||||
#define IDC_U_EN_END 5020
|
||||
|
||||
#define IDC_U_REG_COMMAND_B 5100
|
||||
#define IDC_U_REG_STATUS_B 5101
|
||||
#define IDC_U_REG_INTERRUPT_B 5102
|
||||
#define IDC_U_REG_PORT0_B 5103
|
||||
#define IDC_U_REG_PORT1_B 5104
|
||||
|
||||
#define IDC_U_REG_PORT0_TYPE 5140
|
||||
#define IDC_U_REG_PORT1_TYPE 5141
|
||||
|
||||
#define IDC_HORZ_PTR 5200
|
||||
#define IDC_HORZ_T 5201
|
||||
#define IDC_HORZ_Q 5202
|
||||
#define IDC_VERT_PTR 5203
|
||||
#define IDC_VERT_T 5204
|
||||
#define IDC_VERT_Q 5205
|
||||
#define IDC_VERT_VF 5206
|
||||
|
||||
#define IDC_LINK_PTR 5210
|
||||
#define IDC_LINK_T 5211
|
||||
#define IDC_LINK_Q 5212
|
||||
#define IDC_LINK_VF 5213
|
||||
#define IDC_STATUS_LS 5214
|
||||
#define IDC_ACTUAL_LEN 5215
|
||||
#define IDC_STATUS_NAK 5216
|
||||
#define IDC_STATUS_CRC 5217
|
||||
#define IDC_STATUS_BITSTUFF 5218
|
||||
#define IDC_STATUS_RSVD 5219
|
||||
#define IDC_STATUS_ACTIVE 5220
|
||||
#define IDC_STATUS_STALLED 5221
|
||||
#define IDC_STATUS_DATA_BUFF_ERR 5222
|
||||
#define IDC_STATUS_BABBLE 5223
|
||||
#define IDC_STATUS_SPD 5224
|
||||
#define IDC_STATUS_IOC 5225
|
||||
#define IDC_STATUS_ISO 5226
|
||||
#define IDC_STATUS_CERR 5227
|
||||
#define IDC_DEVICE_ADDR 5228
|
||||
#define IDC_DEVICE_EP 5229
|
||||
#define IDC_DEVICE_MAXLEN 5230
|
||||
#define IDC_DEVICE_TOGGLE 5231
|
||||
#define IDC_DEVICE_BUFFER 5232
|
||||
#define IDC_COMBO_PID 5233
|
||||
#define IDC_DUMP_BUFFER 5234
|
||||
|
||||
|
||||
|
||||
// OHCI items start with 6000
|
||||
|
||||
|
||||
|
||||
// EHCI items start with 7000
|
||||
|
||||
|
||||
|
||||
// xHCI items start with 8000
|
||||
// (items that we want to trigger an EN_CHANGE must start with 8000
|
||||
// and end in 8019)
|
||||
#define IDC_X_EN_START 8000
|
||||
#define IDC_X_REG_CAPLENGTH 8000
|
||||
#define IDC_X_REG_HCSPARAMS1 8001
|
||||
#define IDC_X_REG_HCSPARAMS2 8002
|
||||
#define IDC_X_REG_HCSPARAMS3 8003
|
||||
#define IDC_X_REG_HCCPARAMS1 8004
|
||||
#define IDC_X_REG_DBOFF 8005
|
||||
#define IDC_X_REG_RTSOFF 8006
|
||||
#define IDC_X_REG_HCCPARAMS2 8007
|
||||
#define IDC_X_REG_COMMAND 8008
|
||||
#define IDC_X_REG_STATUS 8009
|
||||
#define IDC_X_REG_PAGESIZE 8010
|
||||
#define IDC_X_REG_DEVICE_NOTE 8011
|
||||
#define IDC_X_REG_COMMAND_RING 8012
|
||||
#define IDC_X_REG_DEV_CONTEXT_BASE 8013
|
||||
#define IDC_X_REG_CONFIGURE 8014
|
||||
#define IDC_X_REG_PORT0 8015
|
||||
#define IDC_X_REG_PORT1 8016
|
||||
#define IDC_X_REG_PORT2 8017
|
||||
#define IDC_X_REG_PORT3 8018
|
||||
#define IDC_X_REG_PORT4 8019
|
||||
#define IDC_X_REG_PORT5 8020
|
||||
#define IDC_X_REG_PORT6 8021
|
||||
#define IDC_X_REG_PORT7 8022
|
||||
#define IDC_X_REG_PORT8 8023
|
||||
#define IDC_X_REG_PORT9 8024
|
||||
#define IDC_X_REG_MFINDEX 8025
|
||||
#define IDC_X_EN_END 8025
|
||||
|
||||
#define IDC_X_REG_EPORT0 8040
|
||||
#define IDC_X_REG_EPORT1 8041
|
||||
#define IDC_X_REG_EPORT2 8042
|
||||
#define IDC_X_REG_EPORT3 8043
|
||||
#define IDC_X_REG_EPORT4 8044
|
||||
#define IDC_X_REG_EPORT5 8045
|
||||
#define IDC_X_REG_EPORT6 8046
|
||||
#define IDC_X_REG_EPORT7 8047
|
||||
#define IDC_X_REG_EPORT8 8048
|
||||
#define IDC_X_REG_EPORT9 8049
|
||||
|
||||
#define IDC_X_REG_PORT0_B 8050
|
||||
#define IDC_X_REG_PORT1_B 8051
|
||||
#define IDC_X_REG_PORT2_B 8052
|
||||
#define IDC_X_REG_PORT3_B 8053
|
||||
#define IDC_X_REG_PORT4_B 8054
|
||||
#define IDC_X_REG_PORT5_B 8055
|
||||
#define IDC_X_REG_PORT6_B 8056
|
||||
#define IDC_X_REG_PORT7_B 8057
|
||||
#define IDC_X_REG_PORT8_B 8058
|
||||
#define IDC_X_REG_PORT9_B 8059
|
||||
|
||||
#define IDC_X_REG_PORT0_TYPE 8060
|
||||
#define IDC_X_REG_PORT1_TYPE 8061
|
||||
#define IDC_X_REG_PORT2_TYPE 8062
|
||||
#define IDC_X_REG_PORT3_TYPE 8063
|
||||
#define IDC_X_REG_PORT4_TYPE 8064
|
||||
#define IDC_X_REG_PORT5_TYPE 8065
|
||||
#define IDC_X_REG_PORT6_TYPE 8066
|
||||
#define IDC_X_REG_PORT7_TYPE 8067
|
||||
#define IDC_X_REG_PORT8_TYPE 8068
|
||||
#define IDC_X_REG_PORT9_TYPE 8069
|
||||
|
||||
#define IDC_X_REG_PORT0_ETYPE 8070
|
||||
#define IDC_X_REG_PORT1_ETYPE 8071
|
||||
#define IDC_X_REG_PORT2_ETYPE 8072
|
||||
#define IDC_X_REG_PORT3_ETYPE 8073
|
||||
#define IDC_X_REG_PORT4_ETYPE 8074
|
||||
#define IDC_X_REG_PORT5_ETYPE 8075
|
||||
#define IDC_X_REG_PORT6_ETYPE 8076
|
||||
#define IDC_X_REG_PORT7_ETYPE 8077
|
||||
#define IDC_X_REG_PORT8_ETYPE 8078
|
||||
#define IDC_X_REG_PORT9_ETYPE 8079
|
||||
|
||||
#define IDC_VIEW_TRB 8080
|
||||
#define IDC_VIEW_TD 8080
|
||||
|
||||
#define IDC_DEBUG_RESET 8081
|
||||
#define IDC_DEBUG_ENABLE 8082
|
||||
#define IDC_DEBUG_DOORBELL 8083
|
||||
#define IDC_DEBUG_EVENT 8084
|
||||
#define IDC_DEBUG_SOF 8085
|
||||
#define IDC_DEBUG_NONEXIST 8086
|
||||
|
||||
#define IDC_TRB_DATA_PTR 8100
|
||||
#define IDC_TRB_INT_TARGET 8101
|
||||
#define IDC_TRB_TD_SIZE 8102
|
||||
#define IDC_TRB_TRANS_LEN 8103
|
||||
#define IDC_TRB_TYPE 8104
|
||||
#define IDC_TRB_BEI 8105
|
||||
#define IDC_TRB_IDT 8106
|
||||
#define IDC_TRB_IOC 8107
|
||||
#define IDC_TRB_CH 8108
|
||||
#define IDC_TRB_NS 8109
|
||||
#define IDC_TRB_ISP 8110
|
||||
#define IDC_TRB_ENT 8111
|
||||
#define IDC_TRB_C 8112
|
||||
|
||||
#define IDC_TRB_WVALUE 8120
|
||||
#define IDC_TRB_BREQUEST 8121
|
||||
#define IDC_TRB_BREQUESTTYPE 8122
|
||||
#define IDC_TRB_WLENGTH 8123
|
||||
#define IDC_TRB_WINDEX 8124
|
||||
#define IDC_TRB_TRT 8125
|
||||
|
||||
#define IDC_TRB_DIR 8126
|
||||
#define IDC_TRB_TC 8127
|
||||
#define IDC_TRB_SLOT_TYPE 8128
|
||||
#define IDC_TRB_SLOT_ID 8129
|
||||
#define IDC_TRB_BSR 8130
|
||||
#define IDC_TRB_DECONFIG 8131
|
||||
#define IDC_TRB_EP_ID 8132
|
||||
#define IDC_TRB_TSP 8133
|
||||
#define IDC_TRB_SP 8134
|
||||
#define IDC_TRB_STREAMID 8135
|
||||
#define IDC_TRB_VF_ID 8136
|
||||
#define IDC_TRB_BELT 8137
|
||||
#define IDC_TRB_DEV_SPEED 8138
|
||||
#define IDC_TRB_SCT 8139
|
||||
#define IDC_TRB_DCS 8140
|
||||
#define IDC_TRB_HDR_HI 8141
|
||||
#define IDC_TRB_FTYPE 8142
|
||||
#define IDC_TRB_COMP_CODE 8143
|
||||
#define IDC_TRB_ED 8144
|
||||
#define IDC_TRB_COMP_LPARAM 8145
|
||||
#define IDC_TRB_COMP_HPARAM 8146
|
||||
#define IDC_TRB_NOT_TYPE 8147
|
||||
#define IDC_RING_TYPE 8148
|
||||
#define IDC_IN_CONTEXT 8149
|
||||
|
||||
// context structure
|
||||
#define IDC_CONTEXT_NEXT 8200
|
||||
#define IDC_CONTEXT_PREV 8201
|
||||
#define IDC_CONTEXT_DROP 8202
|
||||
#define IDC_CONTEXT_DROP_B 8203
|
||||
#define IDC_CONTEXT_ADD 8204
|
||||
#define IDC_CONTEXT_ADD_B 8205
|
||||
#define IDC_CONTEXT_ALT_SETTING 8206
|
||||
#define IDC_CONTEXT_INTFACE_NUM 8207
|
||||
#define IDC_CONTEXT_CONFIG_VALUE 8208
|
||||
#define IDC_CONTEXT_OF_STR 8209
|
||||
#define IDC_CONTEXT_STREAM_CONTEXT 8210
|
||||
|
||||
#define IDC_CONTEXT_ENTRIES 8220
|
||||
#define IDC_CONTEXT_HUB 8221
|
||||
#define IDC_CONTEXT_MTT 8222
|
||||
#define IDC_CONTEXT_SPEED 8223
|
||||
#define IDC_CONTEXT_ROUTE_STRING 8224
|
||||
#define IDC_CONTEXT_NUM_PORTS 8225
|
||||
#define IDC_CONTEXT_RH_PORT_NUM 8226
|
||||
#define IDC_CONTEXT_MAX_EXIT_LAT 8227
|
||||
#define IDC_CONTEXT_INT_TARGET 8228
|
||||
#define IDC_CONTEXT_TTT 8229
|
||||
#define IDC_CONTEXT_TT_PORT_NUM 8230
|
||||
#define IDC_CONTEXT_TT_HUB_SLOT_ID 8231
|
||||
#define IDC_CONTEXT_SLOT_STATE 8232
|
||||
#define IDC_CONTEXT_DEV_ADDRESS 8233
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_0 8234
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_1 8235
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_2 8236
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_3 8237
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_4 8238
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_5 8239
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_6 8240
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_7 8241
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_8 8242
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_9 8243
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_10 8244
|
||||
#define IDC_CONTEXT_RSVDO_SLOT_11 8245
|
||||
#define IDC_CONTEXT_SPEED_STR 8246
|
||||
#define IDC_CONTEXT_SLOT_STATE_STR 8247
|
||||
|
||||
#define IDC_CONTEXT_MAX_ESIT_HI 8260
|
||||
#define IDC_CONTEXT_INTERVAL 8261
|
||||
#define IDC_CONTEXT_LSA 8262
|
||||
#define IDC_CONTEXT_MAX_PSTREAMS 8263
|
||||
#define IDC_CONTEXT_MULT 8264
|
||||
#define IDC_CONTEXT_EP_STATE 8265
|
||||
#define IDC_CONTEXT_MAX_PACKET_SIZE 8266
|
||||
#define IDC_CONTEXT_MAX_BURST_SIZE 8267
|
||||
#define IDC_CONTEXT_HID 8268
|
||||
#define IDC_CONTEXT_EP_TYPE 8269
|
||||
#define IDC_CONTEXT_CERR 8270
|
||||
#define IDC_CONTEXT_TR_DEQUEUE_PTR 8271
|
||||
#define IDC_CONTEXT_DCS 8272
|
||||
#define IDC_CONTEXT_MAX_ESIT_LO 8273
|
||||
#define IDC_CONTEXT_AVERAGE_LEN 8274
|
||||
#define IDC_CONTEXT_RSVDO_EP_0 8275
|
||||
#define IDC_CONTEXT_RSVDO_EP_1 8276
|
||||
#define IDC_CONTEXT_RSVDO_EP_2 8277
|
||||
#define IDC_CONTEXT_RSVDO_EP_3 8278
|
||||
#define IDC_CONTEXT_RSVDO_EP_4 8279
|
||||
#define IDC_CONTEXT_RSVDO_EP_5 8280
|
||||
#define IDC_CONTEXT_RSVDO_EP_6 8281
|
||||
#define IDC_CONTEXT_RSVDO_EP_7 8282
|
||||
#define IDC_CONTEXT_RSVDO_EP_8 8283
|
||||
#define IDC_CONTEXT_RSVDO_EP_9 8284
|
||||
#define IDC_CONTEXT_RSVDO_EP_10 8285
|
||||
#define IDC_CONTEXT_EP_STATE_STR 8286
|
||||
#define IDC_CONTEXT_EP_TYPE_STR 8287
|
||||
#define IDC_CONTEXT_MAXPS_STR 8288
|
||||
|
||||
// string context
|
||||
#define IDC_STR_CONTEXT_DQPTR 8301
|
||||
#define IDC_STR_CONTEXT_SCT 8302
|
||||
#define IDC_STR_CONTEXT_DCS 8303
|
||||
#define IDC_STR_CONTEXT_STOPPED 8304
|
||||
#define IDC_STR_CONTEXT_RSVDO_0 8305
|
||||
#define IDC_STR_CONTEXT_RSVDO_1 8306
|
||||
#define IDC_CONTEXT_SCT_STR 8307
|
||||
|
@ -173,6 +173,9 @@ public:
|
||||
|
||||
void set_name(const char *name) {pci_name = name;}
|
||||
const char* get_name(void) {return pci_name;}
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
Bit32u get_bar_addr(int indx) const { return pci_bar[indx].addr; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
const char *pci_name;
|
||||
|
@ -36,6 +36,9 @@
|
||||
#include "pci.h"
|
||||
#include "usb_common.h"
|
||||
#include "ohci_core.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/win32usb.h"
|
||||
#endif
|
||||
|
||||
#define LOG_THIS
|
||||
|
||||
@ -796,14 +799,23 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
|
||||
|
||||
case 0x60: // HcRhPortStatus[3]
|
||||
#if (USB_OHCI_PORTS < 4)
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
case 0x5C: // HcRhPortStatus[2]
|
||||
#if (USB_OHCI_PORTS < 3)
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
case 0x58: // HcRhPortStatus[1]
|
||||
#if (USB_OHCI_PORTS < 2)
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
case 0x54: { // HcRhPortStatus[0]
|
||||
@ -816,6 +828,9 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
|
||||
if (hub.usb_port[p].HcRhPortStatus.ccs == 0)
|
||||
hub.usb_port[p].HcRhPortStatus.csc = 1;
|
||||
else {
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_ENABLE, 0, 0);
|
||||
#endif
|
||||
hub.usb_port[p].HcRhPortStatus.pes = 1;
|
||||
}
|
||||
}
|
||||
@ -832,6 +847,9 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
|
||||
if (hub.usb_port[p].HcRhPortStatus.ccs == 0)
|
||||
hub.usb_port[p].HcRhPortStatus.csc = 1;
|
||||
else {
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_RESET, 0, 0);
|
||||
#endif
|
||||
reset_port(p);
|
||||
hub.usb_port[p].HcRhPortStatus.pps = 1;
|
||||
hub.usb_port[p].HcRhPortStatus.pes = 1;
|
||||
@ -899,6 +917,9 @@ void bx_ohci_core_c::ohci_timer(void)
|
||||
Bit16u zero = 0;
|
||||
|
||||
if (hub.op_regs.HcControl.hcfs == OHCI_USB_OPERATIONAL) {
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_FRAME, 0, 0);
|
||||
#endif
|
||||
// set remaining to the interval amount.
|
||||
hub.op_regs.HcFmRemainingToggle = hub.op_regs.HcFmInterval.fit;
|
||||
hub.sof_time = bx_pc_system.time_usec();
|
||||
@ -1138,6 +1159,10 @@ int bx_ohci_core_c::process_td(struct OHCI_TD *td, struct OHCI_ED *ed, int toggl
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_OHCI, USB_DEBUG_COMMAND, 0, 0);
|
||||
#endif
|
||||
|
||||
// The td->cc field should be 111x if it hasn't been processed yet.
|
||||
if (TD_GET_CC(td) < NotAccessed) {
|
||||
BX_ERROR(("Found TD with CC value not 111x"));
|
||||
|
@ -55,6 +55,9 @@
|
||||
#include "pci.h"
|
||||
#include "usb_common.h"
|
||||
#include "uhci_core.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/win32usb.h"
|
||||
#endif
|
||||
|
||||
#define LOG_THIS
|
||||
|
||||
@ -515,6 +518,10 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
|
||||
case 0x14: // port #3 non existent, but linux systems check it to see if there are more than 2
|
||||
BX_ERROR(("write to non existent offset 0x14 (port #3)"));
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
// Non existant Register Port (the next one after the last)
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x10: // port #1
|
||||
@ -524,6 +531,10 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
// If the ports reset bit is set, don't allow any writes unless the new write will clear the reset bit
|
||||
if (hub.usb_port[port].reset && ((value & (1 << 9)) != 0))
|
||||
break;
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
if ((value & (1 << 9)) && !hub.usb_port[port].reset)
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_RESET, port, 0);
|
||||
#endif
|
||||
if (value & ((1<<5) | (1<<4) | (1<<0)))
|
||||
BX_DEBUG(("write to one or more read-only bits in port #%d register: 0x%04x", port+1, value));
|
||||
if (!(value & (1<<7)))
|
||||
@ -549,6 +560,9 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
hub.usb_port[port].reset = (value & (1<<9)) ? 1 : 0;
|
||||
hub.usb_port[port].resume = (value & (1<<6)) ? 1 : 0;
|
||||
if (!hub.usb_port[port].enabled && (value & (1<<2))) {
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_ENABLE, port, 0);
|
||||
#endif
|
||||
hub.usb_port[port].enable_changed = 0;
|
||||
} else
|
||||
if (value & (1<<3)) hub.usb_port[port].enable_changed = 0;
|
||||
@ -630,6 +644,10 @@ bool bx_uhci_core_c::uhci_add_queue(struct USB_UHCI_QUEUE_STACK *stack, const Bi
|
||||
// Called once every 1ms
|
||||
void bx_uhci_core_c::uhci_timer(void)
|
||||
{
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_FRAME, 0, 0);
|
||||
#endif
|
||||
|
||||
// If the "global reset" bit was set by software
|
||||
if (global_reset) {
|
||||
for (int i=0; i<USB_UHCI_PORTS; i++) {
|
||||
@ -752,7 +770,10 @@ void bx_uhci_core_c::uhci_timer(void)
|
||||
|
||||
// write back the status to the TD
|
||||
DEV_MEM_WRITE_PHYSICAL(address + sizeof(Bit32u), sizeof(Bit32u), (Bit8u *) &td.dword1);
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
// trigger again so that the user can see the processed packet
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_COMMAND, address, USB_LPARAM_FLAG_AFTER);
|
||||
#endif
|
||||
// we processed another td within this queue line
|
||||
td_count++;
|
||||
bytes_processed += r_actlen;
|
||||
@ -902,10 +923,14 @@ bool bx_uhci_core_c::DoTransfer(Bit32u address, struct TD *td)
|
||||
|
||||
BX_DEBUG(("TD found at address 0x%08X: 0x%08X 0x%08X 0x%08X 0x%08X", address, td->dword0, td->dword1, td->dword2, td->dword3));
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_UHCI, USB_DEBUG_COMMAND, address, USB_LPARAM_FLAG_BEFORE);
|
||||
#endif
|
||||
|
||||
// check TD to make sure it is valid
|
||||
// A max length 0x500 to 0x77E is illegal
|
||||
if ((maxlen >= 0x500) && (maxlen != 0x7FF)) {
|
||||
BX_ERROR(("invalid max. length value 0x%04x", maxlen ));
|
||||
BX_ERROR(("invalid max. length value 0x%04x", maxlen));
|
||||
return 0; // error = consistency check failure
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,9 @@ public:
|
||||
|
||||
int event_handler(int event, void *ptr, int port);
|
||||
|
||||
#if !BX_USE_WIN32USBDEBUG
|
||||
protected:
|
||||
#endif
|
||||
bx_uhci_core_t hub;
|
||||
Bit8u global_reset;
|
||||
|
||||
|
@ -48,6 +48,9 @@
|
||||
#include "ohci_core.h"
|
||||
#include "qemu-queue.h"
|
||||
#include "usb_ehci.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/win32usb.h"
|
||||
#endif
|
||||
|
||||
#define LOG_THIS theUSB_EHCI->
|
||||
|
||||
@ -1024,14 +1027,25 @@ bool bx_usb_ehci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
|
||||
BX_EHCI_THIS hub.usb_port[port].device->usb_send_msg(USB_MSG_RESET);
|
||||
BX_EHCI_THIS hub.usb_port[port].portsc.csc = 0;
|
||||
if (BX_EHCI_THIS hub.usb_port[port].device->get_speed() == USB_SPEED_HIGH) {
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_EHCI, USB_DEBUG_ENABLE, 0, 0);
|
||||
#endif
|
||||
BX_EHCI_THIS hub.usb_port[port].portsc.ped = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
if (!oldpr && BX_EHCI_THIS hub.usb_port[port].portsc.pr) {
|
||||
win32_usb_trigger(USB_DEBUG_EHCI, USB_DEBUG_RESET, 0, 0);
|
||||
}
|
||||
#endif
|
||||
if (oldfpr && !BX_EHCI_THIS hub.usb_port[port].portsc.fpr) {
|
||||
BX_EHCI_THIS hub.usb_port[port].portsc.sus = 0;
|
||||
}
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
} else if (port == USB_EHCI_PORTS) {
|
||||
win32_usb_trigger(USB_DEBUG_EHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1895,6 +1909,10 @@ int bx_usb_ehci_c::state_fetchqtd(EHCIQueue *q)
|
||||
EHCIqtd qtd;
|
||||
int again = 0;
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_EHCI, USB_DEBUG_COMMAND, 0, 0);
|
||||
#endif
|
||||
|
||||
get_dwords(NLPTR_GET(q->qtdaddr), (Bit32u*) &qtd, sizeof(EHCIqtd) >> 2);
|
||||
|
||||
EHCIPacket *p = QTAILQ_FIRST(&q->packets);
|
||||
@ -2350,6 +2368,10 @@ void bx_usb_ehci_c::ehci_frame_timer(void)
|
||||
usec_elapsed = t_now - BX_EHCI_THIS hub.last_run_usec;
|
||||
frames = (int)(usec_elapsed / FRAME_TIMER_USEC);
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_EHCI, USB_DEBUG_FRAME, 0, 0);
|
||||
#endif
|
||||
|
||||
if (BX_EHCI_THIS periodic_enabled() || (BX_EHCI_THIS hub.pstate != EST_INACTIVE)) {
|
||||
need_timer++;
|
||||
BX_EHCI_THIS hub.async_stepdown = 0;
|
||||
|
@ -70,6 +70,9 @@
|
||||
#include "pci.h"
|
||||
#include "usb_common.h"
|
||||
#include "usb_xhci.h"
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
#include "gui/win32usb.h"
|
||||
#endif
|
||||
|
||||
#define LOG_THIS theUSB_XHCI->
|
||||
|
||||
@ -850,7 +853,7 @@ bool bx_usb_xhci_c::restore_hc_state(void)
|
||||
|
||||
// get MAX_SCRATCH_PADS worth of pointers
|
||||
for (i=0; i<MAX_SCRATCH_PADS; i++) {
|
||||
DEV_MEM_READ_PHYSICAL_DMA((bx_phy_address) (addr + i * 8), 8, (Bit8u*)&temp[i]);
|
||||
DEV_MEM_READ_PHYSICAL((bx_phy_address) (addr + i * 8), 8, (Bit8u*)&temp[i]);
|
||||
}
|
||||
|
||||
// we read it in to a temp buffer just to check the crc.
|
||||
@ -1833,6 +1836,9 @@ bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
|
||||
if (((value & (1 << 31)) && BX_XHCI_THIS hub.usb_port[port].is_usb3) ||
|
||||
(value & (1 << 4))) {
|
||||
reset_port_usb3(port, (value & (1 << 4)) ? HOT_RESET : WARM_RESET);
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_RESET, 0, 0);
|
||||
#endif
|
||||
}
|
||||
} else
|
||||
BX_XHCI_THIS hub.usb_port[port].portsc.pp = 0;
|
||||
@ -1894,6 +1900,12 @@ bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
// Non existant Register Port (the next one after the last)
|
||||
else if (offset == (XHCI_PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16))) {
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_NONEXIST, 0, 0);
|
||||
}
|
||||
#endif
|
||||
// Extended Capabilities
|
||||
else if ((offset >= EXT_CAPS_OFFSET) && (offset < (EXT_CAPS_OFFSET + EXT_CAPS_SIZE))) {
|
||||
unsigned caps_offset = (offset - EXT_CAPS_OFFSET);
|
||||
@ -2270,7 +2282,7 @@ Bit64u bx_usb_xhci_c::process_transfer_ring(int slot, int ep, Bit64u ring_addr,
|
||||
// is the data in trb.parameter? (Immediate data?)
|
||||
is_immed_data = TRB_IS_IMMED_DATA(trb.command);
|
||||
if (is_immed_data)
|
||||
DEV_MEM_READ_PHYSICAL_DMA((bx_phy_address) org_addr, 8, immed_data); // No byte-swapping here
|
||||
DEV_MEM_READ_PHYSICAL((bx_phy_address) org_addr, 8, immed_data); // No byte-swapping here
|
||||
else
|
||||
address = trb.parameter;
|
||||
|
||||
@ -2515,6 +2527,10 @@ void bx_usb_xhci_c::process_command_ring(void)
|
||||
Bit8u buffer[CONTEXT_SIZE + (32 * CONTEXT_SIZE)];
|
||||
struct SLOT_CONTEXT slot_context;
|
||||
struct EP_CONTEXT ep_context;
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_COMMAND, 0, 0);
|
||||
#endif
|
||||
|
||||
if (!BX_XHCI_THIS hub.op_regs.HcCrcr.crr)
|
||||
return;
|
||||
@ -2922,7 +2938,7 @@ void bx_usb_xhci_c::process_command_ring(void)
|
||||
unsigned offset = band_speed * (((1 + BX_XHCI_THIS hub.n_ports) + 7) & ~7);
|
||||
if (hub_id == 0) { // root hub
|
||||
if (band_speed < 4) {
|
||||
DEV_MEM_WRITE_PHYSICAL_DMA((bx_phy_address) trb.parameter, 1 + BX_XHCI_THIS hub.n_ports, &BX_XHCI_THIS hub.port_band_width[offset]);
|
||||
DEV_MEM_WRITE_PHYSICAL((bx_phy_address) trb.parameter, 1 + BX_XHCI_THIS hub.n_ports, &BX_XHCI_THIS hub.port_band_width[offset]);
|
||||
comp_code = TRB_SUCCESS;
|
||||
} else {
|
||||
comp_code = TRB_ERROR;
|
||||
@ -3028,6 +3044,10 @@ void bx_usb_xhci_c::write_event_TRB(unsigned interrupter, Bit64u parameter, Bit3
|
||||
// write the TRB
|
||||
write_TRB((bx_phy_address) BX_XHCI_THIS hub.ring_members.event_rings[interrupter].cur_trb, parameter, status,
|
||||
command | (Bit32u) BX_XHCI_THIS hub.ring_members.event_rings[interrupter].rcs); // set the cycle bit
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_EVENT, interrupter, 0);
|
||||
#endif
|
||||
|
||||
BX_DEBUG(("Write Event TRB: table index: %d, trb index: %d",
|
||||
BX_XHCI_THIS hub.ring_members.event_rings[interrupter].count,
|
||||
@ -3189,8 +3209,8 @@ void bx_usb_xhci_c::dump_stream_context(const Bit32u *context)
|
||||
{
|
||||
BX_INFO((" -=-=-=-=-=-=-=- Stream Context -=-=-=-=-=-=-"));
|
||||
BX_INFO((" TR Dequeue Ptr: " FMT_ADDRX64 "", (* (Bit64u *) &context[0] & (Bit64u) ~0x0F)));
|
||||
BX_INFO((" Content Type: %01x", (context[0] & (0x07 << 1)) >> 1));
|
||||
BX_INFO((" DCS: %d", (context[0] & (1 << 0)) >> 0));
|
||||
BX_INFO((" Content Type: %01x", (context[0] & (0x07 << 1)) >> 1));
|
||||
BX_INFO((" DCS: %d", (context[0] & (1 << 0)) >> 0));
|
||||
}
|
||||
|
||||
void bx_usb_xhci_c::copy_slot_from_buffer(struct SLOT_CONTEXT *slot_context, const Bit8u *buffer)
|
||||
@ -3588,13 +3608,16 @@ void bx_usb_xhci_c::xhci_timer(void)
|
||||
if (BX_XHCI_THIS hub.op_regs.HcStatus.hch)
|
||||
return;
|
||||
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_FRAME, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Per section 4.19.3 of the xHCI 1.0 specs, we need to present
|
||||
* a "Port Status Change Event".
|
||||
* Also, we should only present this event once if any other bits
|
||||
* change, only presenting it again when all change bits are written
|
||||
* back to zero, and a change bit goes from 0 to 1.
|
||||
*/
|
||||
|
||||
for (unsigned port=0; port<BX_XHCI_THIS hub.n_ports; port++) {
|
||||
Bit8u new_psceg = get_psceg(port);
|
||||
// if any bit has transitioned from 0 to 1 (in any port),
|
||||
@ -3769,6 +3792,9 @@ bool bx_usb_xhci_c::set_connect_status(Bit8u port, bool connected)
|
||||
BX_XHCI_THIS hub.usb_port[port].portsc.csc = 1;
|
||||
if (ped_org != BX_XHCI_THIS hub.usb_port[port].portsc.ped) {
|
||||
BX_XHCI_THIS hub.usb_port[port].portsc.pec = 1;
|
||||
#if BX_USE_WIN32USBDEBUG
|
||||
win32_usb_trigger(USB_DEBUG_XHCI, USB_DEBUG_ENABLE, 0, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return connected;
|
||||
@ -3886,7 +3912,7 @@ void bx_usb_xhci_c::dump_xhci_core(unsigned int slots, unsigned int eps)
|
||||
for (i=1; i<slots+1; i++) {
|
||||
slot_addr = (BX_XHCI_THIS hub.op_regs.HcDCBAAP.dcbaap + (i * sizeof(Bit64u)));
|
||||
DEV_MEM_READ_PHYSICAL((bx_phy_address) slot_addr, sizeof(Bit64u), (Bit8u *) &slot_addr);
|
||||
DEV_MEM_READ_PHYSICAL_DMA((bx_phy_address) slot_addr, 2048, buffer);
|
||||
DEV_MEM_READ_PHYSICAL((bx_phy_address) slot_addr, 2048, buffer);
|
||||
dump_slot_context((Bit32u *) &buffer[0], i);
|
||||
for (p=1; p<eps+1; p++)
|
||||
dump_ep_context((Bit32u *) &buffer[p * CONTEXT_SIZE], i, p);
|
||||
|
@ -609,7 +609,9 @@ public:
|
||||
int event_handler(int event, void *ptr, int port);
|
||||
|
||||
bx_usb_xhci_t hub;
|
||||
#if !BX_USE_WIN32USBDEBUG
|
||||
private:
|
||||
#endif
|
||||
Bit8u devfunc;
|
||||
Bit8u device_change;
|
||||
int rt_conf_id;
|
||||
|
@ -164,6 +164,13 @@
|
||||
#define BXPN_XHCI_ENABLED "ports.usb.xhci.enabled"
|
||||
#define BXPN_XHCI_MODEL "ports.usb.xhci.model"
|
||||
#define BXPN_XHCI_N_PORTS "ports.usb.xhci.n_ports"
|
||||
#define BXPN_USB_DEBUG_TYPE "usb_debug.type"
|
||||
#define BXPN_USB_DEBUG_RESET "usb_debug.reset"
|
||||
#define BXPN_USB_DEBUG_ENABLE "usb_debug.enable"
|
||||
#define BXPN_USB_DEBUG_START_FRAME "usb_debug.start_frame"
|
||||
#define BXPN_USB_DEBUG_DOORBELL "usb_debug.doorbell"
|
||||
#define BXPN_USB_DEBUG_EVENT "usb_debug.event"
|
||||
#define BXPN_USB_DEBUG_NON_EXIST "usb_debug.non_exist"
|
||||
#define BXPN_NE2K "network.ne2k"
|
||||
#define BXPN_PNIC "network.pcipnic"
|
||||
#define BXPN_E1000 "network.e1000"
|
||||
|
@ -100,6 +100,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 105, 40, 50, 14
|
||||
END
|
||||
|
||||
#include "win32usbres.rc"
|
||||
#include "bxversion.rc"
|
||||
#if BX_DEBUGGER_GUI
|
||||
#include "win32_enh_dbg.rc"
|
||||
|
1274
bochs/win32usbres.rc
Normal file
1274
bochs/win32usbres.rc
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user