Skip to contentSkip to conversation

serio interface

DISCUSSION Lars K.W. Gohlke 4 participants 12 messages Jun 6, 2007 – Jun 8, 2007

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hallo,

wouldsomebody explain me the serio interface or give me a code link for very simple example.

thx. in advance

- ------------------------
Mit freundlichen Grüßen
Lars K.W. Gohlke
mailto:[email protected]
- -------------------------
Visit http://www.lars-gohlke.de.vu

06.06.2007 11:10
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGZno8AAomYJ1taN8RAhjXAKClPcVTCJHDSSAjQg5R3lDi5igebgCdFO6h abt+VE+jOSixX3CRgjdi92o=
=qNoF
-----END PGP SIGNATURE-----

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:[email protected]
x-mozilla-html:FALSE
version:2.1
end:vcard

#1 lore raw
Quoted 2 lines · Lars K.W. Gohlke

wouldsomebody explain me the serio interface or give me a code link for very simple example.

What do you want to do with it? Do you want on the serial port side, or on the mouse/keyboard/gadget side? See for example the various serial keyboards and mice drivers.

MfG, JBG

Signature · 3 lines
      Jan-Benedict Glaw      [email protected]              +49-172-7608481
Signature of:                 Friends are relatives you make for yourself.
the second  :
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Jan-Benedict Glaw
Quoted 2 lines · Lars K.W. Gohlke

wouldsomebody explain me the serio interface or give me a code link for very simple example.

What do you want to do with it? Do you want on the serial port side, or on the mouse/keyboard/gadget side? See for example the various serial keyboards and mice drivers.

MfG, JBG

I want on the kernelside process data from first uart-hardware interface aka ttyS0.

I don't understand the structure of e.g. input/mouse/sermouse.c

where is said, which hardware is used for reading data from?

mfg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGZn+7AAomYJ1taN8RAlwOAJ4qP5DnhIE7IJ5pCqDGBD4di4zybACgqBq6 8lSB3Zp7qO/bwCK+WsWL+HU=
=3Fdg
-----END PGP SIGNATURE-----

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:[email protected]
x-mozilla-html:FALSE
version:2.1
end:vcard

#3 lore raw
Quoted 9 lines · Lars K.W. Gohlke
Quoted 7 lines · Jan-Benedict Glaw
Quoted 2 lines · Lars K.W. Gohlke

wouldsomebody explain me the serio interface or give me a code link for very simple example.

What do you want to do with it? Do you want on the serial port side, or on the mouse/keyboard/gadget side? See for example the various serial keyboards and mice drivers.

Quoted 6 lines

I want on the kernelside process data from first uart-hardware interface aka ttyS0.

I don't understand the structure of e.g. input/mouse/sermouse.c

where is said, which hardware is used for reading data from?

I'm not entirely sure, but I guess that most of the time, you assign a serial port with the help of `inputattach' to a given device driver, which expects to find its hardware on that port.

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

MfG, JBG

Signature · 3 lines
      Jan-Benedict Glaw      [email protected]              +49-172-7608481
Signature of:                     Eine Freie Meinung in einem Freien Kopf
the second  :                   für einen Freien Staat voll Freier Bürger.
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 19 lines · Jan-Benedict Glaw
Quoted 7 lines · Lars K.W. Gohlke
Quoted 6 lines · Jan-Benedict Glaw
Quoted 2 lines · Lars K.W. Gohlke

wouldsomebody explain me the serio interface or give me a code link for very simple example.

What do you want to do with it? Do you want on the serial port side, or on the mouse/keyboard/gadget side? See for example the various serial keyboards and mice drivers.

Quoted 6 lines

I want on the kernelside process data from first uart-hardware interface aka ttyS0.

I don't understand the structure of e.g. input/mouse/sermouse.c

where is said, which hardware is used for reading data from?

I'm not entirely sure, but I guess that most of the time, you assign a serial port with the help of `inputattach' to a given device driver, which expects to find its hardware on that port.

Quoted 6 lines

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

MfG, JBG

if you want to write a driver, there must be a possibility to get the data, like others do. (kernel-space)

I want to know where I can get and how to do.

At least I want to be able to copy the data from device to another (maybe own).

It is to get familiar with that.

thx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGZo7XAAomYJ1taN8RAgdAAJ0f1PilbuuwK8USjfLIDDGR1bPB3QCfdxmn 16d7ERDrASzpOYomyjs80rM=
=ZnRu
-----END PGP SIGNATURE-----

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:[email protected]
x-mozilla-html:FALSE
version:2.1
end:vcard

#5 lore raw
Quoted 4 lines · Lars K.W. Gohlke
Quoted 3 lines · Jan-Benedict Glaw

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

[snip]

You didn't actually answer any of my questions.

MfG, JBG

Signature · 4 lines
      Jan-Benedict Glaw      [email protected]              +49-172-7608481
Signature of:         "really soon now":      an unspecified period of time, likly to
the second  :                                 be greater than any reasonable definition
                                              of "soon".
#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Jan-Benedict Glaw
Quoted 4 lines · Lars K.W. Gohlke
Quoted 3 lines · Jan-Benedict Glaw

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

Quoted 6 lines

[snip]

You didn't actually answer any of my questions.

MfG, JBG

sorry.

I want to use the interface aka /dev/ttyS0.
I want to process data inside of a kernel module to provide it /proc (done) or as own char-dev (done).

but I can not grab the data.

It is part of my project in my studies.

It is more a conceptual work, but important. I want to release a howto, when I complete.

answered completely? ;) Hope so.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGZpHfAAomYJ1taN8RApsWAJ970RteJmHUsHocvt71lIvNSzk+XQCgxxg1 gxXm4kZRrRgrhIWfHPKTwEo=
=zMd7
-----END PGP SIGNATURE-----

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:[email protected]
x-mozilla-html:FALSE
version:2.1
end:vcard

#11 lore raw
In reply to Lars K.W. Gohlke

Lars K.W. Gohlke napsal(a):

Quoted 4 lines

hallo,

wouldsomebody explain me the serio interface or give me a code link for very simple example.

Something like this?
http://examples.oreilly.com/linuxdrive3/

examples/tty/tiny_serial.c

Some things are obsoleted, but main code flow remains.

regards,

Signature · 4 lines
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E
#7 lore raw
In reply to Lars K.W. Gohlke
Quoted 15 lines · Lars K.W. Gohlke
Quoted 7 lines · Jan-Benedict Glaw
Quoted 4 lines · Lars K.W. Gohlke
Quoted 3 lines · Jan-Benedict Glaw

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

You didn't actually answer any of my questions.

sorry.

I want to use the interface aka /dev/ttyS0.
I want to process data inside of a kernel module to provide it /proc (done) or as own char-dev (done).

Quoted 6 lines

but I can not grab the data.

It is part of my project in my studies.

It is more a conceptual work, but important. I want to release a howto, when I complete.

You still answer unasked questions. Please answer inline:

* Why do you wanto to do the serial stuff in kernel land?

* Isn't it easier to do it in userspace?

* What specific device do you work on?

* New: Is it a wise idea to do it in kernel land?

The /proc filesystem has been somewhat obsoleted in favour of sysfs for device/driver information.

Signature · 3 lines
      Jan-Benedict Glaw      [email protected]              +49-172-7608481
Signature of:                   ...und wenn Du denkst, es geht nicht mehr,
the second  :                          kommt irgendwo ein Lichtlein her.
#8 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 17 lines · Jan-Benedict Glaw
Quoted 16 lines · Lars K.W. Gohlke
Quoted 6 lines · Jan-Benedict Glaw
Quoted 4 lines · Lars K.W. Gohlke
Quoted 3 lines · Jan-Benedict Glaw

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

You didn't actually answer any of my questions.

sorry.

I want to use the interface aka /dev/ttyS0.
I want to process data inside of a kernel module to provide it /proc (done) or as own char-dev (done).

but I can not grab the data.

Quoted 8 lines
Quoted 4 lines

It is part of my project in my studies.

It is more a conceptual work, but important. I want to release a howto, when I complete.

You still answer unasked questions. Please answer inline:

* Why do you wanto to do the serial stuff in kernel land?

It is more a conceptual work, but important. I want to release a howto, when I complete.

Quoted 2 lines

* Isn't it easier to do it in userspace?

yes

Quoted 2 lines

* What specific device do you work on?

I want to use the interface aka /dev/ttyS0. (text-stream)

Quoted 2 lines

* New: Is it a wise idea to do it in kernel land?

no, explicitly not. To get known hwo to deal with data from devices.

Quoted 4 lines

The /proc filesystem has been somewhat obsoleted in favour of sysfs for device/driver information.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGZpw/AAomYJ1taN8RAspMAKDKXxTysCIJ/IF0DcTpdlKRqjW+AwCgjxt+ 5HY6RFy2LpUaT6q95U2PgdQ=
=V+MM
-----END PGP SIGNATURE-----

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:[email protected]
x-mozilla-html:FALSE
version:2.1
end:vcard

#9 lore raw
In reply to Jan-Benedict Glaw

Am 06.06.2007 11:51 schrieb Jan-Benedict Glaw:

Quoted 9 lines · Lars K.W. Gohlke
Quoted 7 lines

I want on the kernelside process data from first uart-hardware interface aka ttyS0.

I don't understand the structure of e.g. input/mouse/sermouse.c

where is said, which hardware is used for reading data from?

Quoted 7 lines

I'm not entirely sure, but I guess that most of the time, you assign a serial port with the help of `inputattach' to a given device driver, which expects to find its hardware on that port.

OTOH, why do you want to do the serial stuff in kernel land? Isn't it a *lot* easier to do it in userspace? What's your specific device you want to work on?

May I chime in here, as it's a topic I am interested in too.

Have a look at drivers/isdn/gigaset/ser-gigaset.c if you like, a driver for an ISDN adapter attached via RS232.

This is currently implemented as a line discipline, but I consider that a hack. For one thing, it doesn't really fit the concept of a line discipline because it doesn't transform the serial datastream but instead diverts it completely to the isdn4linux subsystem. And second, it means that a userspace daemon is needed which does nothing but open the serial port, set the line discipline on it, and go to sleep in order to keep the line discipline loaded.

The serio approach used by input/mouse/sermouse.c might provide a more sensible way of driving that kind of device.

Signature · 4 lines
Tilman Schmidt                          E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
#10 lore raw
Quoted 7 lines · /me

Have a look at drivers/isdn/gigaset/ser-gigaset.c if you like, a driver for an ISDN adapter attached via RS232.

This is currently implemented as a line discipline, but I consider that a hack. [...]
The serio approach used by input/mouse/sermouse.c might provide a more sensible way of driving that kind of device.

Apparently it won't. As I have learned in the meantime, the serio mechanism in turn just uses a line discipline to actually attach itself to the serial port. So the line discipline interface remains "the" way to write a layered driver on top of RS232.

Thanks,

Signature · 4 lines
Tilman Schmidt                    E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)