pgup/pgdn and arrow keys under qemu

111 views
Skip to first unread message

raflik

unread,
May 21, 2009, 5:21:21 PM5/21/09
to minix3
How to make them work? When I press these keys I get digits... I am
using qemu 0.10.4.

Rahmat M. Samik-Ibrahim

unread,
May 21, 2009, 7:49:18 PM5/21/09
to min...@googlegroups.com
raflik wrote:
> How to make them work? When I press these keys I get digits... I am
> using qemu 0.10.4.

Hi,
May I know what for?
If it is for "elvis" (the default vi), I guess that elvis understands
"hjkl" only
instead of the arrow keys.

BTW: But, I was seldom using the qemu console. Why not using "telnet"
or "ssh" to the Minix system?

regards,

--
Rahmat M. Samik-Ibrahim --- vLSM.org

raflik

unread,
May 22, 2009, 4:59:51 AM5/22/09
to minix3
Just to use it more comfortably... Ok, ssh is a workaround but I
thought I could use it in a more straightforward way. Anyway, how to
ssh to Minix run under qemu? I run qemu with "-net user -net nic"
options.

On May 22, 1:49 am, "Rahmat M. Samik-Ibrahim" <rahmatm.samik-

Rahmat M. Samik-Ibrahim

unread,
May 22, 2009, 7:24:11 AM5/22/09
to min...@googlegroups.com
raflik wrote:
> Anyway, how to ssh to Minix run under qemu? I run qemu with
> "-net user -net nic" options.

1) telnet is already available. Just copy or rename file
/etc/rc.daemons.dist to /etc/rc.daemons and reboot.
2) you need to install the ssh package
3) You need to redirect the telnet and/or ssh port. E.g.
-redir tcp:5522::22 -redir tcp:5523::23
4) If telnet, run: telnet localhost 5523
5) If ssh, run: ssh -p 5522 user@localhost

raflik

unread,
May 22, 2009, 9:16:48 AM5/22/09
to minix3
Thanks a lot, that works pretty ok, but it is not sufficient for me,
because I want to debug some server code (/usr/src/servers). Printfs
from such code do not go through ssh... And I want to see a dump
exceeding one screen. Is there a way to achieve what I want?

On May 22, 1:24 pm, "Rahmat M. Samik-Ibrahim" <rahmatm.samik-

Tomas Hruby

unread,
May 22, 2009, 9:54:50 AM5/22/09
to min...@googlegroups.com
> Thanks a lot, that works pretty ok, but it is not sufficient for me,
> because I want to debug some server code (/usr/src/servers). Printfs
> from such code do not go through ssh... And I want to see a dump
> exceeding one screen. Is there a way to achieve what I want?

One solution using Using qemu is to duplicate output from tty to
serial console. To do that define DUP_CONS_TO_SER in
drivers/tty/console.c as 1.

Look at the -serial option of qemu and pick the device type that suites
you the best.

Cheers,

T.

raflik

unread,
May 23, 2009, 10:04:38 AM5/23/09
to minix3
Thanks for your reply. Unfortunately, I cannot find such def anywhere
in the code... I am using Minix 3.1.3a r2964 (and need to stick to
that version). But I have found ser_putc() in console.c and
do_serial_debug variable in kernel/glo.h which is tested in kputc()
(kernel/utility.c). Setting that to 1 resulted in some output but from
kernel, NOT server... :/ I guess printfs from servers do not go
through that mechanism. Is there a simple way to change that? Or maybe
somehow it is possible to fix at least PgUp and PgDown keys in qemu...

Tomas Hruby

unread,
May 23, 2009, 10:32:53 AM5/23/09
to min...@googlegroups.com
> Thanks for your reply. Unfortunately, I cannot find such def anywhere
> in the code... I am using Minix 3.1.3a r2964 (and need to stick to
> that version).

Sorry, it was added in a later varsion. Anyhow, try this patch.

Cheers, T.


--- minix_3.1.3a-orig/drivers/tty/console.c 2009-04-17 09:45:54.000000000 +0200
+++ minix_3.1.3a-patch/drivers/tty/console.c 2009-05-13 18:03:33.000000000 +0200
@@ -28,6 +28,8 @@
#include "../../kernel/config.h"
#include "../../kernel/type.h"

+#define DUP_CONS_TO_SER 1
+
/* Definitions used by the console driver. */
#define MONO_BASE 0xB0000L /* base of mono video memory */
#define COLOR_BASE 0xB8000L /* base of color video memory */
@@ -204,6 +206,13 @@
{
out_char(cons, *tbuf++);
} else {
+#if DUP_CONS_TO_SER
+ if (cons == &cons_table[0]) {
+ if (*tbuf == '\n')
+ ser_putc('\r');
+ ser_putc(*tbuf);
+ }
+#endif
cons->c_ramqueue[cons->c_rwords++] =
cons->c_attr | (*tbuf++ & BYTE);
cons->c_column++;
@@ -249,6 +258,16 @@
return;
}

+#if DUP_CONS_TO_SER
+ if (cons == &cons_table[0] && c != '\0')
+ {
+ if (c == '\n')
+ ser_putc('\r');
+ ser_putc(c);
+ }
+#endif
+
+
switch(c) {
case 000: /* null is typically used for padding */
return; /* better not do anything */

raflik

unread,
May 23, 2009, 5:44:57 PM5/23/09
to minix3
Great, thanks.

Greg King

unread,
Jul 13, 2009, 3:53:04 AM7/13/09
to minix3
On May 21, 5:21 pm, raflik wrote:
> How to make them work? When I press those keys, I get digits.
> I am using qemu 0.10.4.

It seems to be a bug in Minix's virtual-console driver. The
keyboard's "Number-Lock" needs to be set to "on". But, Minix's four
virtual consoles are not isolated from each other -- the Num-Lock
setting in each console affects all of the others!

Therefore, you must go to each console that you plan to use, and turn
on its Lock. Then, test any arrow-key. If it types a number, then
you must go to a console that you won't use; and, _change_ its Num-
Lock setting. After that, the navigation keys should work correctly.
Reply all
Reply to author
Forward
0 new messages