Replies: 6 comments 2 replies
-
Yes, with the exception of not including the virtual "Linux Foundation root hub" items as of recently, the nusb list example should list the same devices as |
Beta Was this translation helpful? Give feedback.
-
As for supporting Redox, do you have any pointers to the Redox USB code or documentation? It would need to connect to the process that runs the xHCI host controller driver and I'm not sure what mechanisms Redox uses for that. Making changes across three platforms is already enough work, so I'd be reluctant to take on a niche (but certainly interesting) one until things stabilize a bit more. If there's someone committing to maintain and test it that would be ideal. |
Beta Was this translation helpful? Give feedback.
-
Ok, this is running on an Asus minipc PN41 with Celeron 5100 stable Pop-OS
Kernel 6.9.3-76060903-generic
And it does indeed list lots of stuff!
I was trying it before on Crostini, which is a container so that probably
explains why it didn't work.
On Redox-OS drivers are in userspace. Here are the relevant sources:
https://github.com/redox-os/drivers
Later today I'll try compiling it to run in redox-os and see if it works.
Thanks!
***@***.***:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson
Peak (JfP)
Bus 001 Device 004: ID 04f2:0939 Chicony Electronics Co., Ltd Amazon Basics
mouse
Bus 001 Device 003: ID 04f2:0402 Chicony Electronics Co., Ltd Genius
LuxeMate i200 Keyboard
Bus 001 Device 006: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
***@***.***:~$ ^C
***@***.***:~$
DeviceInfo {
bus_id: "001",
device_address: 4,
port_chain: [7],
vendor_id: 0x04F2,
product_id: 0x0939,
device_version: 0x0100,
class: 0x00,
subclass: 0x00,
protocol: 0x00,
max_packet_size_0: 8,
speed: Some(
Low,
),
manufacturer_string: Some(
"PixArt",
),
product_string: Some(
"USB Optical Mouse",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-7",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x03,
subclass: 0x01,
protocol: 0x02,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 6,
port_chain: [3],
vendor_id: 0x1A40,
product_id: 0x0801,
device_version: 0x0100,
class: 0x09,
subclass: 0x00,
protocol: 0x01,
max_packet_size_0: 64,
speed: Some(
High,
),
manufacturer_string: None,
product_string: Some(
"USB 2.0 Hub",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-3",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x09,
subclass: 0x00,
protocol: 0x00,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 5,
port_chain: [8],
vendor_id: 0x8087,
product_id: 0x0AAA,
device_version: 0x0002,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
max_packet_size_0: 64,
speed: Some(
Full,
),
manufacturer_string: None,
product_string: None,
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-8",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
InterfaceInfo {
interface_number: 1,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 3,
port_chain: [6],
vendor_id: 0x04F2,
product_id: 0x0402,
device_version: 0x0165,
class: 0x00,
subclass: 0x00,
protocol: 0x00,
max_packet_size_0: 8,
speed: Some(
Low,
),
manufacturer_string: Some(
"Chicony",
),
product_string: Some(
"USB Keyboard",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-6",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x03,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
InterfaceInfo {
interface_number: 1,
class: 0x03,
subclass: 0x00,
protocol: 0x00,
interface_string: None,
},
],
}
ca
…On Mon, Aug 12, 2024 at 8:20 PM Kevin Mehall ***@***.***> wrote:
Yes, with the exception of not including the virtual "Linux Foundation
root hub" items as of recently
<#72>, the nusb list example
should list the same devices as lsusb. Both commands list devices and not
empty ports. So if you have USB devices plugged in, are not in a container
/ VM that restricts USB access, and see those devices in lsusb but not cargo
run --example list, that sounds like a bug. Please open an issue with the
debug log (run with environment variable RUST_LOG=nusb=debug), the output
of lsusb and ls -l /sys/bus/usb/devices, and your distro and kernel
versions.
—
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM6ZKXSDI7WJFBMDAY3W6Y3ZRFGMBAVCNFSM6AAAAABMNAAZWOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZRHE3TMNA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
redox-os cannot yet run crate, so I assume I can make list a stand-alone
app nlist dependent on nusb and see if that runs?
…On Thu, Aug 15, 2024 at 9:13 AM John Coonrod ***@***.***> wrote:
Ok, this is running on an Asus minipc PN41 with Celeron 5100 stable Pop-OS
Kernel 6.9.3-76060903-generic
And it does indeed list lots of stuff!
I was trying it before on Crostini, which is a container so that probably
explains why it didn't work.
On Redox-OS drivers are in userspace. Here are the relevant sources:
https://github.com/redox-os/drivers
Later today I'll try compiling it to run in redox-os and see if it works.
Thanks!
***@***.***:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson
Peak (JfP)
Bus 001 Device 004: ID 04f2:0939 Chicony Electronics Co., Ltd Amazon
Basics mouse
Bus 001 Device 003: ID 04f2:0402 Chicony Electronics Co., Ltd Genius
LuxeMate i200 Keyboard
Bus 001 Device 006: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
***@***.***:~$ ^C
***@***.***:~$
DeviceInfo {
bus_id: "001",
device_address: 4,
port_chain: [7],
vendor_id: 0x04F2,
product_id: 0x0939,
device_version: 0x0100,
class: 0x00,
subclass: 0x00,
protocol: 0x00,
max_packet_size_0: 8,
speed: Some(
Low,
),
manufacturer_string: Some(
"PixArt",
),
product_string: Some(
"USB Optical Mouse",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-7",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x03,
subclass: 0x01,
protocol: 0x02,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 6,
port_chain: [3],
vendor_id: 0x1A40,
product_id: 0x0801,
device_version: 0x0100,
class: 0x09,
subclass: 0x00,
protocol: 0x01,
max_packet_size_0: 64,
speed: Some(
High,
),
manufacturer_string: None,
product_string: Some(
"USB 2.0 Hub",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-3",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x09,
subclass: 0x00,
protocol: 0x00,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 5,
port_chain: [8],
vendor_id: 0x8087,
product_id: 0x0AAA,
device_version: 0x0002,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
max_packet_size_0: 64,
speed: Some(
Full,
),
manufacturer_string: None,
product_string: None,
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-8",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
InterfaceInfo {
interface_number: 1,
class: 0xE0,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
],
}
DeviceInfo {
bus_id: "001",
device_address: 3,
port_chain: [6],
vendor_id: 0x04F2,
product_id: 0x0402,
device_version: 0x0165,
class: 0x00,
subclass: 0x00,
protocol: 0x00,
max_packet_size_0: 8,
speed: Some(
Low,
),
manufacturer_string: Some(
"Chicony",
),
product_string: Some(
"USB Keyboard",
),
serial_number: None,
sysfs_path: SysfsPath(
"/sys/bus/usb/devices/1-6",
),
busnum: 1,
interfaces: [
InterfaceInfo {
interface_number: 0,
class: 0x03,
subclass: 0x01,
protocol: 0x01,
interface_string: None,
},
InterfaceInfo {
interface_number: 1,
class: 0x03,
subclass: 0x00,
protocol: 0x00,
interface_string: None,
},
],
}
ca
On Mon, Aug 12, 2024 at 8:20 PM Kevin Mehall ***@***.***>
wrote:
> Yes, with the exception of not including the virtual "Linux Foundation
> root hub" items as of recently
> <#72>, the nusb list example
> should list the same devices as lsusb. Both commands list devices and
> not empty ports. So if you have USB devices plugged in, are not in a
> container / VM that restricts USB access, and see those devices in lsusb
> but not cargo run --example list, that sounds like a bug. Please open an
> issue with the debug log (run with environment variable
> RUST_LOG=nusb=debug), the output of lsusb and ls -l /sys/bus/usb/devices,
> and your distro and kernel versions.
>
> —
> Reply to this email directly, view it on GitHub
> <#75 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AM6ZKXSDI7WJFBMDAY3W6Y3ZRFGMBAVCNFSM6AAAAABMNAAZWOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZRHE3TMNA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
You're right - when I run the redox build tools it seems to be a "platform"
crate with a Device method - is that yours or a generic one somewhere? I'm
happy to work on the redox part.
…On Thu, Aug 15, 2024 at 10:45 AM Kevin Mehall ***@***.***> wrote:
Most of nusb, including listing devices, is platform-specific code, so
unless someone writes that for redox it's not going to work.
—
Reply to this email directly, view it on GitHub
<#75 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM6ZKXR5TKLZ6LOBCHRKTW3ZRS5HZAVCNFSM6AAAAABMNAAZWOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZUHA3TCMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll see what I can do for redox!
…On Fri, Aug 16, 2024 at 6:18 PM Kevin Mehall ***@***.***> wrote:
https://github.com/kevinmehall/nusb/tree/main/src/platform
—
Reply to this email directly, view it on GitHub
<#75 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM6ZKXXOOGK5NNCN5BDQZUDZRZ3BVAVCNFSM6AAAAABMNAAZWOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZWGMZDMOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm interested in developing more USB device drivers for Redox-OS, which puts all drivers in user space. It currently has very limited USB support (for example, it cannot deal with hubs). Before trying it inside Redox-OS I cloned nusb in Linux and in nusb did cargo run --example list, which compiled without error but I was expecting it to give me output a bit like the linux lsusb but there was nothing. Should I have seen a listing in the terminal of the USB ports?
Beta Was this translation helpful? Give feedback.
All reactions