5

I'm working on a raw, x86 real-mode USB access project. This involves a custom bootsector, 2nd stage bootloader, and some trivial hardware drivers.

End goal is to provide a product that boots, sends data over USB interface, receives data over USB interface, and prints result value to screen. I have everything but USB access finished.

I've already discovered that BIOS does NOT provide access to onboard USB. I've been through dozens of sites from osdevver to brokenthorn. I've even looked at the USB 2.0 specification.

Nobody, nowhere, gives any relevant or useful information about directly accessing a USB Root Hub using x86 Assembly in x86 Real Mode without going through some preexisting operating system.

Isn't there a standard IN/OUT port set for USB Root Hubs? And if there is, where exactly is the documentation specifying the standard communication that allows software to tell the Hub what data to send and what connected device to send that data to?

Mat
  • 202,337
  • 40
  • 393
  • 406
  • x86 real mode, with ... no OS support? This probably means interfacing with your chipset's PCI controller, using the PCI controller to detect, (re)-initialize your chipset's USB controller. Then there's the trouble of setting up memory mappings and IRQ handling (which you might not enough room to even perform in the 1MB and 8 IRVs accessible in real mode). I might have some of the details wrong here, but you almost certainly don't want to do this. Build on top of a small embedded OS like http://ecos.sourceware.org/ instead. – Managu Aug 04 '12 at 18:19
  • So the USB Root Hub is going to be subordinate to the PCI controller? – Andrew B. Painter Aug 04 '12 at 18:20
  • 1
    This is a dinosaurs-and-human movie anachronism. USB appeared long after protected mode operating systems became main-stream. Necessarily so, you can never cram the required device drivers in the address space available in a real mode OS. – Hans Passant Aug 04 '12 at 18:33
  • I'd mark Managu's first comment as the answer if I could. – Andrew B. Painter Aug 04 '12 at 23:10
  • http://stackoverflow.com/questions/14194798/is-there-a-specification-of-x86-i-o-port-assignment – Ciro Santilli OurBigBook.com Oct 27 '15 at 08:24

1 Answers1

0

It's not possible to have USB interface in real mode. You may implement that in protected mode as shown in PrettyOS.And it's not that easy to implement if we compare with our PS/2 interface.

Sreeraj Chundayil
  • 5,548
  • 3
  • 29
  • 68