[Solved] DOS keyboard

Discussions about using non Windows and Linux guests such as FreeBSD, DOS, OS/2, OpenBSD, etc.
Post Reply
jmunkdk
Posts: 5
Joined: 27. Aug 2015, 23:02

[Solved] DOS keyboard

Post by jmunkdk »

Here is an interesting one....

We still have an active Intel 80188 project, and we use an old DOS program called Paradigm to run an emulator. Unfortunately the old computer running this setup has crashed, so my immediate solution was to install DOS in a VirtualBox and then just run it from a new Windows computer. This actually works except for one crucial exception: When this emulator program is actively running the 80188, it can only be paused (debug break) with a Ctrl+C, and this does not get through VirtualBox, so we cannot break when running. In all other cases the keyboard and end even the mouse works fine.

Upon further research, the failure of getting the emulator program to stop goes deeper than VirtualBox. The emulator program can actually run directly in WinXP and the problem is the same and I have come so far that I have installed DOS (FreeDOS) directly on a computer and the same thing happens. There is one important difference form the deceased computer that used to work: The old computer had a PS/2 keyboard while everything I have tried so far has been USB keyboards.

Could it be that this ancient DOS program is checking/reading the keyboard in a special way, that doesn't exist for USB keyboards, when it is running the emulator? Is there any way to make this happen in VirtualBox, since this is the preferred solution?

Thanks,

Jens.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: DOS keyboard

Post by andyp73 »

This may be a little out of left field...

Your post implies (forgive me if I have this wrong) that you have tried your emulator on systems running VBox and Windows XP that are desktop machines with a USB keyboard. Have you tried using a laptop instead as most still have the keyboard and touchpad connected through PS/2 interfaces.

Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: DOS keyboard

Post by mpack »

I'm not sure you're on the right track here. The VM always has a (simulated) PS/2 keyboard, so the USB part of the equation can't be relevant as far as I can see. Even if the DOS app installed its own keyboard interrupt handler, it will still always see the appropriate scancodes for the Ctrl and C keys.

But, DOS apps generally don't install their own keyboard int handler - they call DOS, which calls the BIOS. XP OTOH does not call the BIOS to read the keyboard, so there is no guarantee that a particular key combination when looked up in a translation table will be translated into the same keycode sent to the app.

Quick question: have you tried typing the "break" or "ctrl+break" keys when running this app in XP?
jmunkdk
Posts: 5
Joined: 27. Aug 2015, 23:02

Re: DOS keyboard

Post by jmunkdk »

Yes,

VBox is on my laptop and here I have tried tried WinXP and DOS. I have also tried XP directly on another laptop as well as desktop w usb kb. Dos has also been tried on a desktop w usb kb.

My laptop is a pretty new Dell.

Jens.

andyp73 wrote:This may be a little out of left field...

Your post implies (forgive me if I have this wrong) that you have tried your emulator on systems running VBox and Windows XP that are desktop machines with a USB keyboard. Have you tried using a laptop instead as most still have the keyboard and touchpad connected through PS/2 interfaces.

Andy.
jmunkdk
Posts: 5
Joined: 27. Aug 2015, 23:02

Re: DOS keyboard

Post by jmunkdk »

Thanks,

Yes, I have tried Ctrl as well as Alt in combination with pretty much any key including break.

Jens.
mpack wrote:I'm not sure you're on the right track here. The VM always has a (simulated) PS/2 keyboard, so the USB part of the equation can't be relevant as far as I can see. Even if the DOS app installed its own keyboard interrupt handler, it will still always see the appropriate scancodes for the Ctrl and C keys.

But, DOS apps generally don't install their own keyboard int handler - they call DOS, which calls the BIOS. XP OTOH does not call the BIOS to read the keyboard, so there is no guarantee that a particular key combination when looked up in a translation table will be translated into the same keycode sent to the app.

Quick question: have you tried typing the "break" or "ctrl+break" keys when running this app in XP?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: DOS keyboard

Post by mpack »

Does your DOS app simply pause when you hit Ctrl+C, or does the simulation app terminate? Ctrl+C used to be intercepted by DOS (if read from stdin/int21), and DOS terminated the application. There is of course no direct causal relation between a key being pressed and an app running or not.
jmunkdk
Posts: 5
Joined: 27. Aug 2015, 23:02

Re: DOS keyboard

Post by jmunkdk »

It breaks the emulation/debugging of the 80188, so you can e.g. start to look up register values, single step etc. It's the same as breaking execution in any other debugger.

mpack wrote:Does your DOS app simply pause when you hit Ctrl+C, or does the simulation app terminate? Ctrl+C used to be intercepted by DOS (if read from stdin/int21), and DOS terminated the application. There is of course no direct causal relation between a key being pressed and an app running or not.
jmunkdk
Posts: 5
Joined: 27. Aug 2015, 23:02

Re: DOS keyboard

Post by jmunkdk »

The mystery has been resolved. It in my attempts on various virtual and real computers, it appeared that there was another important difference besides the keyboard type - the serial port. Even high quality USB <-> serial ports are apparently not good enough while a couple of old computers with build-in serial work fine.

Thanks for your efforts,

Jens.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: DOS keyboard

Post by mpack »

Thanks for reporting back, and I'm glad you got to the bottom of it. So the USB thing was a red herring after all - reassuring to know.
Post Reply