On Thu Feb 27 23:32:49 EST 2014, hcaulfiel...@gmail.com wrote:
> This probably won't help, but what happened when I installed Plan 9 onto
> my Raspberry Pi, is the mouse worked but not the keyboard. So I ended up
> going to store and buying the cheapest keyboard that I could find. I
> plugged in the keyboard and it worked. It wasn't a power issue because
> Linux worked with the previous keyboard/mouse combo. I then configured
> the system as a cpu/fs/auth server so I don't have to worry about
> keyboard or mouse anymore :)
> 
> Regardless, my solution was just trying different combinations of mouse
> and keyboard until I found one that would work, your mileage may vary.
> Hope this helps,

that sounds worse than my experience.  i have maybe 5-6 keyboards
and they all work with the pi.  i wonder if this isn't due to some
small descriptor handling changes in 9atom.  you can try them out
by copying the source from 9atom.org

        cd
        hget http://ftp.9atom.org/other/usbd.arm > usbd.test
        bind usbd.test /arm/bin/usb/usbd
        cd /sys/src/9/bcm
        mk clean; mk; 
        diskparts; mount /dev/sdM0/dos /n/9fat  # from memory.  no pi here.
        cp 9pi /n/9fat                          # from memory.  no pi here.

you can make this safer by duplicating the pi sd card first, then
replacing the kernel.  or, naming the kernel something else on
the sd card and editing CONFIG.TXT to match.  then you
can fix with any old machine.

- erik

; 9diff *
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:205,217 - dev.c:205,222
  loaddevstr(Dev *d, int sid)
  {
        uchar buf[128];
-       int type;
-       int nr;
+       int type, langid, nr;
  
        if(sid == 0)
                return estrdup("none");
        type = Rd2h|Rstd|Rdev;
-       nr=usbcmd(d, type, Rgetdesc, Dstr<<8|sid, 0, buf, sizeof(buf));
+       nr = usbcmd(d, type, Rgetdesc, Dstr<<8|sid, 0, buf, sizeof(buf));
+       if(nr < 4)
+               langid = 0x0409;                /* english */
+       else
+               langid = buf[3]<<8 | buf[2];
+       nr = usbcmd(d, type, Rgetdesc, Dstr<<8|sid, langid, buf, sizeof(buf));
+ 
        return mkstr(buf, nr);
  }
  
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:228,233 - dev.c:233,245
        memset(buf, 0, Ddevlen);
        if((nr=usbcmd(d, type, Rgetdesc, Ddev<<8|0, 0, buf, nr)) < 0)
                return -1;
+       if(nr == 17){
+               print("%s: langid %.4ux\n", argv0, buf[3]<<8|buf[2]);
+               if((nr = usbcmd(d, type, Rgetdesc, Ddev<<8|0, buf[3]<<8|buf[2], 
buf, 18)) < 0)
+                       return -1;
+               print("%s: nr = %d; buf[%d] = %.2ux\n", argv0, nr, nr, buf[nr]);
+       }
+ 
        /*
         * Several hubs are returning descriptors of 17 bytes, not 18.
         * We accept them and leave number of configurations as zero.
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:234,241 - dev.c:246,253
         * (a get configuration descriptor also fails for them!)
         */
        if(nr < Ddevlen){
-               print("%s: %s: warning: device with short descriptor\n",
-                       argv0, d->dir);
+               print("%s: %s: warning: device with short descriptor: %d 
bytes\n",
+                       argv0, d->dir, nr);
                if(nr < Ddevlen-1){
                        werrstr("short device descriptor (%d bytes)", nr);
                        return -1;
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:254,259 - dev.c:266,273
                        d->usb->serial = loaddevstr(d, d->usb->ssid);
                }
        }
+       else
+               print("usbd: desc error: %r");
        return nr;
  }
  

Reply via email to