Re: USB device just moves



phil-news-nospam@xxxxxxxx wrote:

On Mon, 11 Feb 2008 10:38:13 -0800 (PST) Mike
<michael.h.williamson@xxxxxxxxx> wrote:

| On Feb 10, 1:59 pm, phil-news-nos...@xxxxxxxx wrote:
|
|> This is a good example of how that legacy unix principle of assigning
|> device names in probe order is still a bad idea.
|
| But, if I understand correctly, is it not supposed to be possible to
| chain USB devices together somehow, using only one computer USB port?

USB hubs exist. Plug a hub into a computer USB port. You get multiple USB
ports. I have one that has 3 USB ports plus 4 memory card slots in the same
device. I've plugged external drives and USB keys in all three at the same
time. Of course that is now sharing the bandwidth of the one connection to
the computer. Otherwise I can get full speed on each USB port my computer
has (4 in back, 2 in front) concurrently (tested with the 4 in back at the
same time).

When this kind of "fan out" is done, there should be a _physical_ address
that also fans out, with a new range of numbers appended to the address of
the hub itself (maybe starting at .1 so the hub itself can be accessed at
the .0 subaddress). Maybe USB is doing this kind of thing behind the
scenes.
But there is no indication of that at the OS level. It seems USB addresses
are dyanmically assigned. So I would guess the computer has no idea where
a USB device is plugged in, beyond the ports it has on itself, and either
the messages are broadcast over hubs, or the hub is smart enough to track
the dynamic addresses and send things the right way.

I'm sure someone will say I should read the USB standards docs. But I do
not want the mental pollution. I'd rather design my own.

USB is a really terrible architecture, lowers performance of the computer in
general, and hopefully someday it will be replaced with something interrupt
driven. USB addresses are assigned as the system finds them the device itself
doesnt care a wit what address it gets as long as it gets on.
USB must be polled at regular intervals, 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! 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?
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?
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?
Eric
.



Relevant Pages

  • 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: 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)
  • Re: Capturing USB data?
    ... USB hardware device that a USB Keyboard and Mouse plug ... But the Mac uses a different ... device drivers in a different ring, and therefore has a quite different ...
    (microsoft.public.vc.mfc)
  • Re: Capturing USB data?
    ... USB hardware device that a USB Keyboard and Mouse plug ... drivers that provide for capturing and instantiating ... this is the platform that I am the most familiar with. ...
    (microsoft.public.vc.mfc)