Skip to contentSkip to conversation

Linux tty driver question

DISCUSSION Mockern 2 participants 6 messages Feb 17, 2007 – Feb 27, 2007

lore
Share & tools
lore

Mockern

author
#0 lore raw

Hi,

I'm working on Linux tty driver (based on tiny_tty).

How can I provide in my driver Linux cat operation (e.g.cat < ttyS3)?

What should I implement exactly?

Thankx

#1 lore raw

Mockern napsal(a):

Quoted 5 lines

Hi,

I'm working on Linux tty driver (based on tiny_tty).

How can I provide in my driver Linux cat operation (e.g.cat < ttyS3)?

call tty_insert_flip_*() from somewhere to put some data into tty recieve buffer, which is pushed into ldisc by tty_flip_buffer_push() and then sent by tty_read function (where ldisc read is called) to userspace for reading process.

Quoted 1 line

What should I implement exactly?

open, settermios, write_room (note that this is minimal and will probably oops when poll or write is invoked) + some isr or timer to fill the buffer mentioned above.

regards,

Signature · 6 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

Hnus <[email protected]> is an alias for /dev/null
author
#2 lore raw

Thank you,

I have no problem with my tty driver, except one thing: it does not work with cat (but there are no problems to write,read from user space application). I'll try to follow your adwise to support cat.

Quoted 18 lines

Mockern napsal(a):

Quoted 5 lines

Hi,

I'm working on Linux tty driver (based on tiny_tty).

How can I provide in my driver Linux cat operation (e.g.cat < ttyS3)?

call tty_insert_flip_*() from somewhere to put some data into tty recieve buffer, which is pushed into ldisc by tty_flip_buffer_push() and then sent by tty_read function (where ldisc read is called) to userspace for reading process.

Quoted 1 line

What should I implement exactly?

open, settermios, write_room (note that this is minimal and will probably oops when poll or write is invoked) + some isr or timer to fill the buffer mentioned above.

regards,

Signature · 1 line
Сегодня удачный день, чтобы завести почту на Яндексе http://mail.yandex.ru
#3 lore raw

Mockern napsal(a):

Quoted 3 lines

Thank you,

I have no problem with my tty driver, except one thing: it does not work with cat (but there are no problems to write,read from user space application). I'll try to follow your adwise to support cat.

And where does it stuck? use ptrace (e.g. strace) to investigate.

regards,

Signature · 6 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

Hnus <[email protected]> is an alias for /dev/null
author
#4 lore raw

The problem is (probably???) that I did not implement ready_til_block in my driver.

OK, thank you, i need to investigate it with strace.

Quoted 8 lines

Mockern napsal(a):

Quoted 3 lines

Thank you,

I have no problem with my tty driver, except one thing: it does not work with cat (but there are no problems to write,read from user space application). I'll try to follow your adwise to support cat.

And where does it stuck? use ptrace (e.g. strace) to investigate.

regards,

Signature · 1 line
Яндекс.Почта: объем почтового ящика не ограничен! http://mail.yandex.ru/monitoring/
#5 lore raw
In reply to Mockern

Mockern napsal(a):

Quoted 3 lines

Thank you,

I have no problem with my tty driver, except one thing: it does not work with cat (but there are no problems to write,read from user space application). I'll try to follow your adwise to support cat.

But the read *works* according to the strace output, which you've post in the another thread. Just don't send garbage to the discipline, send some chars.

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