Re: [9fans] usbd problem - Plan9

This is a discussion on Re: [9fans] usbd problem - Plan9 ; Looking at /sys/src/cmd/usb/usbd/usbd.c, I wonder whether your problem has something to do with these lines? //unconscionable kludge (testing camera) if(d->class == 10) setup0(d, RH2D|Rinterface, SET_INTERFACE, 10, 0, 0);...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Re: [9fans] usbd problem

  1. Re: [9fans] usbd problem

    Looking at /sys/src/cmd/usb/usbd/usbd.c, I wonder whether
    your problem has something to do with these lines?

    //unconscionable kludge (testing camera)
    if(d->class == 10) setup0(d, RH2D|Rinterface, SET_INTERFACE, 10, 0, 0);


  2. Re: [9fans] usbd problem

    > Looking at /sys/src/cmd/usb/usbd/usbd.c, I wonder whether
    > your problem has something to do with these lines?
    >
    > //unconscionable kludge (testing camera)
    > if(d->class == 10) setup0(d, RH2D|Rinterface, SET_INTERFACE, 10, 0, 0);


    thanks for the suggestion, but the camera was a red herring.
    it was actually the usb key that i'd plugged in. the key works fine
    with xp. so i engineered a swap of usb keys. it was dying in
    setup0 with Estalled.

    shouldn't usbd be resistant to badly-behaving devices?
    it seems that any error on any endpoint will topple usbd,
    at least during configure.

    one final question, is there an advantage to usb/disk creating a fs
    that's incompatable with devsd? it would seem to make booting
    from usb root difficult.

    - erik


  3. Re: [9fans] usbd problem

    > one final question, is there an advantage to usb/disk creating a fs
    > that's incompatable with devsd? it would seem to make booting
    > from usb root difficult.


    Do you mean why doesn't the ctl file accept partition commands?
    You can always use fs(3) for that. But usb root is not very
    practical anyway, at least with uhci, because of a stubborn
    bug in the driver which makes transfers very very slow. Now
    there's ohci support I would be interested to know if that works
    at more like normal usb speed.



  4. Re: [9fans] usbd problem

    Actually, partfs(8) provides devsd-compatible partitions and is
    probably a better choice for this than fs(3). It wasn't cited in
    usbdisk(4)'s SEE ALSO, but it is now.


  5. Re: [9fans] usbd problem

    > Actually, partfs(8) provides devsd-compatible partitions

    Cool - I hadn't noticed when that appeared.


  6. Re: [9fans] usbd problem

    > Do you mean why doesn't the ctl file accept partition commands?
    > You can always use fs(3) for that. But usb root is not very
    > practical anyway, at least with uhci, because of a stubborn
    > bug in the driver which makes transfers very very slow. Now
    > there's ohci support I would be interested to know if that works
    > at more like normal usb speed.


    you're assuming that i want to continue to do i/o once i've booted. :-)
    the basic problem is that, e.g., ich9r boards have no pata at all. it used to
    be easy to boot from CF or a DOM. but that's becoming more of a
    problem. booting from usb might be the only cheep solid-state choice.

    geoff pointed out that usb/disk pulls in a lot of stuff and might need
    some work to run in the kernel. so perhaps i don't fully appreciate
    how interconnected /dev/usb?, usb/usbd, and usb/disk. i was under
    the impression that usb/disk was just a bit of glue that turns an
    endpoint into a block device.

    - erik

  7. Re: [9fans] usbd problem

    > geoff pointed out that usb/disk pulls in a lot of stuff and might need
    > some work to run in the kernel.


    Usb root can be done by putting usb/disk and usb/usbd into /boot and
    hacking /sys/src/9/boot/local.c a bit. I tried it once and it worked
    albeit slowly. However, getting 9load to use usb disk would be a
    bigger task.


  8. Re: [9fans] usbd problem

    We added booting via the BIOS to 9load specifically for USB (though it
    may have other uses), so that we wouldn't have to add to 9load and
    maintain 8,000 lines, and growing, of complex USB code (though that's
    likely due to the inherent complexity of USB rather than being the
    fault of those who have contributed USB code). See sdB0 and bios0 in
    9load(8). The BIOSes have been somewhat uncooperative, but if you
    make a USB floppy or USB disk be the first item in your BIOS boot
    order, remove

    *nobiosload=something

    from your plan9.ini, see the example in prep(8) for how to prepare
    such a USB disk, and the phase of the moon is right, it should work.
    It's worked here for us.

    If we get an EHCI driver written, this will all become much more
    interesting.


  9. Re: [9fans] usbd problem

    Hello,

    Thank you for working for usb support.

    In trying usb/disk I have a question:

    term% usb/disk
    term% disk/partfs /n/disk/0/data
    term% disk/mbr /dev/sdXX/data
    term% disk/fdisk -baw /dev/sdXX/data
    term% disk/prep /dev/sdXX/plan9
    empty 0 2 (2 sectors, 1.00 KB)
    9fat 2 30000 (29998 sectors, 14.64 MB)
    fs 30000 256913 (226913 sectors, 110.79 MB)
    nvram 256913 256914 (1 sectors, 512 B )
    >>> q

    term% ls -l /dev/sdXX
    /dev/sdXX/ctl
    /dev/sdXX/data
    /dev/sdXX/plan9
    term%

    Where is 9fat, fs and nvram created by disk/prep?

    Kenji Arisawa


  10. Re: [9fans] usbd problem

    > Where is 9fat, fs and nvram created by disk/prep?

    Did you forget the 'w' command?


  11. Re: [9fans] usbd problem

    Oh yes, I misread the situation:
    term% disk/prep /dev/sdXX/plan9
    empty 0 2 (2 sectors, 1.00 KB)
    9fat 2 30000 (29998 sectors, 14.64 MB)
    fs 30000 256913 (226913 sectors, 110.79 MB)
    nvram 256913 256914 (1 sectors, 512 B )
    >>> q


    Thanks.

    Kenji Arisawa

    On 2008/02/13, at 17:25, Richard Miller wrote:

    >> Where is 9fat, fs and nvram created by disk/prep?

    >
    > Did you forget the 'w' command?



  12. Re: [9fans] usbd problem

    >> Where is 9fat, fs and nvram created by disk/prep?
    >
    > Did you forget the 'w' command?


    Also, after restarting partfs you need to reload the
    partition information:

    disk/prep -p /dev/sdXX/data >/dev/sdXX/ctl


  13. Re: [9fans] usbd problem

    I'm not having a good day. I said:

    > Also, after restarting partfs you need to reload the
    > partition information:
    >
    > disk/prep -p /dev/sdXX/data >/dev/sdXX/ctl


    Of course it should be:

    disk/fdisk -p /dev/sdXX/data >/dev/sdXX/ctl
    disk/prep -p /dev/sdXX/plan9 >/dev/sdXX/ctl


  14. Re: [9fans] usbd problem

    > We added booting via the BIOS to 9load specifically for USB

    Oh yes, I had forgotten that. None of my machines seem to be
    willing to boot from any of my usb flash drives. However I have
    just successfully resurrected my experiment with using a kfs
    on usb disk as root - see /contrib/miller/usb/boot for info.
    It should work for fossil as well but I haven't tried that.


  15. Re: [9fans] usbd problem

    Or just run diskparts(8) again.


+ Reply to Thread