Oldskooler Ramblings

the unlikely child born of the home computer wars

Archive for January 27th, 2008

Fine, I’ll do it myself

Posted by Trixter on January 27, 2008

All (and I really do mean all) of the hardware info for low-level PC programming available on the internet today is for ATs and later. Which didn’t help me debug my keyboard handler, as I’m on an XT and the behavior is different.

So I got fed up with looking and decided to just locate the BIOS’ own keyboard handler and see what it’s doing:

-u f000:0d78
F000:0D78 50            PUSH    AX
F000:0D79 53            PUSH    BX
F000:0D7A 51            PUSH    CX
F000:0D7B 52            PUSH    DX
F000:0D7C 56            PUSH    SI
F000:0D7D 57            PUSH    DI
F000:0D7E 1E            PUSH    DS
F000:0D7F 06            PUSH    ES
F000:0D80 FC            CLD
F000:0D81 E88EEC        CALL    FA12
F000:0D84 E460          IN      AL,60
F000:0D86 93            XCHG    BX,AX
F000:0D87 E461          IN      AL,61
F000:0D89 8AE0          MOV     AH,AL
F000:0D8B 0C80          OR      AL,80 <--Hey, that's
F000:0D8D E661          OUT     61,AL <--new!!
F000:0D8F 86E0          XCHG    AH,AL
F000:0D91 E661          OUT     61,AL
F000:0D93 FB            STI
F000:0D94 93            XCHG    BX,AX
F000:0D95 B44F          MOV     AH,4F
F000:0D97 F9            STC

So, after reading the scan code from port 60h like on ATs and later, the PC/XT is also finding it necessary to acknowledge the scancode by setting bit 7 on port 61. Thanks for nothing, intarweb!

This is an example of why I tell my co-workers at my Unix sysadmin job that my old DOS knowledge from 1983 helps me in all of my computer work: Because basic troubleshooting skills are basic troubleshooting skills. Computers are pretty much the same; if you train yourself to think a certain way, it will lend itself to other computer problems.

If this post seems incoherent and not an example of my best writing, that’s because I just got finished playing my first game of Team Fortress 2 and my vision is still blurred. The last online FPS I played, Counter-Strike, was in 2004… I’m way out of practice and still quite disoriented.

Posted in Programming, Vintage Computing | 2 Comments »