[SOLVED]Cannot detect connections of USB devices
Posted: Thu Nov 05, 2020 2:17 am
Hello. After solving a problem (viewtopic.php?f=1&t=37366), I confirmed that the event ring and the command ring of xHC worked (at least on QEMU) by sending a No-op TRB after running xHC. However, this OS cannot detect the connections of USB devices. Reading CCS bit of all port_sc registers returns 0.
I use this command to run QEMU:
Code: https://github.com/toku-sa-n/ramen/tree/check_each_port xHCI codes are in kernel/src/device/pci/xhci/
Trace log: https://gist.github.com/0d088d581a61c74 ... 6dc66dbecd
Am I missing something?
Thanks,
(Note that I don't enable interruptions from xHC. I just poll the event ring.)
EDIT: I confirmed that the port 0 is in RxDetect state and the state didn't change. According to Ben's book, this indicates that the device has a fault (or broken?). However, my mouse device is not broken, and even if I specify `-device usb-mouse`, the state doesn't change.
I use this command to run QEMU:
Code: Select all
qemu-system-x86_64 -drive if=pflash,format=raw,file=OVMF_CODE.fd,readonly=on -drive if=pflash,format=raw,file=OVMF_VARS.fd,readonly=on -drive format=raw,file=build/ramen_os.img -no-reboot -m 4G -d int -device isa-debug-exit,iobase=0xf4,iosize=0x04 -device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 --trace events=trace.event -no-shutdown -monitor stdio
Trace log: https://gist.github.com/0d088d581a61c74 ... 6dc66dbecd
Am I missing something?
Thanks,
(Note that I don't enable interruptions from xHC. I just poll the event ring.)
EDIT: I confirmed that the port 0 is in RxDetect state and the state didn't change. According to Ben's book, this indicates that the device has a fault (or broken?). However, my mouse device is not broken, and even if I specify `-device usb-mouse`, the state doesn't change.