From 1c3f16797a5b66aea814751866d722835a6c1e72 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 27 Mar 2018 13:57:58 +0100 Subject: [PATCH] readme: more failed attempts at ttys! --- README.adoc | 75 +++++++++++++++++++++++++++++++++++++- rootfs_overlay/etc/inittab | 3 -- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 0f59855..24dd4d1 100644 --- a/README.adoc +++ b/README.adoc @@ -189,7 +189,7 @@ dmesg -n 1 See also: https://superuser.com/questions/351387/how-to-stop-kernel-messages-from-flooding-my-console -You can scroll up a bit on the default TTY with: +When in <>, you can scroll up a bit on the default TTY with: .... Shift + PgUp @@ -255,6 +255,8 @@ Our workaround is: + I think the problem was reversed in older QEMU versions: https://superuser.com/questions/1087859/how-to-quit-the-qemu-monitor-when-not-using-a-gui/1211516#1211516 + +`sendkey sendkey ctrl-c` does not work on the text terminal either. ++ This is however fortunate when running QEMU with GDB, as the Ctrl + C reaches GDB and breaks. * Not everything generates interrupts, only the final enter. + @@ -1698,6 +1700,77 @@ But in part because it is dying, I didn't spend much effort to integrate it into Maybe some brave should will send a pull request one day. +=== Magic keys understood by the Linux kernel + +Let's have some fun. + +Those only work in <>. + +I think most are implemented under: + +.... +drivers/tty +.... + +TODO find all. + +Scroll up / down the terminal: + +.... +Shift + PgDown +Shift + PgUp +.... + +Or inside `./qemumonitor`: + +.... +sendkey shift-pgup +sendkey shift-pgdown +.... + +https://en.wikipedia.org/wiki/Magic_SysRq_key Those can be tested through the monitor with: + +.... +sendkey alt-sysrq-c +.... + +or you can try the much more boring method of: + +.... +echo c > /proc/sysrq-trigger +.... + +Implemented in + +.... +drivers/tty/sysrq.c +.... + +Switch between TTYs with: + +.... +sendkey alt-left +sendkey alt-right +sendkey alt-f1 +sendkey alt-f2 +.... + +TODO: only works after I do a `chvt 1`, but then how to put a terminal on `alt-f2`? I just get a blank screen. One day, one day: + +* https://stackoverflow.com/questions/16706423/two-instances-of-busybox-on-separate-serial-lines-ttysn +* https://serverfault.com/questions/119736/how-to-enable-multiple-virtual-consoles-on-linux +* https://superuser.com/questions/33065/console-commands-to-change-virtual-ttys-in-linux-and-openbsd + +Also tried to add some extra lines to `/etc/inittab` of type: + +.... +console::respawn:/sbin/getty -n -L -l /loginroot.sh ttyS1 0 vt100 +.... + +but nothing changed. + +Note that on Ubuntu 17.10, to get to the text terminal from the GUI we first need `Ctrl + Alt + Fx`, and once in the text terminals, `Alt + Fn` works without `Ctrl`. + == QEMU Some QEMU specific features to play with and limitations to cry over. diff --git a/rootfs_overlay/etc/inittab b/rootfs_overlay/etc/inittab index 143927d..32ee572 100644 --- a/rootfs_overlay/etc/inittab +++ b/rootfs_overlay/etc/inittab @@ -1,4 +1,3 @@ -# /etc/inittab ::sysinit:/bin/mount -t proc proc /proc ::sysinit:/bin/mount -o remount,rw / ::sysinit:/bin/mkdir -p /dev/pts @@ -6,8 +5,6 @@ ::sysinit:/bin/mount -a ::sysinit:/bin/hostname -F /etc/hostname ::sysinit:/etc/init.d/rcS -# https://unix.stackexchange.com/questions/299408/how-to-login-automatically-without-typing-root-in-buildroot-x86-64-qemu -#console::respawn:/bin/sh console::respawn:/sbin/getty -n -L -l /loginroot.sh console 0 vt100 ::ctrlaltdel:/sbin/reboot ::shutdown:/etc/init.d/rcK