From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfAkg-0000Ha-2Z for qemu-devel@nongnu.org; Sun, 23 Aug 2009 06:56:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfAkb-00007g-7S for qemu-devel@nongnu.org; Sun, 23 Aug 2009 06:56:45 -0400 Received: from [199.232.76.173] (port=34361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfAkb-00007P-0c for qemu-devel@nongnu.org; Sun, 23 Aug 2009 06:56:41 -0400 Received: from mail-bw0-f227.google.com ([209.85.218.227]:43084) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfAka-0005Ot-GD for qemu-devel@nongnu.org; Sun, 23 Aug 2009 06:56:40 -0400 Received: by bwz27 with SMTP id 27so1250126bwz.34 for ; Sun, 23 Aug 2009 03:56:38 -0700 (PDT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: Date: Sun, 23 Aug 2009 12:54:53 +0200 From: Stefan Ring Subject: [Qemu-devel] [PATCH 0 of 1] Fix for DOS keyboard problems List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a repost as inline diff - there don't seem to be many attachments on this list. Scratching an itch for myself, I have created a patch that allows me to use Turbo Pascal and other Turbo Vision-based programs from DOS. I post it here in the hope that someone take a good look, and maybe, there's even a chance of this going into mainline. I verified that it doesn't break keyboard or mouse functionality in Win 3.11, Win 2000 and Linux X11 (from systemrescuecd 1.1.4) as well as some DOS games. Couldn't get win98 to run, unfortunately, so no testing there. However, there is always the chance that it might break some random obscure stuff, and clearly I cannot test everything. The patch basically exploits the fact that the BIOS IRQ 1 handler always does - - in this order. We just remember the last value read from port 60h outside this disable/enable block and play it back inside. The keyboard is still very unreliable when a keyboard driver is loaded inside DOS (I assume that the keyboard driver completely disables the BIOS handler). This behavior is also present without my patch, and I personally don't care about it, so this should not be an obstacle. I also didn't know what to do about kbd_save and kbd_load just because I didn't dig into them to find out what they are used for. The new member should probably be serialized there. My ultimate hope would be to get this into VirtualBox (see ticket #58 [1]). It should be easy enough to adapt the patch to VirtualBox; I will try to do that within the next few days. [1] http://www.virtualbox.org/ticket/58