public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SERIO_USERDEV: direct userspace access to mouse/keyboard psaux serial ports
@ 2004-05-07 20:55 Tuukka Toivonen
  2004-05-08  2:35 ` Andrew Morton
  0 siblings, 1 reply; 80+ messages in thread
From: Tuukka Toivonen @ 2004-05-07 20:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: danlee, b-gruber, Mikael Hakali

Download:
wget http://www.ee.oulu.fi/~tuukkat/tmp/linux-2.6.5-userdev.20040507.patch

This is the first public release of the patch, but it has been already
tested by a few people, so it should be stable.

I hope to get some more testers, and if no serious bugs are found, I really
would like this to get included into the mainstream kernel.

Snippet from the documentation:

SERIO_USERDEV - Direct serial input device access for userspace

This driver provides direct access from usespace into PS/2 (or psaux)
serial ports used usually for input devices such as mouses and keyboards.

The code is part of the serio module. It can be enabled or disabled
from kernel configuration
    Device Drivers -> Input device support -> User space driver support
if serial i/o support is enabled.

All available devices will be registered as miscellaneous
devices with major 10, minor dynamically allocated. The devices
with their minors will be listed in /proc/misc with isa0060/serio0
for keyboard and the rest for pointing devices. If devfs is enabled,
the device files will be created as /dev/misc/isa0060/serio*.

The created devices which are connected to a mouse can be usually
used in place of /dev/psaux which was used in 2.4.x kernels.
Therefore, you could do (if devfs is enabled):
    ln -s /dev/misc/isa0060/serio1 /dev/psaux
(or some other device) and run mouse drivers such as gpm and XFree86
just as with 2.4.x kernel.

Features:
- Both read and write support to all PS/2 ports. With active multiplexing,
  there will be five serial ports up to isa0060/serio4.
- Multiple readers supported, each reader will get copy of the complete stream.
  Write locking supported via special ioctl calls.


^ permalink raw reply	[flat|nested] 80+ messages in thread
[parent not found: <xb7oenxyqly.fsf@savona.informatik.uni-freiburg.de>]
* Re: keyboard problem with 2.6.6
@ 2004-06-06  9:43 Sau Dan Lee
  0 siblings, 0 replies; 80+ messages in thread
From: Sau Dan Lee @ 2004-06-06  9:43 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

>>>>> "Valdis" == Valdis Kletnieks <Valdis.Kletnieks@vt.edu> writes:

    Valdis> On Fri, 04 Jun 2004 22:33:41 +0300, Denis Vlasenko said:
    >> Using shell scripts instead of 'standard' init etc is way more
    >> configurable. As an example, my current setup at home:
    >> 
    >> My kernel params are:

    Valdis> Yes. Those are *YOUR* config setup parameters, that happen
    Valdis> to work with *your* specific configuration when everything
    Valdis> is operational. Some problems:

    Valdis> 1) Not all the world uses initrd....

Does ever /etc/rcS.d/* require initrd?

Moreover, not all the world uses a keyboard, either.



    Valdis> 2) I hope your /script/mount_root will Do The Right Thing
    Valdis> if the mount fails because it needs an fsck, for example.
    Valdis> Answering those 'y' and 'n' prompts can be a problem if
    Valdis> your keyboard isn't working yet..

Things even worse  can happen, too, such as  harddisk dying.  In those
problematic situations,  you'd rather boot a failsafe  partition, or a
rescue floppy, or Knoppix CD.


    Valdis> 3) Bonus points if you can explain how to, *without* a
    Valdis> working keyboard, modify that /linuxrc on your initrd to
    Valdis> deal with the situation where your keyboard setup is wrong
    Valdis> (think "booting with borrowed keyboard because your usual
    Valdis> one just suffered a carbonated caffeine overdose")...

How  do you  do the  same if  you had  only SCSI  disks, but  the SCSI
modules are not loaded or compiled in?


    Valdis> There's a *BASIC* bootstrapping problem here - if you move
    Valdis> "initialize and handle the keyboard" into userspace, you
    Valdis> then *require* that a significantly larger chunk of
    Valdis> userspace be operational in order to be able to even type
    Valdis> at the machine.  If you're trying to recover a *broken*
    Valdis> userspace, it gets a lot harder.


    Valdis> And the embedded people who use
    Valdis> "init=/onlyprogramthateverruns" are going to have a
    Valdis> significant collective cow about this....

Does embedded systems always have a keyboard?




-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


^ permalink raw reply	[flat|nested] 80+ messages in thread
* Re: keyboard problem with 2.6.6
@ 2004-06-06  9:37 Sau Dan Lee
  2004-06-06 11:29 ` Martin Schlemmer
                   ` (2 more replies)
  0 siblings, 3 replies; 80+ messages in thread
From: Sau Dan Lee @ 2004-06-06  9:37 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

>>>>> "Valdis" == Valdis Kletnieks <Valdis.Kletnieks@vt.edu> writes:

    >> You don't tell any kernel about that... it is the bootloader
    >> you are talking to. And that one may very well have integrated
    >> kbd support.

    Valdis> So GRUB knows about keyboards, lets you type in the
    Valdis> "init=/bin/bash", it loads the kernel, the kernel launches
    Valdis> init, /bin/bash gets loaded 

If  init can  launch /bin/bash  (actually,  it lauches  getty in  most
setups), why can't it start the userland keyboard driver daemon?

Back  in the  old days  before the  introduction of  /etc/rc.d/, every
daemon was started from by init.


    Valdis> - and /bin/bash can't talk to the keyboard because the
    Valdis> userspace handler hasn't happened.  

As soon as the daemon is  running, /bin/bash can talk to the keyboard.
There is not much concurrency problems here.  The current input system
makes  it possible  for /bin/bash  to start  opening the  keyboard and
waiting for input before the userspace handler is ready.


    Valdis> At that point you're stuck...

I  can't see  how stuck  it is.   And if  you fear  that  the userland
keyboard driver  would crash  (maybe due to  bugs), use  the 'respawn'
option in /etc/inittab.



-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


^ permalink raw reply	[flat|nested] 80+ messages in thread
[parent not found: <xb7ekp2b34y.fsf@savona.informatik.uni-freiburg.de>]
* Re: keyboard problem with 2.6.6
@ 2004-05-30 10:57 Sau Dan Lee
  2004-06-01 11:31 ` Pavel Machek
  0 siblings, 1 reply; 80+ messages in thread
From: Sau Dan Lee @ 2004-05-30 10:57 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: linux-kernel

>>>>> "Giuseppe" == Giuseppe Bilotta <bilotta78@hotpop.com> writes:

    Giuseppe> So, while we wait for complete support, at the kernel
    Giuseppe> level, for all the multimedia keyboards supported by X,
    Giuseppe> we *need* proper raw mode.

My question is: why do everything inside the kernel?


Even  'khttpd' has  been removed  from  the kernel,  because the  same
efficiency has been achieved in  the *userland* apache module.  Why is
the input layer moving _backwards_?

I  don't think  converting  between keyboard/mouse  protocols and  the
input   system's  "struct   input_event"  has   a   tighter  real-time
requirement  than a  heavily loaded  web  server.  How  many keys  per
second can  you type  at?  (Even  if you type  extremely fast  and the
hardware constraints  (velocity, etc.) are  not reached yet,  there is
still  a  limit that  the  keyboard  controller,  e.g.  i8042,  cannot
exceed.)  How  many mouse movements are  you making per  second?  Is a
userland driver unable  to handle that data rate?   (I don't think so.
I believe enve a 386-DX 33MHz  can handle it with ease.)  If not, then
please do it  in userland, so as not to waste  kernel memory (which is
*NON-swappable*).




-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


^ permalink raw reply	[flat|nested] 80+ messages in thread
* Re: keyboard problem with 2.6.6
@ 2004-05-30 10:45 Sau Dan Lee
  2004-05-30 11:20 ` Vojtech Pavlik
  0 siblings, 1 reply; 80+ messages in thread
From: Sau Dan Lee @ 2004-05-30 10:45 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: Tuukka Toivonen, linux-kernel

>>>>> "Vojtech" == Vojtech Pavlik <vojtech@suse.cz> writes:

    On Sat, May 29, 2004 at 03:23:20PM +0200, Andries Brouwer
    >> Thanks for the report. It shows that resurrecting raw mode is
    >> even more desirable than I thought at first.

    Vojtech> What for?

For more imaginative innovations.

e.g. try my keyboard driver across 2 machines (using the SERIO_USERDEV
patch from Tuukka Toivonen and me):

    master$ cat /dev/misc/isa0060/serio0 | ssh slave atkbd /proc/self/fd/0

The patch is here:
    http://www.ee.oulu.fi/~tuukkat/tmp/linux-2.6.5-userdev.20040507.patch

The driver is here:
    http://www.informatik.uni-freiburg.de/~danlee/fun/psaux/atkbd.c

(I haven't  tried this, as  I don't have  2 machines under  my control
(==root) to try it out.  Please tell me the results.)



-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


^ permalink raw reply	[flat|nested] 80+ messages in thread
* Re: keyboard problem with 2.6.6
@ 2004-05-30 10:39 Sau Dan Lee
  2004-05-30 11:18 ` Vojtech Pavlik
  0 siblings, 1 reply; 80+ messages in thread
From: Sau Dan Lee @ 2004-05-30 10:39 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

>>>>> "Vojtech" == Vojtech Pavlik <vojtech@suse.cz> writes:

    Vojtech> On Fri, May 28, 2004 at 04:59:55PM +0300, Tuukka Toivonen
    Vojtech> wrote:
    >> Giuseppe Bilotta wrote: >The new system has some ups and
    >> downs. The biggest "down", >which is that of RAW mode not being
    >> available anymore (it's >emulated!) could be circumvented by
    >> having both the RAW and >translated codes move between layers.
    >> 
    >> Ouch! If the user asks for raw mode, he doesn't get it, but
    >> some emulated mode? To me this sounds like a big
    >> incompatibility.

    Vojtech> Q1: What would you do if the user has an USB keyboard?

If he was  raw mode from a  USB keyboard, he should get  the raw data.
Of course, he should know what he's doing.


    Vojtech> Q2: What application should be looking at the raw data
    Vojtech> outside the kernel and why?

What application should be looking at  the raw data from an RS232 port
outside the kernel and why?

Why do you  leave 'efax' in userspace, letting  it read/write raw data
to/from the modem via the RS232?


    >> Fortunately this patch (written together with Sau Dan Lee)
    >> should give _really_ raw mode in 2.6.x too (but it's not
    >> compatible with the raw mode in 2.4.x):
    >> 
    >> http://www.ee.oulu.fi/~tuukkat/tmp/linux-2.6.5-userdev.20040507.patch
 
In a nutshell, I hate to be restricted by YOUR own imaginations of how
people should hack  the system.

Raw keyboard  data, for  instance, can be  captured for  analyzing how
people use the  keyboard and coming up with  a more efficient keyboard
layout (c.f. Dvorak).  That's already beyond your imaginations.



-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


^ permalink raw reply	[flat|nested] 80+ messages in thread
* Re: keyboard problem with 2.6.6
@ 2004-05-28 13:59 Tuukka Toivonen
  2004-05-29 13:14 ` Vojtech Pavlik
  0 siblings, 1 reply; 80+ messages in thread
From: Tuukka Toivonen @ 2004-05-28 13:59 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: linux-kernel

Giuseppe Bilotta wrote:
>The new system has some ups and downs. The biggest "down",
>which is that of RAW mode not being available anymore (it's
>emulated!) could be circumvented by having both the RAW and
>translated codes move between layers.

Ouch! If the user asks for raw mode, he doesn't get it, but some emulated
mode? To me this sounds like a big incompatibility. Fortunately this patch
(written together with Sau Dan Lee) should give _really_ raw mode in 2.6.x
too (but it's not compatible with the raw mode in 2.4.x):

http://www.ee.oulu.fi/~tuukkat/tmp/linux-2.6.5-userdev.20040507.patch

^ permalink raw reply	[flat|nested] 80+ messages in thread
[parent not found: <MPG.1b2111558bc2d299896a2@news.gmane.org.suse.lists.linux.kernel>]

end of thread, other threads:[~2004-06-09 17:29 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-07 20:55 [PATCH] SERIO_USERDEV: direct userspace access to mouse/keyboard psaux serial ports Tuukka Toivonen
2004-05-08  2:35 ` Andrew Morton
2004-05-25 20:16   ` keyboard problem with 2.6.6 Chris Osicki
2004-05-26  7:54     ` Sau Dan Lee
2004-05-28 13:33       ` Giuseppe Bilotta
2004-05-28 17:37       ` Sau Dan Lee
2004-05-29 13:12         ` Vojtech Pavlik
2004-05-30  9:45           ` Sau Dan Lee
2004-05-30 10:19             ` Vojtech Pavlik
2004-05-30 11:25               ` Sau Dan Lee
2004-05-30 11:40                 ` Brad Campbell
2004-05-30 12:01                 ` Oliver Neukum
2004-05-30 12:22                   ` Sau Dan Lee
2004-05-30 12:32                     ` Oliver Neukum
2004-05-30 12:16                 ` Vojtech Pavlik
2004-05-30 12:40                   ` Sau Dan Lee
2004-05-30 12:52                     ` Vojtech Pavlik
2004-05-30 16:09                     ` Stefan Seyfried
2004-05-30 17:26                     ` Dmitry Torokhov
2004-06-04 13:58                 ` Pavel Machek
2004-06-04 18:17                   ` Horst von Brand
2004-06-04 18:37                     ` Valdis.Kletnieks
2004-06-04 19:33                       ` Denis Vlasenko
2004-06-04 19:50                         ` Valdis.Kletnieks
2004-06-04 20:48                           ` Denis Vlasenko
2004-06-04 18:39                     ` Pavel Machek
2004-06-04 18:46                       ` Sau Dan Lee
2004-06-04 19:09                         ` Pavel Machek
2004-06-06  9:01                           ` Sau Dan Lee
2004-06-06 16:40                             ` Pavel Machek
2004-05-28 19:39       ` 2.6.* useland replacements of the atkbd and psmouse modules Sau Dan Lee
2004-05-28 19:57       ` keyboard problem with 2.6.6 Andries Brouwer
2004-06-01  8:21       ` BUG: atkbd.c keyboard driver bug [Was: keyboard problem with 2.6.6] Sau Dan Lee
2004-06-01  9:13       ` BUG FIX: " Sau Dan Lee
     [not found]       ` <200406010904.i5194pSo010367@fire-2.osdl.org>
2004-06-01  9:44         ` Sau Dan Lee
2004-06-01  9:55           ` Vojtech Pavlik
2004-06-01 10:03             ` Sau Dan Lee
2004-06-01 12:42             ` Giuseppe Bilotta
2004-05-28 19:41     ` keyboard problem with 2.6.6 Andries Brouwer
2004-05-28 20:10       ` Andries Brouwer
     [not found]       ` <20040528214620.GA2352@gucio>
2004-05-29 13:23         ` Andries Brouwer
2004-05-29 13:46           ` Vojtech Pavlik
2004-05-29 14:30             ` Andries Brouwer
2004-05-29 14:41               ` Vojtech Pavlik
2004-05-29 15:12             ` Giuseppe Bilotta
     [not found] <xb7oenxyqly.fsf@savona.informatik.uni-freiburg.de>
     [not found] ` <200406071551.i57Fpl89023562@turing-police.cc.vt.edu>
     [not found]   ` <xb7zn7fwdia.fsf@savona.informatik.uni-freiburg.de>
     [not found]     ` <200406071636.i57Gafh7024942@turing-police.cc.vt.edu>
     [not found]       ` <xb7r7sqwncc.fsf@savona.informatik.uni-freiburg.de>
     [not found]         ` <200406081502.i58F2gF3013622@turing-police.cc.vt.edu>
2004-06-09  8:17           ` Sau Dan Lee
2004-06-09 16:56             ` Valdis.Kletnieks
2004-06-09 17:12               ` Sau Dan Lee
2004-06-09 17:29                 ` Valdis.Kletnieks
  -- strict thread matches above, loose matches on Subject: below --
2004-06-06  9:43 Sau Dan Lee
2004-06-06  9:37 Sau Dan Lee
2004-06-06 11:29 ` Martin Schlemmer
2004-06-06 12:07 ` Vojtech Pavlik
2004-06-06 15:09 ` Dmitry Torokhov
2004-06-06 16:13   ` Sau Dan Lee
     [not found]   ` <200406061929.45169.vda@port.imtp.ilyichevsk.odessa.ua>
     [not found]     ` <200406061140.35929.dtor_core@ameritech.net>
2004-06-06 16:51       ` Sau Dan Lee
     [not found] <xb7ekp2b34y.fsf@savona.informatik.uni-freiburg.de>
     [not found] ` <20040530112138.GC1377@ucw.cz>
2004-05-30 11:43   ` Sau Dan Lee
2004-05-30 12:45     ` Vojtech Pavlik
2004-05-30 13:25       ` Sau Dan Lee
2004-05-30 10:57 Sau Dan Lee
2004-06-01 11:31 ` Pavel Machek
2004-06-01 14:06   ` John Bradford
2004-05-30 10:45 Sau Dan Lee
2004-05-30 11:20 ` Vojtech Pavlik
2004-05-30 10:39 Sau Dan Lee
2004-05-30 11:18 ` Vojtech Pavlik
2004-05-30 11:40   ` Sau Dan Lee
2004-05-30 11:53     ` Russell King
2004-05-30 12:43     ` Vojtech Pavlik
2004-05-30 13:25       ` Sau Dan Lee
2004-06-01 21:01         ` jsimmons
2004-06-01 21:12           ` Valdis.Kletnieks
2004-05-30 13:54       ` Eduard Bloch
2004-05-30 14:03         ` Vojtech Pavlik
2004-06-01 21:03           ` jsimmons
2004-06-04 14:11     ` Pavel Machek
2004-05-28 13:59 Tuukka Toivonen
2004-05-29 13:14 ` Vojtech Pavlik
2004-06-04 14:54   ` Tuukka Toivonen
2004-06-04 16:06     ` Vojtech Pavlik
     [not found] <MPG.1b2111558bc2d299896a2@news.gmane.org.suse.lists.linux.kernel>
     [not found] ` <20040525201616.GE6512@gucio.suse.lists.linux.kernel>
     [not found]   ` <xb7hdu3fwsj.fsf@savona.informatik.uni-freiburg.de.suse.lists.linux.kernel>
     [not found]     ` <xb7aczscv0q.fsf@savona.informatik.uni-freiburg.de.suse.lists.linux.kernel>
     [not found]       ` <20040529131233.GA6185@ucw.cz.suse.lists.linux.kernel>
     [not found]         ` <xb7y8nab65d.fsf@savona.informatik.uni-freiburg.de.suse.lists.linux.kernel>
     [not found]           ` <20040530101914.GA1226@ucw.cz.suse.lists.linux.kernel>
     [not found]             ` <xb765aeb1i3.fsf@savona.informatik.uni-freiburg.de.suse.lists.linux.kernel>
     [not found]               ` <20040530121606.GA1496@ucw.cz.suse.lists.linux.kernel>

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox