Skip to contentSkip to conversation

QEMU keyboard issue with Gujin-2.2

Qemu-devel Alexander E. Patrakov 2 participants 3 messages Sep 24, 2007 – Sep 25, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

if one attempts to use the Gujin bootloader inside qemu (even today's snapshot), one gets a message about unknown key being pressed.

The easiest way to reproduce the issue is to download install-2.2.tar.gz from http://sourceforge.net/project/showfiles.php?group_id=15465, unpack the tarball, and run "qemu -fda boot.144". The bottom of the screen will flash with the message about unknown command. This message does not show up in Bochs and on real hardware.

I also recompiled Gujin from source (gujin-2.2.tar.gz) and added code to print information about each call to the 0x16 BIOS interrupt to the parallel port. According to this log, Gujin does the following:

# prints:
Debug active!
sizeof MOUSE: 512, sizeof UI: 384, Initial VESA name check: Video card changed, reset VGA parameter.

# Get shift flags
AH=0x02 => result: AL=0x00 (i.e., no shift flags)

# keyb.com keyboard capabilities check
AH=0x92 => AH=0x80 (i.e., enhanced keyboard functions are supported)
# keyb.com keyboard capabilities check
AH=0xa2 => AH=0xa2 (i.e., 122-key keyboard functions are not supported)

# prints:
sizeof struct UTIL_str 640, sizeof struct memalloc_str 408.
max_IDE_found 10, max_freelist 64, max_disk 15, max_partition 64
sizeof struct diskparam_str 256, sizeof struct partition_str 64, sizeof struct freelist_str 16, sizeof struct IDE_found_str 8.

Reset all BIOS disks for BIOS to acknowledge changes:returns 0x0, status 0x0
sizeof struct desc_str: 64, sizeof struct BOOTWAY_str: 16
{FAT12 on disk 0 part 5 with type 0x4!} {strange: PhysicaldriveNb = 0x0 instead of 0x80} {FAT12 on disk 2 part 5 with type 0x4!}

# check for enhanced keystroke
AH=0x11 => AH=0x11, AL set to 0 by the setnz instruction (i.e., no key)

# Then the check is repeated many times with the same "no key" result (because I press no keys). So far so good.

# .....

# Then, for some strange reason, the same call returns that a key is pressed:

# check for enhanced keystroke
AH=0x11 => AH=0x43, AL set to 1 by the setnz instruction that immediately follows int 0x16 in the Gujin source
# get enhanced keycode
AH=0x10 => AH=0x43, AL=0x00 (here is a problem - I pressed nothing!)
# goes to graphical mode
# prints:
best_max_width: found mode index 3 (maxwidth 640) out of UI.nbmode = 16
[get_refresh_freq: timeout after 49999]

# Then it begins to loop the following two calls:

# check for enhanced keystroke
AH=0x11 => AH=0x43, AL set to 1 by the setnz instruction that immediately follows int 0x16 in the Gujin source
# get enhanced keycode
AH=0x10 => AH=0x43, AL=0x00 (here is a problem - I pressed nothing!)

I.e., this looks like a "garbage in, garbage out" problem, not a Gujin bug - BIOS reports non-existing keypress to Gujin in qemu. Could you please fix qemu, or at least tell me how to debug further?

Signature · 1 line
Alexander E. Patrakov
#1 lore raw

Hello,

could you try this file (when Berlios servers are online again):
http://svn.berlios.de/wsvn/ar7-firmware/qemu/trunk/hw/ps2.c?op=file

I had a similar problem, and the patched version of ps2.c helped...

Stefan

Quoted 5 lines · Alexander E. Patrakov

Hello,

if one attempts to use the Gujin bootloader inside qemu (even today's snapshot), one gets a message about unknown key being pressed.

#2 lore raw
Quoted 6 lines · Stefan Weil

Hello,

could you try this file (when Berlios servers are online again):
http://svn.berlios.de/wsvn/ar7-firmware/qemu/trunk/hw/ps2.c?op=file

I had a similar problem, and the patched version of ps2.c helped...

Unfortunately, it doesn't help. But it repeats the following line over and over again in the qemu output:

/home/patrakov/qemu/qemu-snapshot-2007-09-24_05/hw/ps2.c:250 ps2_keyboard_set_translation(1)

Signature · 1 line
Alexander E. Patrakov