Add interrupt and quit keys to console driver

Operating Systems / OSv - Nadav Har'El [cloudius-systems.com] - 7 October 2013 08:08 UTC

This patch adds interrupt (by default ctrl-C) and quit (by default ctrl-\) handling to the console driver, when the ISIG termios flag is enabled (and this patch enables this flag by default). The application can change these characters or disable ISIG with ioctls, exactly as in Unix.

The ^C character sends a SIGINT to the (only) process, and ^\ sends SIGQUIT. By default both abort OSv, but when running Java we get a much more interesting SIGQUIT handler - it shows a trace of all running threads and other information.

Note that our line-discipline code currently sits in the console driver (we do not have ptys yet), so it only applies to the console, not to SSH connections or the likes.

Also note that by default (before the patch to issue #49), qemu will catch the ^C and ^\ and won't even pass them to OSv, so apply the patch to #49 (or change the interrupt or quit characters) to see this feature working.

This patch relates to issue #53.

d729262 Add interrupt and quit keys to console driver
drivers/console.cc | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

Upstream: github.com


  • Share