9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] usb/kb
@ 2014-03-20 15:19 erik quanstrom
  2014-03-26  2:20 ` 岡本健二
  0 siblings, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2014-03-20 15:19 UTC (permalink / raw)
  To: 9fans

i've made some improvements to 9atom's usb/kb.  they're a little
extensive, so i thought i'd request some feedback before i start
sending patches to sources.  the code is all in atom.

the reason i embarked on this was because the keypad wouldn't
work, and kb didn't play nice with japanese keyboards.  and it
turned out the root cause was fairly deep.

a bit of background.  the ps/2 keyboard driver sets led state.
the led state changes the scancodes produced.  so 9/pgup on
the keypad produces pgup with numlock off, and 9 with it on.
(my ibm keyboards don't behave like this, but that's the theory)

so after making the usb led work i realized that usb doesn't
change the usb keycode.  the driver must track this, and make
changes accordingly.  this requires some processing at the
usb code level (not the scan code output to /dev/kbin!).

since it's no longer a static range of bytes that gets escape scan
codes, it seemed that the escapes should be part of the usb code
to scan code tables.  this is because many different usb codes can
map to the same scan code.  (and we wouldn't know to escape it
or not.)  the pseudo code looks something like this

	for(;;){
		usbcode = getkey();
		switch(usbcode){
		case numlock ... kanashift:
			kbd->led ^= thisled;
			setleds(kbd);
			break;
		}
		scancode = usbtoscancode(usbcode, kbd->led);
		...
	}

so a few details that should now work are
- japanese keyboards,
- usb leds
- usb num lock.  the scroll lock and kana lights should also
work.  caps lock is disabled, and i didn't know what to do with
the compose led.  might be nice to light when composing, but
that would require usb/kb to do the composition itself, so
- the keypad works!
- f11, f12 work
- f13-f24 work but largely do strange things due to the fact that
page up/page down are mapped into this area.  we should consider
moving them safely out of the f-key range.
- keyboard restarting should work properly now, and not crash.
i think we were using the wrong eid.
- keyboards that present an Eboth endpoint should be recognized.

- erik



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] usb/kb
  2014-03-20 15:19 [9fans] usb/kb erik quanstrom
@ 2014-03-26  2:20 ` 岡本健二
  2014-03-26 14:04   ` erik quanstrom
  0 siblings, 1 reply; 5+ messages in thread
From: 岡本健二 @ 2014-03-26  2:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

The upas (your nupas) has problem with using POP3
mail reading.

In your source, there is a comment regarding this.
Yes, I met the same problem as your comment in
sanembmsg() in mbox.c.

Before trying this myself, I suppose you have some suggestion
on this point.  Where I should try first?

Kenji




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] usb/kb
  2014-03-26  2:20 ` 岡本健二
@ 2014-03-26 14:04   ` erik quanstrom
  2014-03-27  1:06     ` kokamoto
  0 siblings, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2014-03-26 14:04 UTC (permalink / raw)
  To: kokamoto, 9fans

On Tue Mar 25 22:22:23 EDT 2014, kokamoto@hera.eonet.ne.jp wrote:
> The upas (your nupas) has problem with using POP3
> mail reading.
>
> In your source, there is a comment regarding this.
> Yes, I met the same problem as your comment in
> sanembmsg() in mbox.c.
>
> Before trying this myself, I suppose you have some suggestion
> on this point.  Where I should try first?

i recommend commenting these lines out.

; g sanembmsg|grep pop
mbox.c:490: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
mbox.c:521: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
mbox.c:548: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */

- erik



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] usb/kb
  2014-03-26 14:04   ` erik quanstrom
@ 2014-03-27  1:06     ` kokamoto
  2014-03-27  1:23       ` erik quanstrom
  0 siblings, 1 reply; 5+ messages in thread
From: kokamoto @ 2014-03-27  1:06 UTC (permalink / raw)
  To: 9fans

> ; g sanembmsg|grep pop
> mbox.c:490: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
> mbox.c:521: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
> mbox.c:548: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */

Wow, that's very easy solution.
Yes, now I can receive mails from our pop server.
Thanks eric, your nupas is very nice.

This is my first email from nupas.

Kenji




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] usb/kb
  2014-03-27  1:06     ` kokamoto
@ 2014-03-27  1:23       ` erik quanstrom
  0 siblings, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2014-03-27  1:23 UTC (permalink / raw)
  To: 9fans

On Wed Mar 26 21:11:45 EDT 2014, kokamoto@hera.eonet.ne.jp wrote:
> > ; g sanembmsg|grep pop
> > mbox.c:490: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
> > mbox.c:521: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
> > mbox.c:548: sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
>
> Wow, that's very easy solution.
> Yes, now I can receive mails from our pop server.
> Thanks eric, your nupas is very nice.
>
> This is my first email from nupas.

cool!  i committed a patch today to comment out these lines.
these checks have not caught an error in years, so there's no
reason to leave them enabled.

- erik



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-27  1:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20 15:19 [9fans] usb/kb erik quanstrom
2014-03-26  2:20 ` 岡本健二
2014-03-26 14:04   ` erik quanstrom
2014-03-27  1:06     ` kokamoto
2014-03-27  1:23       ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).