From db618bd8025f21af892947b1b09e9935ee55ffca Mon Sep 17 00:00:00 2001 From: kieron Date: Fri, 27 Oct 2017 08:02:45 +0000 Subject: [PATCH] USB git-svn-id: https://spexeah.com:8443/svn/Asuro@280 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c --- src/driver/USB.pas | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/driver/USB.pas diff --git a/src/driver/USB.pas b/src/driver/USB.pas new file mode 100644 index 00000000..e925190b --- /dev/null +++ b/src/driver/USB.pas @@ -0,0 +1,60 @@ +unit USB; + +interface + +uses + Console, + PCI, + drivertypes; + +procedure init; + +implementation + +procedure init; +var + devices : TDeviceArray; + count : uint32; + i : uint32; + +begin + console.writestringln('USB: INIT BEGIN.'); + + devices:= PCI.getDeviceInfo($0C, $03, $00, count); + console.writestring('USB-UHCI: Found '); + console.writeint(count); + console.writestringln(' USB Controller(s).'); + if count > 0 then begin + for i:=0 to count-1 do begin + console.writestring('USB: Controller['); + console.writeint(i); + console.writestring(']: '); + console.writehex(devices[i].device_id); + console.writestring(' '); + console.writehex(devices[i].vendor_id); + console.writestring(' '); + console.writehexln(devices[i].prog_if); + end; + end; + + devices:= PCI.getDeviceInfo($0C, $03, $10, count); + console.writestring('USB-OHCI: Found '); + console.writeint(count); + console.writestringln(' USB Controller(s).'); + if count > 0 then begin + for i:=0 to count-1 do begin + console.writestring('USB: Controller['); + console.writeint(i); + console.writestring(']: '); + console.writehex(devices[i].device_id); + console.writestring(' '); + console.writehex(devices[i].vendor_id); + console.writestring(' '); + console.writehexln(devices[i].prog_if); + end; + end; + + console.writestringln('USB: INIT END.'); +end; + +end. \ No newline at end of file