- prepared siminterface and bochsrc options for USB OHCI support
* 'usb_uhci' bochsrc option replaces 'usb1' * minor changes in the USB code * removed old VBE i/o port registration (they were incompatible with USB) * updated FSF address - fixed saving user plugin options
This commit is contained in:
parent
0b782cd749
commit
891cc05477
@ -1,4 +1,4 @@
|
||||
$Id: PARAM_TREE.txt,v 1.19 2009-01-06 20:35:38 vruppert Exp $
|
||||
$Id: PARAM_TREE.txt,v 1.20 2009-01-19 13:13:32 vruppert Exp $
|
||||
|
||||
Starting from Bochs 2.3 the parameters are organized in a tree structure
|
||||
instead of a huge flat list. The parameter tree was required for implementing
|
||||
@ -175,13 +175,15 @@ ports
|
||||
outfile
|
||||
2
|
||||
(same options as ports.parallel.1)
|
||||
usb
|
||||
1
|
||||
enabled
|
||||
port1
|
||||
option1
|
||||
port2
|
||||
option2
|
||||
usb
|
||||
uhci
|
||||
enabled
|
||||
port1
|
||||
port2
|
||||
ohci
|
||||
enabled
|
||||
port1
|
||||
port2
|
||||
|
||||
network
|
||||
ne2k
|
||||
@ -239,4 +241,4 @@ wxdebug
|
||||
user
|
||||
(subtree for user-defined options)
|
||||
|
||||
(updated Jan 6, 2008 by vruppert)
|
||||
(updated Jan 19, 2008 by vruppert)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: bochs.h,v 1.239 2009-01-10 11:47:10 vruppert Exp $
|
||||
// $Id: bochs.h,v 1.240 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -504,7 +504,6 @@ extern bx_bool bx_gui_sighandler;
|
||||
#define BX_N_OPTRAM_IMAGES 4
|
||||
#define BX_N_SERIAL_PORTS 4
|
||||
#define BX_N_PARALLEL_PORTS 2
|
||||
#define BX_N_USB_HUBS 1
|
||||
#define BX_N_PCI_SLOTS 5
|
||||
#define BX_N_USER_PLUGINS 8
|
||||
|
||||
|
160
bochs/config.cc
160
bochs/config.cc
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: config.cc,v 1.150 2009-01-13 19:01:19 vruppert Exp $
|
||||
// $Id: config.cc,v 1.151 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -1369,35 +1369,58 @@ void bx_init_options()
|
||||
enabled->set_dependent_list(deplist);
|
||||
}
|
||||
|
||||
// usb subtree
|
||||
bx_list_c *usb = new bx_list_c(root_param, "usb", "USB Configuration");
|
||||
usb->get_options()->set(bx_list_c::SHOW_PARENT);
|
||||
bx_param_string_c *port;
|
||||
|
||||
// usb hubs
|
||||
bx_list_c *usb = new bx_list_c(ports, "usb", "USB Hub Options");
|
||||
usb->get_options()->set(bx_list_c::SHOW_PARENT);
|
||||
for (i=0; i<BX_N_USB_HUBS; i++) {
|
||||
sprintf(group, "USB%d", i+1);
|
||||
sprintf(name, "%d", i+1);
|
||||
sprintf(label, "USB Hub %d", i+1);
|
||||
menu = new bx_list_c(usb, name, label);
|
||||
menu->set_enabled(BX_SUPPORT_PCIUSB);
|
||||
sprintf(label, "Enable usb hub #%d", i+1);
|
||||
sprintf(descr, "Controls whether %s is installed or not", group);
|
||||
enabled = new bx_param_bool_c(menu, "enabled", label, descr, 0);
|
||||
enabled->set_enabled(BX_SUPPORT_PCIUSB);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port1",
|
||||
"Port #1 device",
|
||||
"Device connected to USB port #1",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port2",
|
||||
"Port #2 device",
|
||||
"Device connected to USB port #2",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
enabled->set_dependent_list(menu->clone());
|
||||
}
|
||||
// UHCI options
|
||||
strcpy(group, "USB UHCI");
|
||||
menu = new bx_list_c(usb, "uhci", "UHCI Configuration");
|
||||
menu->get_options()->set(bx_list_c::SHOW_PARENT);
|
||||
menu->set_enabled(BX_SUPPORT_USB_UHCI);
|
||||
enabled = new bx_param_bool_c(menu,
|
||||
"enabled",
|
||||
"Enable UHCI emulation",
|
||||
"Enables the UHCI emulation",
|
||||
0);
|
||||
enabled->set_enabled(BX_SUPPORT_USB_UHCI);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port1",
|
||||
"Port #1 device",
|
||||
"Device connected to USB port #1",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port2",
|
||||
"Port #2 device",
|
||||
"Device connected to USB port #2",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
|
||||
// OHCI options
|
||||
strcpy(group, "USB OHCI");
|
||||
menu = new bx_list_c(usb, "ohci", "OHCI Configuration");
|
||||
menu->get_options()->set(bx_list_c::SHOW_PARENT);
|
||||
menu->set_enabled(BX_SUPPORT_USB_OHCI);
|
||||
enabled = new bx_param_bool_c(menu,
|
||||
"enabled",
|
||||
"Enable OHCI emulation",
|
||||
"Enables the OHCI emulation",
|
||||
0);
|
||||
enabled->set_enabled(BX_SUPPORT_USB_OHCI);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port1",
|
||||
"Port #1 device",
|
||||
"Device connected to USB port #1",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
port = new bx_param_string_c(menu,
|
||||
"port2",
|
||||
"Port #2 device",
|
||||
"Device connected to USB port #2",
|
||||
"", BX_PATHNAME_LEN);
|
||||
port->set_group(group);
|
||||
|
||||
// network subtree
|
||||
bx_list_c *network = new bx_list_c(root_param, "network", "Network Configuration");
|
||||
@ -1693,8 +1716,10 @@ void bx_init_options()
|
||||
SIM->get_param_string(BXPN_USER_SHORTCUT),
|
||||
SIM->get_param_num(BXPN_SB16_DMATIMER),
|
||||
SIM->get_param_num(BXPN_SB16_LOGLEVEL),
|
||||
SIM->get_param_string(BXPN_USB1_PORT1),
|
||||
SIM->get_param_string(BXPN_USB1_PORT2),
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1),
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2),
|
||||
SIM->get_param_string(BXPN_OHCI_PORT1),
|
||||
SIM->get_param_string(BXPN_OHCI_PORT2),
|
||||
NULL
|
||||
};
|
||||
menu = new bx_list_c(special_menus, "runtime", "Misc runtime options", runtime_init_list);
|
||||
@ -1733,6 +1758,9 @@ void bx_reset_options()
|
||||
// standard ports
|
||||
SIM->get_param("ports")->reset();
|
||||
|
||||
// usb
|
||||
SIM->get_param("usb")->reset();
|
||||
|
||||
// ne2k & pnic
|
||||
SIM->get_param("network")->reset();
|
||||
|
||||
@ -2826,35 +2854,30 @@ static int parse_line_formatted(const char *context, int num_params, char *param
|
||||
BX_ERROR(("%s: unknown parameter for parport%d ignored.", context, idx));
|
||||
}
|
||||
}
|
||||
} else if ((!strncmp(params[0], "usb", 3)) && (strlen(params[0]) == 4)) {
|
||||
char tmpname[80];
|
||||
idx = params[0][3];
|
||||
if ((idx < '1') || (idx > '9')) {
|
||||
PARSE_ERR(("%s: usbX directive malformed.", context));
|
||||
}
|
||||
idx -= '0';
|
||||
if (idx > BX_N_USB_HUBS) {
|
||||
PARSE_ERR(("%s: usbX hub number out of range.", context));
|
||||
}
|
||||
sprintf(tmpname, "ports.usb.%d", idx);
|
||||
base = (bx_list_c*) SIM->get_param(tmpname);
|
||||
} else if (!strcmp(params[0], "usb1")) {
|
||||
PARSE_ERR(("%s: 'usb1' directive is now deprecated, use 'usb_uhci' instead", context));
|
||||
} else if (!strcmp(params[0], "usb_uhci")) {
|
||||
for (i=1; i<num_params; i++) {
|
||||
if (!strncmp(params[i], "enabled=", 8)) {
|
||||
SIM->get_param_bool("enabled", base)->set(atol(¶ms[i][8]));
|
||||
SIM->get_param_bool(BXPN_UHCI_ENABLED)->set(atol(¶ms[i][8]));
|
||||
} else if (!strncmp(params[i], "port1=", 6)) {
|
||||
SIM->get_param_string("port1", base)->set(¶ms[i][6]);
|
||||
} else if (!strncmp(params[i], "option1=", 8)) {
|
||||
PARSE_WARN(("%s: usb port1 option is now deprecated", context));
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1)->set(¶ms[i][6]);
|
||||
} else if (!strncmp(params[i], "port2=", 6)) {
|
||||
SIM->get_param_string("port2", base)->set(¶ms[i][6]);
|
||||
} else if (!strncmp(params[i], "option2=", 8)) {
|
||||
PARSE_WARN(("%s: usb port2 option is now deprecated", context));
|
||||
} else if (!strncmp(params[i], "ioaddr=", 7)) {
|
||||
PARSE_WARN(("%s: usb ioaddr is now DEPRECATED (assigned by BIOS).", context));
|
||||
} else if (!strncmp(params[i], "irq=", 4)) {
|
||||
PARSE_WARN(("%s: usb irq is now DEPRECATED (assigned by BIOS).", context));
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2)->set(¶ms[i][6]);
|
||||
} else {
|
||||
PARSE_WARN(("%s: unknown parameter '%s' for usb%d ignored.", context, params[i], idx));
|
||||
PARSE_WARN(("%s: unknown parameter '%s' for usb_uhci ignored.", context, params[i]));
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(params[0], "usb_ohci")) {
|
||||
for (i=1; i<num_params; i++) {
|
||||
if (!strncmp(params[i], "enabled=", 8)) {
|
||||
SIM->get_param_bool(BXPN_OHCI_ENABLED)->set(atol(¶ms[i][8]));
|
||||
} else if (!strncmp(params[i], "port1=", 6)) {
|
||||
SIM->get_param_string(BXPN_OHCI_PORT1)->set(¶ms[i][6]);
|
||||
} else if (!strncmp(params[i], "port2=", 6)) {
|
||||
SIM->get_param_string(BXPN_OHCI_PORT2)->set(¶ms[i][6]);
|
||||
} else {
|
||||
PARSE_WARN(("%s: unknown parameter '%s' for usb_ohci ignored.", context, params[i]));
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(params[0], "i440fxsupport")) {
|
||||
@ -3329,9 +3352,9 @@ int bx_write_serial_options(FILE *fp, bx_list_c *base, int n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bx_write_usb_options(FILE *fp, bx_list_c *base, int n)
|
||||
int bx_write_usb_options(FILE *fp, bx_list_c *base)
|
||||
{
|
||||
fprintf(fp, "usb%d: enabled=%d", n, SIM->get_param_bool("enabled", base)->get());
|
||||
fprintf(fp, "usb_%s: enabled=%d", base->get_name(), SIM->get_param_bool("enabled", base)->get());
|
||||
if (SIM->get_param_bool("enabled", base)->get()) {
|
||||
fprintf(fp, ", port1=%s", SIM->get_param_string("port1", base)->getptr());
|
||||
fprintf(fp, ", port2=%s", SIM->get_param_string("port2", base)->getptr());
|
||||
@ -3340,18 +3363,6 @@ int bx_write_usb_options(FILE *fp, bx_list_c *base, int n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if BX_PLUGINS
|
||||
int bx_write_user_plugin_options(FILE *fp, bx_list_c *base)
|
||||
{
|
||||
if (strlen(SIM->get_param_string("name", base)->getptr()) > 0) {
|
||||
fprintf(fp, "user_plugin: name=%s, options=%s\n",
|
||||
SIM->get_param_string("name", base)->getptr(),
|
||||
SIM->get_param_string("options", base)->getptr());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int bx_write_pnic_options(FILE *fp, bx_list_c *base)
|
||||
{
|
||||
fprintf (fp, "pnic: enabled=%d", SIM->get_param_bool("enabled", base)->get());
|
||||
@ -3527,8 +3538,10 @@ int bx_write_configuration(const char *rc, int overwrite)
|
||||
// user plugins
|
||||
for (i=0; i<BX_N_USER_PLUGINS; i++) {
|
||||
sprintf(tmpdev, "misc.user_plugin.%d", i+1);
|
||||
base = (bx_list_c*) SIM->get_param(tmpdev);
|
||||
bx_write_user_plugin_options(fp, base);
|
||||
if (strlen(SIM->get_param_string(tmpdev)->getptr()) > 0) {
|
||||
fprintf(fp, "user_plugin: name=%s\n",
|
||||
SIM->get_param_string(tmpdev)->getptr());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fprintf(fp, "config_interface: %s\n", SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE)->get_selected());
|
||||
@ -3603,8 +3616,11 @@ int bx_write_configuration(const char *rc, int overwrite)
|
||||
base = (bx_list_c*) SIM->get_param(tmpdev);
|
||||
bx_write_serial_options(fp, base, i+1);
|
||||
}
|
||||
base = (bx_list_c*) SIM->get_param("ports.usb.1");
|
||||
bx_write_usb_options(fp, base, 1);
|
||||
// usb
|
||||
base = (bx_list_c*) SIM->get_param("usb.uhci");
|
||||
bx_write_usb_options(fp, base);
|
||||
base = (bx_list_c*) SIM->get_param("usb.ohci");
|
||||
bx_write_usb_options(fp, base);
|
||||
// pci
|
||||
fprintf(fp, "i440fxsupport: enabled=%d",
|
||||
SIM->get_param_bool(BXPN_I440FX_SUPPORT)->get());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: siminterface.h,v 1.223 2009-01-10 11:30:20 vruppert Exp $
|
||||
// $Id: siminterface.h,v 1.224 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 The Bochs Project
|
||||
@ -229,9 +229,12 @@ typedef enum {
|
||||
#define BXPN_ATA1_SLAVE "ata.1.slave"
|
||||
#define BXPN_ATA2_SLAVE "ata.2.slave"
|
||||
#define BXPN_ATA3_SLAVE "ata.3.slave"
|
||||
#define BXPN_USB1_ENABLED "ports.usb.1.enabled"
|
||||
#define BXPN_USB1_PORT1 "ports.usb.1.port1"
|
||||
#define BXPN_USB1_PORT2 "ports.usb.1.port2"
|
||||
#define BXPN_UHCI_ENABLED "usb.uhci.enabled"
|
||||
#define BXPN_UHCI_PORT1 "usb.uhci.port1"
|
||||
#define BXPN_UHCI_PORT2 "usb.uhci.port2"
|
||||
#define BXPN_OHCI_ENABLED "usb.ohci.enabled"
|
||||
#define BXPN_OHCI_PORT1 "usb.ohci.port1"
|
||||
#define BXPN_OHCI_PORT2 "usb.ohci.port2"
|
||||
#define BXPN_NE2K "network.ne2k"
|
||||
#define BXPN_NE2K_ENABLED "network.ne2k.enabled"
|
||||
#define BXPN_PNIC "network.pnic"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: win32dialog.cc,v 1.67 2009-01-12 19:15:35 sshwarts Exp $
|
||||
// $Id: win32dialog.cc,v 1.68 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "win32dialog.h"
|
||||
@ -555,9 +555,9 @@ static BOOL CALLBACK RTUSBdevDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
if (SIM->get_param_string(BXPN_USB1_PORT1)->get_enabled()) {
|
||||
SetDlgItemText(hDlg, IDUSBDEV1, SIM->get_param_string(BXPN_USB1_PORT1)->getptr());
|
||||
SetDlgItemText(hDlg, IDUSBDEV2, SIM->get_param_string(BXPN_USB1_PORT2)->getptr());
|
||||
if (SIM->get_param_string(BXPN_UHCI_PORT1)->get_enabled()) {
|
||||
SetDlgItemText(hDlg, IDUSBDEV1, SIM->get_param_string(BXPN_UHCI_PORT1)->getptr());
|
||||
SetDlgItemText(hDlg, IDUSBDEV2, SIM->get_param_string(BXPN_UHCI_PORT2)->getptr());
|
||||
} else {
|
||||
EnableWindow(GetDlgItem(hDlg, IDUSBLBL1), FALSE);
|
||||
EnableWindow(GetDlgItem(hDlg, IDUSBLBL2), FALSE);
|
||||
@ -572,9 +572,9 @@ static BOOL CALLBACK RTUSBdevDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
case PSN_APPLY:
|
||||
if ((psn->lParam == FALSE) && changed) { // Apply pressed & change in this dialog
|
||||
GetDlgItemText(hDlg, IDUSBDEV1, buffer, sizeof(buffer));
|
||||
SIM->get_param_string(BXPN_USB1_PORT1)->set(buffer);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1)->set(buffer);
|
||||
GetDlgItemText(hDlg, IDUSBDEV2, buffer, sizeof(buffer));
|
||||
SIM->get_param_string(BXPN_USB1_PORT2)->set(buffer);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2)->set(buffer);
|
||||
}
|
||||
return PSNRET_NOERROR;
|
||||
case PSN_QUERYCANCEL:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: devices.cc,v 1.134 2009-01-19 09:48:11 vruppert Exp $
|
||||
// $Id: devices.cc,v 1.135 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -112,7 +112,7 @@ void bx_devices_c::init(BX_MEM_C *newmem)
|
||||
unsigned i;
|
||||
const char def_name[] = "Default";
|
||||
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.134 2009-01-19 09:48:11 vruppert Exp $"));
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.135 2009-01-19 13:13:32 vruppert Exp $"));
|
||||
mem = newmem;
|
||||
|
||||
/* set builtin default handlers, will be overwritten by the real default handler */
|
||||
@ -993,13 +993,15 @@ bx_bool bx_devices_c::is_parallel_enabled(void)
|
||||
|
||||
bx_bool bx_devices_c::is_usb_ohci_enabled(void)
|
||||
{
|
||||
// TODO
|
||||
if (SIM->get_param_bool(BXPN_OHCI_ENABLED)->get()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_devices_c::is_usb_uhci_enabled(void)
|
||||
{
|
||||
if (SIM->get_param_bool("ports.usb.1.enabled")->get()) {
|
||||
if (SIM->get_param_bool(BXPN_UHCI_ENABLED)->get()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_hid.cc,v 1.10 2009-01-19 09:48:11 vruppert Exp $
|
||||
// $Id: usb_hid.cc,v 1.11 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
@ -449,7 +449,7 @@ int usb_hid_device_c::handle_control(int request, int value, int index, int leng
|
||||
memcpy(data, bx_keypad_dev_descriptor,
|
||||
sizeof(bx_keypad_dev_descriptor));
|
||||
ret = sizeof(bx_keypad_dev_descriptor);
|
||||
} else {
|
||||
} else {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
@ -468,7 +468,7 @@ int usb_hid_device_c::handle_control(int request, int value, int index, int leng
|
||||
ret = sizeof(bx_keypad_config_descriptor);
|
||||
} else {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case USB_DT_STRING:
|
||||
switch(value & 0xff) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_uhci.cc,v 1.1 2009-01-19 09:48:12 vruppert Exp $
|
||||
// $Id: usb_uhci.cc,v 1.2 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
bx_usb_uhci_c* theUSB_UHCI = NULL;
|
||||
|
||||
const Bit8u usb_iomask[32] = {2, 1, 2, 1, 2, 1, 2, 0, 4, 0, 0, 0, 1, 0, 0, 0,
|
||||
const Bit8u uhci_iomask[32] = {2, 1, 2, 1, 2, 1, 2, 0, 4, 0, 0, 0, 1, 0, 0, 0,
|
||||
3, 1, 3, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
int libusb_uhci_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[])
|
||||
@ -75,8 +75,8 @@ bx_usb_uhci_c::~bx_usb_uhci_c()
|
||||
}
|
||||
}
|
||||
|
||||
SIM->get_param_string(BXPN_USB1_PORT1)->set_handler(NULL);
|
||||
SIM->get_param_string(BXPN_USB1_PORT2)->set_handler(NULL);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1)->set_handler(NULL);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2)->set_handler(NULL);
|
||||
|
||||
BX_DEBUG(("Exit"));
|
||||
}
|
||||
@ -103,12 +103,12 @@ void bx_usb_uhci_c::init(void)
|
||||
BX_UHCI_THIS hub.base_ioaddr = 0x0;
|
||||
|
||||
//FIXME: for now, we want a status bar // hub zero, port zero
|
||||
BX_UHCI_THIS hub.statusbar_id[0] = bx_gui->register_statusitem("USB");
|
||||
BX_UHCI_THIS hub.statusbar_id[0] = bx_gui->register_statusitem("UHCI");
|
||||
|
||||
SIM->get_param_string(BXPN_USB1_PORT1)->set_handler(usb_param_handler);
|
||||
SIM->get_param_string(BXPN_USB1_PORT1)->set_runtime_param(1);
|
||||
SIM->get_param_string(BXPN_USB1_PORT2)->set_handler(usb_param_handler);
|
||||
SIM->get_param_string(BXPN_USB1_PORT2)->set_runtime_param(1);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1)->set_handler(usb_param_handler);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT1)->set_runtime_param(1);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2)->set_handler(usb_param_handler);
|
||||
SIM->get_param_string(BXPN_UHCI_PORT2)->set_runtime_param(1);
|
||||
|
||||
//HACK: Turn on debug messages from the start
|
||||
//BX_UHCI_THIS setonoff(LOGLEV_DEBUG, ACT_REPORT);
|
||||
@ -120,8 +120,6 @@ void bx_usb_uhci_c::reset(unsigned type)
|
||||
{
|
||||
unsigned i, j;
|
||||
|
||||
if (!SIM->get_param_bool(BXPN_USB1_ENABLED)->get()) return;
|
||||
|
||||
if (type == BX_RESET_HARDWARE) {
|
||||
static const struct reset_vals_t {
|
||||
unsigned addr;
|
||||
@ -198,8 +196,8 @@ void bx_usb_uhci_c::reset(unsigned type)
|
||||
BX_UHCI_THIS mousedev = NULL;
|
||||
BX_UHCI_THIS keybdev = NULL;
|
||||
|
||||
init_device(0, SIM->get_param_string(BXPN_USB1_PORT1)->getptr());
|
||||
init_device(1, SIM->get_param_string(BXPN_USB1_PORT2)->getptr());
|
||||
init_device(0, SIM->get_param_string(BXPN_UHCI_PORT1)->getptr());
|
||||
init_device(1, SIM->get_param_string(BXPN_UHCI_PORT2)->getptr());
|
||||
}
|
||||
|
||||
void bx_usb_uhci_c::register_state(void)
|
||||
@ -208,7 +206,7 @@ void bx_usb_uhci_c::register_state(void)
|
||||
char portnum[8];
|
||||
bx_list_c *hub, *usb_cmd, *usb_st, *usb_en, *port;
|
||||
|
||||
bx_list_c *list = new bx_list_c(SIM->get_bochs_root(), "usb_uhci", "PCI USB Controller State");
|
||||
bx_list_c *list = new bx_list_c(SIM->get_bochs_root(), "usb_uhci", "USB UHCI State");
|
||||
hub = new bx_list_c(list, "hub", USB_NUM_PORTS + 7);
|
||||
usb_cmd = new bx_list_c(hub, "usb_command", 8);
|
||||
new bx_shadow_bool_c(usb_cmd, "max_packet_size", &BX_UHCI_THIS hub.usb_command.max_packet_size);
|
||||
@ -251,6 +249,7 @@ void bx_usb_uhci_c::register_state(void)
|
||||
new bx_list_c(port, "device", 20);
|
||||
}
|
||||
register_pci_state(hub, BX_UHCI_THIS hub.pci_conf);
|
||||
|
||||
new bx_shadow_bool_c(list, "busy", &BX_UHCI_THIS busy);
|
||||
new bx_shadow_num_c(list, "global_reset", &BX_UHCI_THIS global_reset);
|
||||
}
|
||||
@ -260,7 +259,7 @@ void bx_usb_uhci_c::after_restore_state(void)
|
||||
if (DEV_pci_set_base_io(BX_UHCI_THIS_PTR, read_handler, write_handler,
|
||||
&BX_UHCI_THIS hub.base_ioaddr,
|
||||
&BX_UHCI_THIS hub.pci_conf[0x20],
|
||||
32, &usb_iomask[0], "USB Hub #1"))
|
||||
32, &uhci_iomask[0], "USB UHCI Hub"))
|
||||
{
|
||||
BX_INFO(("new base address: 0x%04x", BX_UHCI_THIS hub.base_ioaddr));
|
||||
}
|
||||
@ -308,7 +307,7 @@ void bx_usb_uhci_c::init_device(Bit8u port, const char *devname)
|
||||
BX_PANIC(("unknown USB device: %s", devname));
|
||||
return;
|
||||
}
|
||||
sprintf(pname, "usb_uhci.hub1.port%d.device", port+1);
|
||||
sprintf(pname, "usb.uhci.port%d.device", port+1);
|
||||
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
|
||||
BX_UHCI_THIS hub.usb_port[port].device->register_state(devlist);
|
||||
usb_set_connect_status(port, type, 1);
|
||||
@ -967,7 +966,7 @@ Bit32u bx_usb_uhci_c::pci_read_handler(Bit8u address, unsigned io_len)
|
||||
strcat(szTmp, szTmp2);
|
||||
}
|
||||
strrev(szTmp);
|
||||
BX_DEBUG(("USB PCI read register 0x%02x %svalue 0x%s", address, pszName, szTmp));
|
||||
BX_DEBUG(("USB UHCI read register 0x%02x %svalue 0x%s", address, pszName, szTmp));
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -1028,13 +1027,13 @@ void bx_usb_uhci_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_l
|
||||
if (DEV_pci_set_base_io(BX_UHCI_THIS_PTR, read_handler, write_handler,
|
||||
&BX_UHCI_THIS hub.base_ioaddr,
|
||||
&BX_UHCI_THIS hub.pci_conf[0x20],
|
||||
32, &usb_iomask[0], "USB Hub #1")) {
|
||||
32, &uhci_iomask[0], "USB UHCI Hub")) {
|
||||
BX_INFO(("new base address: 0x%04x", BX_UHCI_THIS hub.base_ioaddr));
|
||||
}
|
||||
}
|
||||
}
|
||||
strrev(szTmp);
|
||||
BX_DEBUG(("USB PCI write register 0x%02x value 0x%s", address, szTmp));
|
||||
BX_DEBUG(("USB UHCI write register 0x%02x value 0x%s", address, szTmp));
|
||||
}
|
||||
|
||||
bx_bool bx_usb_uhci_c::usb_mouse_enabled_changed(bx_bool enabled)
|
||||
@ -1082,9 +1081,9 @@ void bx_usb_uhci_c::usb_set_connect_status(Bit8u port, int type, bx_bool connect
|
||||
if ((type == USB_DEV_TYPE_DISK) &&
|
||||
(!BX_UHCI_THIS hub.usb_port[port].device->get_connected())) {
|
||||
if (port == 0) {
|
||||
strcpy(pname, BXPN_USB1_PORT1);
|
||||
strcpy(pname, BXPN_UHCI_PORT1);
|
||||
} else {
|
||||
strcpy(pname, BXPN_USB1_PORT2);
|
||||
strcpy(pname, BXPN_UHCI_PORT2);
|
||||
}
|
||||
strcpy(fname, SIM->get_param_string(pname)->getptr() + 5);
|
||||
if (!((usb_msd_device_c*)BX_UHCI_THIS hub.usb_port[port].device)->init(fname)) {
|
||||
@ -1114,7 +1113,7 @@ void bx_usb_uhci_c::usb_set_connect_status(Bit8u port, int type, bx_bool connect
|
||||
if (BX_UHCI_THIS hub.usb_port[port].device != NULL) {
|
||||
delete BX_UHCI_THIS hub.usb_port[port].device;
|
||||
BX_UHCI_THIS hub.usb_port[port].device = NULL;
|
||||
sprintf(pname, "usb_uhci.hub1.port%d.device", port+1);
|
||||
sprintf(pname, "usb.uhci.port%d.device", port+1);
|
||||
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
|
||||
devlist->clear();
|
||||
}
|
||||
@ -1159,7 +1158,7 @@ const char *bx_usb_uhci_c::usb_param_handler(bx_param_string_c *param, int set,
|
||||
if (set) {
|
||||
char pname[BX_PATHNAME_LEN];
|
||||
param->get_param_path(pname, BX_PATHNAME_LEN);
|
||||
if (!strcmp(pname, BXPN_USB1_PORT1)) {
|
||||
if (!strcmp(pname, BXPN_UHCI_PORT1)) {
|
||||
BX_INFO(("USB port #1 experimental device change"));
|
||||
if (!strcmp(val, "none") && BX_UHCI_THIS hub.usb_port[0].status) {
|
||||
if (BX_UHCI_THIS hub.usb_port[0].device != NULL) {
|
||||
@ -1169,7 +1168,7 @@ const char *bx_usb_uhci_c::usb_param_handler(bx_param_string_c *param, int set,
|
||||
} else if (strcmp(val, "none") && !BX_UHCI_THIS hub.usb_port[0].status) {
|
||||
init_device(0, val);
|
||||
}
|
||||
} else if (!strcmp(pname, BXPN_USB1_PORT2)) {
|
||||
} else if (!strcmp(pname, BXPN_UHCI_PORT2)) {
|
||||
BX_INFO(("USB port #2 experimental device change"));
|
||||
if (!strcmp(val, "none") && BX_UHCI_THIS hub.usb_port[1].status) {
|
||||
if (BX_UHCI_THIS hub.usb_port[1].device != NULL) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_uhci.h,v 1.1 2009-01-19 09:48:12 vruppert Exp $
|
||||
// $Id: usb_uhci.h,v 1.2 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
|
||||
@ -209,7 +209,7 @@ private:
|
||||
|
||||
USBPacket usb_packet;
|
||||
|
||||
static void set_irq_level(bx_bool level);
|
||||
static void set_irq_level(bx_bool level);
|
||||
|
||||
static void init_device(Bit8u port, const char *devname);
|
||||
static void usb_set_connect_status(Bit8u port, int type, bx_bool connected);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.cc,v 1.156 2008-12-29 20:16:08 sshwarts Exp $
|
||||
// $Id: vga.cc,v 1.157 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -22,7 +22,7 @@
|
||||
//
|
||||
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
||||
@ -295,12 +295,6 @@ void bx_vga_c::init(void)
|
||||
DEV_register_ioread_handler(this, vbe_read_handler, addr, "vga video", 7);
|
||||
DEV_register_iowrite_handler(this, vbe_write_handler, addr, "vga video", 7);
|
||||
}
|
||||
if (!BX_SUPPORT_PCIUSB || !SIM->get_param_bool(BXPN_USB1_ENABLED)->get()) {
|
||||
for (addr=VBE_DISPI_IOPORT_INDEX_OLD; addr<=VBE_DISPI_IOPORT_DATA_OLD; addr++) {
|
||||
DEV_register_ioread_handler(this, vbe_read_handler, addr, "vga video", 7);
|
||||
DEV_register_iowrite_handler(this, vbe_write_handler, addr, "vga video", 7);
|
||||
}
|
||||
}
|
||||
DEV_register_memory_handlers(theVga, mem_read_handler, mem_write_handler,
|
||||
VBE_DISPI_LFB_PHYSICAL_ADDRESS,
|
||||
VBE_DISPI_LFB_PHYSICAL_ADDRESS + VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES - 1);
|
||||
@ -3043,8 +3037,7 @@ Bit32u bx_vga_c::vbe_read(Bit32u address, unsigned io_len)
|
||||
|
||||
// BX_INFO(("VBE_read %x (len %x)", address, io_len));
|
||||
|
||||
if ((address==VBE_DISPI_IOPORT_INDEX) ||
|
||||
(address==VBE_DISPI_IOPORT_INDEX_OLD))
|
||||
if (address==VBE_DISPI_IOPORT_INDEX)
|
||||
{
|
||||
// index register
|
||||
return (Bit32u) BX_VGA_THIS s.vbe_curindex;
|
||||
@ -3133,8 +3126,6 @@ Bit32u bx_vga_c::vbe_write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
{
|
||||
// index register
|
||||
case VBE_DISPI_IOPORT_INDEX:
|
||||
// legacy index register
|
||||
case VBE_DISPI_IOPORT_INDEX_OLD:
|
||||
|
||||
BX_VGA_THIS s.vbe_curindex = (Bit16u) value;
|
||||
break;
|
||||
@ -3142,8 +3133,6 @@ Bit32u bx_vga_c::vbe_write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
// data register
|
||||
// FIXME: maybe do some 'sanity' checks on received data?
|
||||
case VBE_DISPI_IOPORT_DATA:
|
||||
// legacy data register
|
||||
case VBE_DISPI_IOPORT_DATA_OLD:
|
||||
switch (BX_VGA_THIS s.vbe_curindex)
|
||||
{
|
||||
case VBE_DISPI_INDEX_ID: // Display Interface ID check
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.h,v 1.63 2008-12-29 08:16:53 vruppert Exp $
|
||||
// $Id: vga.h,v 1.64 2009-01-19 13:13:32 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -22,7 +22,7 @@
|
||||
//
|
||||
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef BX_IODEV_VGA_H
|
||||
#define BX_IODEV_VGA_H
|
||||
@ -60,9 +60,6 @@
|
||||
#define VBE_DISPI_IOPORT_INDEX 0x01CE
|
||||
#define VBE_DISPI_IOPORT_DATA 0x01CF
|
||||
|
||||
#define VBE_DISPI_IOPORT_INDEX_OLD 0xFF80
|
||||
#define VBE_DISPI_IOPORT_DATA_OLD 0xFF81
|
||||
|
||||
#define VBE_DISPI_INDEX_ID 0x0
|
||||
#define VBE_DISPI_INDEX_XRES 0x1
|
||||
#define VBE_DISPI_INDEX_YRES 0x2
|
||||
|
Loading…
Reference in New Issue
Block a user