I have this Amstrad PC5086 XT clone I thinker with. I am Italian, so I need to type accented letters from time to time, and thus to load an appropriate driver to support international keyboard layouts. PC-DOS keyb.com eats up 6K of precious memory, so I searched around for a more memory efficient solution. mKEYB by Tom Ehlert is a very small keyboard driver, with a resident size of 500-700 bytes, depending on the keyboard. Unfortunately, it requires a 80286 or better machine. Since the source code is GPL'ed, I modified it to work also on machines with an 8088 or 8086 CPU. The new code is available at https://github.com/davidebreso/mkeyb, and the executable is attached to this post, toghether with some incomplete documentation.
gives you a help screen, and
lists all available keyboard layouts. Try first to run it with the layout code and no other switches, e.g.
for italian. If everything works, congratulations! Your BIOS support all the required functionalities and you can enjoy your ~700 bytes driver. If not, see below for some hints.
The driver loads but the keyboard remains with the default US layout: your BIOS do not use INT 15,4F to allow for layout translation. Try with the /9 switch:
This switch installs a new handler for INT9 (keyboard interrupt on XTs) that calls INT 15,4F to translate the layout. The handler should work on any machine
with a keyboard controller that is compatible with the 8255 PPI of the original IBM PC and XT: data buffer at port 60h and status register at port 61h. If your machine uses a keyboard controller that answers on different ports, the handler will most likely hang your keyboard.
The driver loads, some keys works but others do not (nothing happens when I press them): yout BIOS do not implement the INT 16,5 service to insert a new keystroke in the keyboard buffer. Try with the /G switch:
This switch installs a new handler for INT 16 (keyboard services) with the required functionality. You may need to combine /G with /9:
Something else happens: please report back here, we may find a solution (or maybe not )
To uninstall the driver you can use
or
(US keyboards do not need a driver)
How it works
mKEYB is so small because it relies on the BIOS to do most of the work. It should work on any machine where the BIOS keyboard routines uses INT 15,4F to allow for keyboard translation, and implements the INT 16,5 service (Keyboard buffer write). All the required functionalities are usually present in AT, PS/2 and later class machines. This is not the case for XT machines, where different BIOSes implement different subsets of the above functionalities. The current code works on my machine, an Amstrad PC5086 with an enhanced 101 keys keyboard. Consider it untested on anything else. I would like to continue working on it to improve compatiblity, but I don't have any other machine to test the driver. So I ask anyone that is interested to download the driver, test it and report back here. Suggestion on how to improve the code are also very welcome, I am anything but an expert on dos drivers.How to use it
Code:
mkeyb /?
Code:
mkeyb /l
Code:
mkeyb it
The driver loads but the keyboard remains with the default US layout: your BIOS do not use INT 15,4F to allow for layout translation. Try with the /9 switch:
Code:
mkeyb it /9
with a keyboard controller that is compatible with the 8255 PPI of the original IBM PC and XT: data buffer at port 60h and status register at port 61h. If your machine uses a keyboard controller that answers on different ports, the handler will most likely hang your keyboard.
The driver loads, some keys works but others do not (nothing happens when I press them): yout BIOS do not implement the INT 16,5 service to insert a new keystroke in the keyboard buffer. Try with the /G switch:
Code:
mkeyb it /G
Code:
mkeyb it /9 /G
Something else happens: please report back here, we may find a solution (or maybe not )
To uninstall the driver you can use
Code:
mkeyb /u
Code:
mkeyb us
Known limitations
- as remarked above, the INT 9 handler is written for controllers compatible with the 8255 PPI, and may have unpredictable results with non-standard keyboard controllers
- the layouts are for 101/102 keys enhanced keyboards. They may not be accurate for 83 keys keyboard
- there is no autodetect of the BIOS functionalites: you have to specify the /9 and/or /G switch if you need them