Patchwork Re : Regression: more 0.12 regression (SeaBIOS related?)

login
register
mail settings
Submitter Kevin O'Connor
Date March 12, 2012, 12:52 a.m.
Message ID <20120312005204.GA2340@morn.localdomain>
Download mbox | patch
Permalink /patch/146030/
State New
Headers show

Comments

Kevin O'Connor - March 12, 2012, 12:52 a.m.
On Wed, Mar 07, 2012 at 06:31:31AM -0800, Alain Ribière wrote:
> I ran qemu 1.0.1 and the latest SeaBIOS (from the git) with the following options :
> qemu-system-i386 -L git/bios -fda disk.img -no-fd-bootchk -boot a -m 16
> 
> Here is the log :
> https://docs.google.com/open?id=0B7mz0vq6Rpb7UE1ibjJDcEhTRWlNV050QnMyMWwtZw
> 
> Here is the floppy disk image I used :
> 
> https://docs.google.com/open?id=0B7mz0vq6Rpb7bHpYaEt2SnVUUi1KaWE3a3lBQUJpQQ
> 
> 
> The floppy disk is simply a C-DOS 720 Ko floppy created by "format
> a: /s". So it's quite empty.
> 
> Qemu doesn't crash or freeze. But I can just type a single character
> and the nothing else. But the system is still running (there is a
> clock at the bottom right of the screen).

I tracked this down.  Looks like the image takes over the PS2 irq and
keyboard handling, but then occasionally calls into the BIOS.  When it
does call the BIOS irq handler (manually), it expects the irq handler
to enable the keyboard.  Weird.

Anyway, the patch below fixes it for me.

-Kevin


From 90ce89f8953da0e89c311aa34116b59aac1c6c5e Mon Sep 17 00:00:00 2001
From: Kevin O'Connor <kevin@koconnor.net>
Date: Sun, 11 Mar 2012 20:45:56 -0400
Subject: [PATCH] ps2: Enable keyboard at end of PS2 port irq.
To: seabios@seabios.org

Looks like some old programs expect the keyboard irq to enable the
keyboard port at the end of the irq.  This behavior was seen on an
image of "Concurrent DOS".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
 src/ps2port.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Alain Ribière - March 12, 2012, 10:38 a.m.
>On Wed, Mar 07, 2012 at 06:31:31AM -0800, Alain Ribière wrote:

> > I ran qemu 1.0.1 and the latest SeaBIOS (from the git) with the following options :
> > qemu-system-i386 -L git/bios -fda disk.img -no-fd-bootchk -boot a -m 16
> > 
> > Here is the log :
> > https://docs.google.com/open?id=0B7mz0vq6Rpb7UE1ibjJDcEhTRWlNV050QnMyMWwtZw
> > 
> > Here is the floppy disk image I used :
> > 
> > https://docs.google.com/open?id=0B7mz0vq6Rpb7bHpYaEt2SnVUUi1KaWE3a3lBQUJpQQ
> > 
> > 
> > The floppy disk is simply a C-DOS 720 Ko floppy created by "format
> > a: /s". So it's quite empty.
> > 
> > Qemu doesn't crash or freeze. But I can just type a single character
> > and the nothing else. But the system is still running (there is a
> > clock at the bottom right of the screen).
> 
> I tracked this down.  Looks like the image takes over the PS2 irq and
> keyboard handling, but then occasionally calls into the BIOS.  When it
> does call the BIOS irq handler (manually), it expects the irq handler
> to enable the keyboard.  Weird.
> 
> Anyway, the patch below fixes it for me.
> 
> -Kevin

Great ! It works for me too.

Thanks a lot,

Alain

Patch

diff --git a/src/ps2port.c b/src/ps2port.c
index 1f04299..4b27b7a 100644
--- a/src/ps2port.c
+++ b/src/ps2port.c
@@ -404,6 +404,9 @@  handle_09(void)
 
     process_key(v);
 
+    // Some old programs expect ISR to turn keyboard back on.
+    i8042_command(I8042_CMD_KBD_ENABLE, NULL);
+
 done:
     eoi_pic1();
 }