History log of /haiku-fatelf/src/add-ons/kernel/drivers/tty/slave.cpp
Revision Date Author Comments
# 6730553a 14-Nov-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Already set tty::lock() in init_driver(). This makes it always safe to
be used.
* Added tty::ref_count. Each cookie keeps a reference. Only when a
cookie is freed the reference is surrendered. A tty is considered used
as long as it is still referenced. This allows to access a tty through
the cookie, even if it already has been closed.
* Fixed tty_deselect(). It was keeping registered select events when
called after the cookie has been closed. The referenced select_sync
structure would become invalid and later attempts to send select
notifications for the tty could crash. Fixes #3126.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28651 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2293ed69 16-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

Add missing string.h that would otherwise soon break the build.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 719f971d 24-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Controlling terminal related changes:
* It is possible to acquire a tty that is already open, iff it is not a
controlling terminal yet and the process is a session leader.
* Also set the terminal process group when acquiring a controlling
terminal.

telnetd/login and sshd are a lot happier now (and so am I :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25132 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ed6a33c 30-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also publish /dev/tty. Opening it will open the controlling tty for the
current process.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 923efaa8 05-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* We store the ID of the controlling terminal and the foreground process
group ID with the session and let the terminal update them.
* Added an "orphaned" flag to the process_group structure and code to
maintain it.
* Handle the death of a controlling process correctly: The
foreground process group gets a SIGHUP and all newly-orphaned process
groups containing at least one stopped processes are sent
SIGHUP+SIGCONT.
* The tty handles the O_NOCTTY flag correctly, now.
* The tty handles reads/writes from processes from other sessions
correctly, now.
* Handle tcsetpgrp() from background processes correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22187 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 696c54d0 28-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved members pgrp_id, termios, window_size from the tty structure to
the new structure tty_settings of which there's only one instance per
master/slave tty pair. Previously the existence of two instances of those
members caused several kinds of problems, e.g. the Terminal setting
the window size on the master and CLI programs readings the unchanged
values from the slave. E.g. less correctly adjusts the display when the
Terminal size changes, now.
* Reorganized writing to a TTY. We do no longer handle writes to master
and slave the same way. Writes to the master are "input" and need to
be processed differently from writes to the slave ("output"). Before,
both were processed first as output then as input, which caused incorrect
behavior. E.g. CRs were not echoed correctly.
* Added canonical ERASE (backspace) and KILL (clear line) processing.
Couldn't really see it work. glibc's fgets() seems to read single
chars, so that we never have anything in the line buffer.
* Added handling for EOF. Works well with Be's Terminal, ours seems to
write an ESC sequence instead of the EOF char (Ctrl-D), though.
* Extended output processing support (ECHOE, ECHOK, ECHONL, OCRNL,
ONLRET, OLCUC).
* Writes use user_memcpy() now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21735 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27a55239 20-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Dealt with (hopefully) all open/close race conditions.
* Implemented unblocking of pending operations when closing a cookie.
Needed to change the simple one reader semaphore, one writer
semaphore strategy for blocking to a request queue based approach
(otherwise unblocking would have been really hairy).
* Implemented select() support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11931 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f8764892 05-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Added support for changing the access mode using ioctl() and B_SET_(NON)BLOCKING_IO.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9204 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af916644 01-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Now makes sure that the index get_tty_index() returns is in a valid range.
Added some more conditional debug output, turned off debug output.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa42f1c2 27-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Work in progress. Basic data exchange seems to work.
Only slightly tested (moved data to and from pty <-> tty).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9087 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b306033 23-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Added the beginnings of our TTY layer.
After having had a look at our own Terminal code (former MuTerm), I even
copied the original mess in /dev/tt/ and /dev/pt/.
The /dev/tt/ entries could be created and removed on demand, though, but
that can't be done yet.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9041 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6730553ae018003356b03f2d8500520671470bc7 14-Nov-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Already set tty::lock() in init_driver(). This makes it always safe to
be used.
* Added tty::ref_count. Each cookie keeps a reference. Only when a
cookie is freed the reference is surrendered. A tty is considered used
as long as it is still referenced. This allows to access a tty through
the cookie, even if it already has been closed.
* Fixed tty_deselect(). It was keeping registered select events when
called after the cookie has been closed. The referenced select_sync
structure would become invalid and later attempts to send select
notifications for the tty could crash. Fixes #3126.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28651 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2293ed6941a7bb7f2b8527778fa004cd280c0e38 16-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

Add missing string.h that would otherwise soon break the build.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 719f971dea542ed5566217eaba96fab111de154c 24-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Controlling terminal related changes:
* It is possible to acquire a tty that is already open, iff it is not a
controlling terminal yet and the process is a session leader.
* Also set the terminal process group when acquiring a controlling
terminal.

telnetd/login and sshd are a lot happier now (and so am I :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25132 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ed6a33cc56aee0a470aec2a822dbd2f81a5a071 30-Mar-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also publish /dev/tty. Opening it will open the controlling tty for the
current process.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 923efaa872b9fe4e9e9cae87effe2af5c338b98a 05-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* We store the ID of the controlling terminal and the foreground process
group ID with the session and let the terminal update them.
* Added an "orphaned" flag to the process_group structure and code to
maintain it.
* Handle the death of a controlling process correctly: The
foreground process group gets a SIGHUP and all newly-orphaned process
groups containing at least one stopped processes are sent
SIGHUP+SIGCONT.
* The tty handles the O_NOCTTY flag correctly, now.
* The tty handles reads/writes from processes from other sessions
correctly, now.
* Handle tcsetpgrp() from background processes correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22187 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 696c54d0673fe190dbbae4323b48bf1b8d9c2beb 28-Jul-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved members pgrp_id, termios, window_size from the tty structure to
the new structure tty_settings of which there's only one instance per
master/slave tty pair. Previously the existence of two instances of those
members caused several kinds of problems, e.g. the Terminal setting
the window size on the master and CLI programs readings the unchanged
values from the slave. E.g. less correctly adjusts the display when the
Terminal size changes, now.
* Reorganized writing to a TTY. We do no longer handle writes to master
and slave the same way. Writes to the master are "input" and need to
be processed differently from writes to the slave ("output"). Before,
both were processed first as output then as input, which caused incorrect
behavior. E.g. CRs were not echoed correctly.
* Added canonical ERASE (backspace) and KILL (clear line) processing.
Couldn't really see it work. glibc's fgets() seems to read single
chars, so that we never have anything in the line buffer.
* Added handling for EOF. Works well with Be's Terminal, ours seems to
write an ESC sequence instead of the EOF char (Ctrl-D), though.
* Extended output processing support (ECHOE, ECHOK, ECHONL, OCRNL,
ONLRET, OLCUC).
* Writes use user_memcpy() now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21735 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27a5523990f922ce4cb423b63ef26d4379049423 20-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Dealt with (hopefully) all open/close race conditions.
* Implemented unblocking of pending operations when closing a cookie.
Needed to change the simple one reader semaphore, one writer
semaphore strategy for blocking to a request queue based approach
(otherwise unblocking would have been really hairy).
* Implemented select() support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11931 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f8764892776479c15cdb37f40905074f067c5ce2 05-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Added support for changing the access mode using ioctl() and B_SET_(NON)BLOCKING_IO.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9204 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af916644164b032e83aabb3836fd4d823f0e30d4 01-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Now makes sure that the index get_tty_index() returns is in a valid range.
Added some more conditional debug output, turned off debug output.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa42f1c2b9d66c327979c903b3881b6d53e9dc12 27-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Work in progress. Basic data exchange seems to work.
Only slightly tested (moved data to and from pty <-> tty).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9087 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b3060331448d3873bdd60566ff977cf2aaee798 23-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Added the beginnings of our TTY layer.
After having had a look at our own Terminal code (former MuTerm), I even
copied the original mess in /dev/tt/ and /dev/pt/.
The /dev/tt/ entries could be created and removed on demand, though, but
that can't be done yet.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9041 a95241bf-73f2-0310-859d-f6bbb57e9c96