linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PC keyboard rate/delay
@ 2001-06-12 14:19 Sergey Tursanov
  2001-06-12 16:02 ` Alan Cox
  2001-06-12 20:10 ` Guest section DW
  0 siblings, 2 replies; 10+ messages in thread
From: Sergey Tursanov @ 2001-06-12 14:19 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

In file include/linux/kd.h was declared KDKBDREP ioctl number
to tune up keyboard rate/delay with struct kbd_repeat.
But in 2.4.x kernel there is only m68k version for that.
I wrote some code for implement this feature on x86 machines.
Gzipped and uuencoded patch for kernel 2.4.5 is attached.
To setup keyboard rate/delay on x86 you should use code like that:

struct kbd_repeat kbd_rep={
       1000,      /* delay in ms */
       30         /* repeat rate in cps */
};
ioctl(0,KDKBDREP,&kbd_rep);

After that ioctl kbd_rep is filled with previous values.

I hope it will be useful for someone.

[-- Attachment #2: patch-kbdrate-2.4.5.gz --]
[-- Type: application/x-gzip, Size: 2355 bytes --]

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

* Re: PC keyboard rate/delay
  2001-06-12 14:19 PC keyboard rate/delay Sergey Tursanov
@ 2001-06-12 16:02 ` Alan Cox
  2001-06-12 16:21   ` James Simmons
  2001-06-12 17:23   ` Re[2]: " Sergey Tursanov
  2001-06-12 20:10 ` Guest section DW
  1 sibling, 2 replies; 10+ messages in thread
From: Alan Cox @ 2001-06-12 16:02 UTC (permalink / raw)
  To: __gsr; +Cc: linux-kernel

> In file include/linux/kd.h was declared KDKBDREP ioctl number
> to tune up keyboard rate/delay with struct kbd_repeat.
> But in 2.4.x kernel there is only m68k version for that.
> I wrote some code for implement this feature on x86 machines.
> Gzipped and uuencoded patch for kernel 2.4.5 is attached.
> To setup keyboard rate/delay on x86 you should use code like that:
> 
> struct kbd_repeat kbd_rep={
>        1000,      /* delay in ms */
>        30         /* repeat rate in cps */
> };
> ioctl(0,KDKBDREP,&kbd_rep);
> 
> After that ioctl kbd_rep is filled with previous values.
> I hope it will be useful for someone.

You must have been reading my mind. Yesterday I traced at least one X11
hang down to the kernel and X server both frobbing with the port at the same
time and crashing the microcontroller on my PC110.

Alan


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

* Re: PC keyboard rate/delay
  2001-06-12 16:02 ` Alan Cox
@ 2001-06-12 16:21   ` James Simmons
  2001-06-12 17:23   ` Re[2]: " Sergey Tursanov
  1 sibling, 0 replies; 10+ messages in thread
From: James Simmons @ 2001-06-12 16:21 UTC (permalink / raw)
  To: Alan Cox; +Cc: __gsr, linux-kernel


> > In file include/linux/kd.h was declared KDKBDREP ioctl number
> > to tune up keyboard rate/delay with struct kbd_repeat.
> > But in 2.4.x kernel there is only m68k version for that.
> > I wrote some code for implement this feature on x86 machines.
> > Gzipped and uuencoded patch for kernel 2.4.5 is attached.
> > To setup keyboard rate/delay on x86 you should use code like that:
> > 
> > struct kbd_repeat kbd_rep={
> >        1000,      /* delay in ms */
> >        30         /* repeat rate in cps */
> > };
> > ioctl(0,KDKBDREP,&kbd_rep);
> > 
> > After that ioctl kbd_rep is filled with previous values.
> > I hope it will be useful for someone.
> 
> You must have been reading my mind. Yesterday I traced at least one X11
> hang down to the kernel and X server both frobbing with the port at the same
> time and crashing the microcontroller on my PC110.

Also the beeper is a problem. Have X and a console app set off a beep at
the same time. I'm glad the input api will make these problems go away :-)




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

* Re[2]: PC keyboard rate/delay
  2001-06-12 16:02 ` Alan Cox
  2001-06-12 16:21   ` James Simmons
@ 2001-06-12 17:23   ` Sergey Tursanov
  2001-06-12 17:23     ` Geert Uytterhoeven
  2001-06-12 20:19     ` Guest section DW
  1 sibling, 2 replies; 10+ messages in thread
From: Sergey Tursanov @ 2001-06-12 17:23 UTC (permalink / raw)
  To: Alan Cox, linux-kernel

AC> You must have been reading my mind. Yesterday I traced at least one X11
AC> hang down to the kernel and X server both frobbing with the port at the same
AC> time and crashing the microcontroller on my PC110.

I think it would be better to place all of kbd controller code
into the kernel instead of using various userspace programs
such as kbdrate. Otherwise why KDKBDREP was defined ?-)

Sergey Tursanov                       mailto:__gsr@mail.ru



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

* Re: Re[2]: PC keyboard rate/delay
  2001-06-12 17:23   ` Re[2]: " Sergey Tursanov
@ 2001-06-12 17:23     ` Geert Uytterhoeven
  2001-06-12 17:56       ` James Simmons
  2001-06-12 20:19     ` Guest section DW
  1 sibling, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2001-06-12 17:23 UTC (permalink / raw)
  To: Sergey Tursanov; +Cc: Alan Cox, linux-kernel

On Tue, 12 Jun 2001, Sergey Tursanov wrote:
> AC> You must have been reading my mind. Yesterday I traced at least one X11
> AC> hang down to the kernel and X server both frobbing with the port at the same
> AC> time and crashing the microcontroller on my PC110.
> 
> I think it would be better to place all of kbd controller code
> into the kernel instead of using various userspace programs
> such as kbdrate. Otherwise why KDKBDREP was defined ?-)

Because (almost?) all m68k machines don't have PC style keyboard controllers,
so we _had_ to invent some other way to implement it in a portable (across all
m68k machines) way.

<wishful thinking>
Of course it would be nice if all architectures would want to use it.
</wishful thinking>

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: Re[2]: PC keyboard rate/delay
  2001-06-12 17:23     ` Geert Uytterhoeven
@ 2001-06-12 17:56       ` James Simmons
  2001-06-13  5:31         ` Geert Uytterhoeven
  0 siblings, 1 reply; 10+ messages in thread
From: James Simmons @ 2001-06-12 17:56 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Sergey Tursanov, Alan Cox, linux-kernel


> Because (almost?) all m68k machines don't have PC style keyboard controllers,
> so we _had_ to invent some other way to implement it in a portable (across all
> m68k machines) way.

This stuff is such a mess :-( Sparc has its own routines as well. 

> <wishful thinking>
> Of course it would be nice if all architectures would want to use it.
> </wishful thinking>

It will for 2.5.X :-)



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

* Re: PC keyboard rate/delay
  2001-06-12 14:19 PC keyboard rate/delay Sergey Tursanov
  2001-06-12 16:02 ` Alan Cox
@ 2001-06-12 20:10 ` Guest section DW
  1 sibling, 0 replies; 10+ messages in thread
From: Guest section DW @ 2001-06-12 20:10 UTC (permalink / raw)
  To: Sergey Tursanov, linux-kernel

On Tue, Jun 12, 2001 at 06:19:49PM +0400, Sergey Tursanov wrote:

> In file include/linux/kd.h was declared KDKBDREP ioctl number
> But in 2.4.x kernel there is only m68k version for that.
> I wrote some code for implement this feature on x86 machines.

Yes, it is unfortunate that many ioctls are needlessly different
between various architectures. But the utility kbdrate
works on all architectures I have tried it on.

Andries

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

* Re: PC keyboard rate/delay
  2001-06-12 17:23   ` Re[2]: " Sergey Tursanov
  2001-06-12 17:23     ` Geert Uytterhoeven
@ 2001-06-12 20:19     ` Guest section DW
  1 sibling, 0 replies; 10+ messages in thread
From: Guest section DW @ 2001-06-12 20:19 UTC (permalink / raw)
  To: Sergey Tursanov, Alan Cox, linux-kernel

On Tue, Jun 12, 2001 at 09:23:37PM +0400, Sergey Tursanov wrote:
> AC> You must have been reading my mind. Yesterday I traced at least one X11
> AC> hang down to the kernel and X server both frobbing with the port at the same
> AC> time and crashing the microcontroller on my PC110.
> 
> I think it would be better to place all of kbd controller code
> into the kernel instead of using various userspace programs
> such as kbdrate. Otherwise why KDKBDREP was defined ?-)

KDKBDREP on m68k
KIOCSRATE on sparc
/dev/port on i386 etc.

Yes, we want to get rid of /dev/port.


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

* Re: Re[2]: PC keyboard rate/delay
  2001-06-12 17:56       ` James Simmons
@ 2001-06-13  5:31         ` Geert Uytterhoeven
  2001-06-14 17:57           ` Alan Cox
  0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2001-06-13  5:31 UTC (permalink / raw)
  To: James Simmons; +Cc: Sergey Tursanov, Alan Cox, linux-kernel

On Tue, 12 Jun 2001, James Simmons wrote:
> > Because (almost?) all m68k machines don't have PC style keyboard controllers,
> > so we _had_ to invent some other way to implement it in a portable (across all
> > m68k machines) way.
> 
> This stuff is such a mess :-( Sparc has its own routines as well. 

Ours is older :-)

> > <wishful thinking>
> > Of course it would be nice if all architectures would want to use it.
> > </wishful thinking>
> 
> It will for 2.5.X :-)

Good!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: Re[2]: PC keyboard rate/delay
  2001-06-13  5:31         ` Geert Uytterhoeven
@ 2001-06-14 17:57           ` Alan Cox
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Cox @ 2001-06-14 17:57 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: James Simmons, Sergey Tursanov, Alan Cox, linux-kernel

> > It will for 2.5.X :-)
> Good!

Since it lets anyone hang many boxes by careful combined use of X and gpm I
suspect it wants fixing in 2.4

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

end of thread, other threads:[~2001-06-14 17:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-12 14:19 PC keyboard rate/delay Sergey Tursanov
2001-06-12 16:02 ` Alan Cox
2001-06-12 16:21   ` James Simmons
2001-06-12 17:23   ` Re[2]: " Sergey Tursanov
2001-06-12 17:23     ` Geert Uytterhoeven
2001-06-12 17:56       ` James Simmons
2001-06-13  5:31         ` Geert Uytterhoeven
2001-06-14 17:57           ` Alan Cox
2001-06-12 20:19     ` Guest section DW
2001-06-12 20:10 ` Guest section DW

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).