Re: USB device just moves



Eric <Scorpus@xxxxxxxxxxxxxx> wrote:

USB must be polled at regular intervals,...

Interrupt and isochronous pipes must be polled at regular intervals. Other
pipe types do not.

...if a so called interrupt packet is
received (after it was polled for) then an SMI handler is invoked, and while
that handler is running **ALL** other code execution stops dead!

Oh, come on. Who told you that? Once an operating system is running, a
USB host controller is just a standard PCI device with a standard
interrupt-based DMA transfer scheme. SMI is not involved.

This can happen many times a second depending on whats connected and the
system design.
The usb keyboard is the worst offender with a transaction going something like
this:
pc formats and sends packet to keyboard -> do you have a key for me?
...
pc formats and sends packet to keyboard -> do you have a key for me?
-- repeated 50 - 100 times a second --
keyboard sends data back with keystroke to pc
USB controller invokes SMM (system management mode). Entire PC (all cores)
stops executing code or interrupts and starts executing SMI handler
SMI handler stuffs key data into 8249 keyboard controller.
SMI handler ends
An interrupt is generated either by or on behalf of the keyboard controller
8249 keyboard.
PC reads 8249 and retrieves key data

Is this insane or what?

That kind of BIOS magic might be needed to simulate the 8249 keyboard
controller at boot time, but once an operating system loads, all of that
goes out the window. It's just a standard PCI device using standard PCI
interrupts. No SMI.

There is nothing inherently wrong with a polled, dedicated master/slave bus
design. It avoids all the problems of assigning a bus master or handling
collisions among multiple senders.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.



Relevant Pages

  • usb keyboard vs btx: an SMI theory
    ... rret_tramp, to enter real mode, execute an interrupt handler and exit ... when a hardware interrupt happens while in protected mode. ... Now lets look at the other end - "USB legacy support". ... emulates PS/2 keyboard for real USB keyboard in the following way. ...
    (freebsd-hackers)
  • Re: Supporting a PS/2 Keyboard
    ... I don't have any USB to PS2 ... The NOP keyboard ... One alternative then is to get the hardware guy to put a PS/2 to USB ... I assume that CE's USB HID driver supports a USB ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Capturing USB data?
    ... USB hardware device that a USB Keyboard and Mouse ... device drivers in a different ring, ... Works on every OS platform ...
    (microsoft.public.vc.mfc)
  • Re: Once more VIA VT6212 USB Chip Problem
    ... I checked the interrupt init and I can see they are all set. ... I tried my image on this board and USB works fine!! ... Bus 0, Device 1, Function 0 ... is found for following PCI Device ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Supporting a PS/2 Keyboard
    ... I don't have any USB to PS2 ... The NOP keyboard ... I assume that CE's USB HID driver supports a USB ... interfacing directly to the PS2 connector through the supplied PB ...
    (microsoft.public.windowsce.platbuilder)