2004-06-15 14:02:15

by Karel Kulhavy

[permalink] [raw]
Subject: Helge Hafting vs. make menuconfig help

Hello

Helge Hafting says that CONFIG_INPUT is about HID in general.
make menuconfig help in 2.4.25 says that CONFIG_INPUT is about USB HID only.

This is 1:1. I would like to know what the truth is. Please add your
opinions, I'll make a statistics and then evaluate the probable truth.
Thank you.

Cl<


2004-06-15 14:10:43

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

On Tue, 2004-06-15 14:02:06 +0000, Karel Kulhav? <[email protected]>
wrote in message <[email protected]>:
> Hello
>
> Helge Hafting says that CONFIG_INPUT is about HID in general.
> make menuconfig help in 2.4.25 says that CONFIG_INPUT is about USB HID only.

HID is used in conjunction of USB input devices (USB mice, USB
keyboards, ...).

CONFIG_INPUT only gives you an API where you can process input events
with. For instance, look at the atkbd.c, sunkbd.c or lkkbd.c drivers.
They all send key strokes into the Input API (activated by
CONFIG_INPUT), but none of them actually uses USB (but the PS/2 keyboard
port or normal serial ports with non-standard plugs).

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (0.98 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-06-15 14:22:17

by Karel Kulhavy

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

On Tue, Jun 15, 2004 at 04:10:39PM +0200, Jan-Benedict Glaw wrote:
> On Tue, 2004-06-15 14:02:06 +0000, Karel Kulhav? <[email protected]>
> wrote in message <[email protected]>:
> > Hello
> >
> > Helge Hafting says that CONFIG_INPUT is about HID in general.
> > make menuconfig help in 2.4.25 says that CONFIG_INPUT is about USB HID only.
>
> HID is used in conjunction of USB input devices (USB mice, USB
> keyboards, ...).
>
> CONFIG_INPUT only gives you an API where you can process input events
> with. For instance, look at the atkbd.c, sunkbd.c or lkkbd.c drivers.
> They all send key strokes into the Input API (activated by
> CONFIG_INPUT), but none of them actually uses USB (but the PS/2 keyboard
> port or normal serial ports with non-standard plugs).

Is it correct what <Help> for CONFIG_INPUT in 2.4.25 says or no?

Cl<
>
> MfG, JBG
>
> --
> Jan-Benedict Glaw [email protected] . +49-172-7608481
> "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
> fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
> ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


2004-06-15 14:41:31

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

On Tue, 2004-06-15 14:20:40 +0000, Karel Kulhav? <[email protected]>
wrote in message <[email protected]>:
> On Tue, Jun 15, 2004 at 04:10:39PM +0200, Jan-Benedict Glaw wrote:
> > On Tue, 2004-06-15 14:02:06 +0000, Karel Kulhav? <[email protected]>
> > wrote in message <[email protected]>:

> > CONFIG_INPUT only gives you an API where you can process input events
> > with. For instance, look at the atkbd.c, sunkbd.c or lkkbd.c drivers.
> > They all send key strokes into the Input API (activated by
> > CONFIG_INPUT), but none of them actually uses USB (but the PS/2 keyboard
> > port or normal serial ports with non-standard plugs).
>
> Is it correct what <Help> for CONFIG_INPUT in 2.4.25 says or no?

At least, it's not really wrong. You need CONFIG_INPUT to be able to do
something with the HID stuff. However, to have an uniform interface, you
may also use the CONFIG_INPUT stuff to access your "normal" (AT / PS/2
style) keyboard.

In 2.6.x, that's cleaned up a bit. (Nearly?) all keyboards now push
their key strokes into the CONFIG_INPUT API, so you really want to have
CONFIG_INPUT (as long as this isn't some kind of embedded system).

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (1.48 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-06-15 17:21:50

by Karel Kulhavy

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

> >
> > Is it correct what <Help> for CONFIG_INPUT in 2.4.25 says or no?
>
> At least, it's not really wrong. You need CONFIG_INPUT to be able to do
> something with the HID stuff. However, to have an uniform interface, you

Does HID means always USB?

However when disabling CONFIG_INPUT, the keyboard still works. Is a keyboard
considered a HID or nor?

> may also use the CONFIG_INPUT stuff to access your "normal" (AT / PS/2
> style) keyboard.
>
> In 2.6.x, that's cleaned up a bit. (Nearly?) all keyboards now push
> their key strokes into the CONFIG_INPUT API, so you really want to have
> CONFIG_INPUT (as long as this isn't some kind of embedded system).

Isn't there some graphical chart (preferrably made in sodipodi ;-) ) that
describes how data are flowing inside the kernel? I have problems visualizing
this.

Cl<
>
> MfG, JBG
>
> --
> Jan-Benedict Glaw [email protected] . +49-172-7608481
> "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
> fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
> ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


2004-06-15 17:32:15

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

On Tue, 2004-06-15 17:21:29 +0000, Karel Kulhav? <[email protected]>
wrote in message <[email protected]>:
> > >
> > > Is it correct what <Help> for CONFIG_INPUT in 2.4.25 says or no?
> >
> > At least, it's not really wrong. You need CONFIG_INPUT to be able to do
> > something with the HID stuff. However, to have an uniform interface, you
>
> Does HID means always USB?

No, but USB HID devices (mouse, keyboard, ...) always implies HID.

> However when disabling CONFIG_INPUT, the keyboard still works. Is a keyboard
> considered a HID or nor?

In 2.4.x, the transition from "old-style" input drivers to new-style
(Input API) was never finished. Instead, Input API was introduced, and
HID devices reported their input to Input API, while old drivers still
used all their old ways to deliver their input.

This is why a keyboard still works without CONFIG_INPUT in 2.4.x, but it
won't any longer work in 2.6.x, because the old path for submitting
input was thrown away.

> > may also use the CONFIG_INPUT stuff to access your "normal" (AT / PS/2
> > style) keyboard.
> >
> > In 2.6.x, that's cleaned up a bit. (Nearly?) all keyboards now push
> > their key strokes into the CONFIG_INPUT API, so you really want to have
> > CONFIG_INPUT (as long as this isn't some kind of embedded system).
>
> Isn't there some graphical chart (preferrably made in sodipodi ;-) ) that
> describes how data are flowing inside the kernel? I have problems visualizing
> this.

2.4.x:
- USB keyboards/mice/... are "HID" devices, using the USB HID
protocol, delivering their data to the Input APU
(CONFIG_INPUT).
- Legacy drivers (PS/2 keyboard and the like) had their own data
path and directly put their input into the virtual console
subsystem.

2.6.x:
- USB keyboards/mice/... are "HID" devices, using the USB HID
protocol, delivering their data to the Input APU
(CONFIG_INPUT).
- All legacy drivers are converted to also use the new Input API
subsystem; direct delivery of input was removed from the code
base.

So in 2.4.x, you've got two APIs for drivers to dispatch their input
(new drivers using the USB HID protocol already stuff their data into
Input API, old drivers still each use a direct way). In 2.6.x, the
direct ways were thrown away, and only the Input API is remaining.

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (2.58 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-06-15 17:49:27

by Karel Kulhavy

[permalink] [raw]
Subject: AT Keyboard (was: Helge Hafting vs. make menuconfig help)

> In 2.4.x, the transition from "old-style" input drivers to new-style
> (Input API) was never finished. Instead, Input API was introduced, and
> HID devices reported their input to Input API, while old drivers still
> used all their old ways to deliver their input.

I (hopefully correctly) assume that one of the old ones is AT keyboard.

What happens when I press a key on keyboard and the application that
has the keyboard somehow on it's stdin reads a key? What happens between
the two events and how does it travel inside the kernel?

I know how the keys can be read from port 0x60 or whichever.

Cl<

2004-06-15 18:34:14

by Helge Hafting

[permalink] [raw]
Subject: Re: AT Keyboard (was: Helge Hafting vs. make menuconfig help)

On Tue, Jun 15, 2004 at 05:46:51PM +0000, Karel Kulhav? wrote:
> > In 2.4.x, the transition from "old-style" input drivers to new-style
> > (Input API) was never finished. Instead, Input API was introduced, and
> > HID devices reported their input to Input API, while old drivers still
> > used all their old ways to deliver their input.
>
> I (hopefully correctly) assume that one of the old ones is AT keyboard.
>
> What happens when I press a key on keyboard and the application that
> has the keyboard somehow on it's stdin reads a key? What happens between
> the two events and how does it travel inside the kernel?
>
> I know how the keys can be read from port 0x60 or whichever.
>
1. You press the key (on an AT keyboard)
2. The keyboard hardware makes an interrupt
3. The interrupt acitvates the i8042 driver (in 2.6)
which does the port 0x60 stuff.
4. From there, the key is propagated through tty and
console and ends up in your application. This application
might be X, which passes the key onto some program using X.

Helge Hafting

2004-06-15 19:59:07

by Karel Kulhavy

[permalink] [raw]
Subject: Re: AT Keyboard (was: Helge Hafting vs. make menuconfig help)

> 4. From there, the key is propagated through tty and
> console and ends up in your application. This application
> might be X, which passes the key onto some program using X.

I am insterested in the 4. itself.

What's the console? I get a feeling that it's where kernel writes it's debug
messages but sometimes else I get a feeling it's the text output of the
machine at all.

And what are the ttys? And does the key go first into console and then tty,
or the other way?

Cl<

2004-06-15 20:14:08

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: AT Keyboard (was: Helge Hafting vs. make menuconfig help)

On Tue, 2004-06-15 19:59:03 +0000, Karel Kulhav? <[email protected]>
wrote in message <[email protected]>:
> > 4. From there, the key is propagated through tty and
> > console and ends up in your application. This application
> > might be X, which passes the key onto some program using X.
>
> I am insterested in the 4. itself.

This is from memory, some details may be wrong:

- The keyboard driver first determines what key the scancodes
belong to. If you press one single key, it may be sent as
multiple scancodes. The keyboard driver first has to assemble
these scancodes and make a decision from it (like "Key 'a'
pressed"). This information ('a' pressed down). is put into
Input API.
- Input API then prepares hands this key press to the TTY
driver.
- An application on the currently visible VT gets the 'a' (if it
didn't request raw scancodes. In this case, the TTY layer
*emulates* scancodes from the "'a' pressed down" event), and
the 'a' is also displayed on the VT (if echo'ing is switched
on).

MfG, JBG

--
Jan-Benedict Glaw [email protected] . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier B?rger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


Attachments:
(No filename) (1.35 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-06-15 20:34:19

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Helge Hafting vs. make menuconfig help

On Tue, Jun 15, 2004 at 02:02:06PM +0000, Karel Kulhav? wrote:
> Hello
>
> Helge Hafting says that CONFIG_INPUT is about HID in general.
> make menuconfig help in 2.4.25 says that CONFIG_INPUT is about USB HID only.
>
> This is 1:1. I would like to know what the truth is. Please add your
> opinions, I'll make a statistics and then evaluate the probable truth.
> Thank you.

Both are right. In 2.6, CONFIG_INPUT is used for all Human Input
Devices. In 2.4, though, only USB drivers use it. Get out of ancient
times, and look at 2.6 - it makes much more sense.

--
Vojtech Pavlik
SuSE Labs, SuSE CR

2004-06-16 22:27:45

by Helge Hafting

[permalink] [raw]
Subject: Re: AT Keyboard (was: Helge Hafting vs. make menuconfig help)

On Tue, Jun 15, 2004 at 07:59:03PM +0000, Karel Kulhav? wrote:
> > 4. From there, the key is propagated through tty and
> > console and ends up in your application. This application
> > might be X, which passes the key onto some program using X.
>
> I am insterested in the 4. itself.
>
> What's the console?
The console is the text interface you see when not running
X (the graphical user interface).

> I get a feeling that it's where kernel writes it's debug
> messages but sometimes
Yes, the console is also used for this.

> else I get a feeling it's the text output of the
> machine at all.
>
You can also have text output in an xterm, thats not the console.
Or even on real terminals connected to serial ports.

> And what are the ttys? And does the key go first into console and then tty,
> or the other way?

TTY = TeleTYpe interface. The machine may have quite a few different
text interfaces, one of them is special and is the console.

Helge Hafting