LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Linux tty driver question
@ 2007-02-17 10:06 Mockern
  2007-02-17 11:01 ` Jiri Slaby
  0 siblings, 1 reply; 6+ messages in thread
From: Mockern @ 2007-02-17 10:06 UTC (permalink / raw)
  To: linux-kernel

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

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

* Re: Linux tty driver question
  2007-02-17 10:06 Linux tty driver question Mockern
@ 2007-02-17 11:01 ` Jiri Slaby
  2007-02-17 11:27   ` Mockern
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2007-02-17 11:01 UTC (permalink / raw)
  To: Mockern; +Cc: linux-kernel

Mockern napsal(a):
> 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.

> 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,
-- 
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 <hnus@fi.muni.cz> is an alias for /dev/null

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

* Re: Linux tty driver question
  2007-02-17 11:01 ` Jiri Slaby
@ 2007-02-17 11:27   ` Mockern
  2007-02-17 12:55     ` Jiri Slaby
  2007-02-27  9:46     ` Jiri Slaby
  0 siblings, 2 replies; 6+ messages in thread
From: Mockern @ 2007-02-17 11:27 UTC (permalink / raw)
  To: jirislaby; +Cc: linux-kernel

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. 


>Mockern napsal(a):
>> 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.
>
>> 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,

-- 
Сегодня удачный день, чтобы завести почту на Яндексе http://mail.yandex.ru

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

* Re: Linux tty driver question
  2007-02-17 11:27   ` Mockern
@ 2007-02-17 12:55     ` Jiri Slaby
  2007-02-17 13:05       ` Mockern
  2007-02-27  9:46     ` Jiri Slaby
  1 sibling, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2007-02-17 12:55 UTC (permalink / raw)
  To: Mockern; +Cc: linux-kernel

Mockern napsal(a):
> 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,
-- 
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 <hnus@fi.muni.cz> is an alias for /dev/null

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

* Re: Linux tty driver question
  2007-02-17 12:55     ` Jiri Slaby
@ 2007-02-17 13:05       ` Mockern
  0 siblings, 0 replies; 6+ messages in thread
From: Mockern @ 2007-02-17 13:05 UTC (permalink / raw)
  To: jirislaby; +Cc: linux-kernel

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.
 
>Mockern napsal(a):
>> 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,

-- 
Яндекс.Почта: объем почтового ящика не ограничен! http://mail.yandex.ru/monitoring/

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

* Re: Linux tty driver question
  2007-02-17 11:27   ` Mockern
  2007-02-17 12:55     ` Jiri Slaby
@ 2007-02-27  9:46     ` Jiri Slaby
  1 sibling, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2007-02-27  9:46 UTC (permalink / raw)
  To: Mockern; +Cc: linux-kernel

Mockern napsal(a):
> 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,
-- 
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

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

end of thread, other threads:[~2007-02-27  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17 10:06 Linux tty driver question Mockern
2007-02-17 11:01 ` Jiri Slaby
2007-02-17 11:27   ` Mockern
2007-02-17 12:55     ` Jiri Slaby
2007-02-17 13:05       ` Mockern
2007-02-27  9:46     ` Jiri Slaby

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