-
Notifications
You must be signed in to change notification settings - Fork 25
GLaBIOS Extended Keyboard Support
GLaBIOS 0.8 implements INT 16h extended keyboard functionality which provides the correct outputs across 83-key, 84-key, or 101-key layouts, whether software calls original or extended INT 16h functions. This has been tested to be 100% consistent with the reference IBM PC/AT 5170, late-model IBM PC/XT 5160 (1986 revision), and AMI 286/386 behaviors. It is the only known XT-class BIOS to achieve full compatibility while fitting within a standard 8K BIOS ROM.
An INT 16h Scan Code Reference was created by documenting the INT 16h ASCII and scan codes produced for each key combination on known-complete reference BIOSes. This includes:
- Dedicated extended keys: Standalone Insert, Delete and dedicated keys.
-
Duplicated/moved keys: Keypad
/versus standard? /, and keypad*versus standard8 *. - Modifier behaviors: Distinct Left/Right Ctrl and Alt actions, and unique Shift combinations.
- Special hardware interrupts: Print Screen, Pause/Break, SysRq, and Scroll Lock behavior.
Extended keyboard BIOS support became the industry standard during the AT era. Many software titles made use of these features for advanced user interfaces, though these might not function as well using a BIOS without complete extended INT 16h support. Examples include:
-
DOS 5+ EDIT / QBASIC: Advanced editing shortcuts (e.g.,
Shift+Arrow,Ctrl+Home/End) may not work as expected depending onNumLockstatus. -
Norton Commander / Volkov Commander: Some text selection/key combination shortcuts do not work, and function keys
F11/F12are unrecognized. -
Prince of Persia: The crucial
Shift+Arrow"sneak" does not work ifNumLockis active. - DOS 5+: If available, uses extended INT 16h BIOS functions for console input within underlying INT 21h services.
IBM introduced extended keyboard support with the 1986 IBM PC/AT 5170 BIOS revision to accommodate the new 84-key Model F and 101-key Model M layouts. The primary challenge was balancing backward and forward software compatibility across different hardware and software generations.
Software needs to distinguish new physical keys from older keys that share the same function. For example, a game should recognize the dedicated arrow keys on a 101-key keyboard separately from the numeric keypad arrows. This must work seamlessly whether the system BIOS understands extended keyboards or not.
To accomplish this, extended keyboards have specific hardware and software behaviors:
-
Escape prefixes: Extended keys send multiple scan codes prefixed by
0xE0or0xE1. Extended BIOS functions intercept these prefixes, while legacy BIOSes safely ignore them. -
Legacy sequences: Special keys simulate older keystroke patterns to maintain backward compatibility. For example, Print Screen mimics
Shift+PrtScn/*, and Pause mimicsCtrl+NumLock. -
Parallel API functions: The BIOS exposes new services (
AH=03h–05h,AH=10h–12h) that parallel the legacy functions (AH=00h–02h) for reading keystrokes and shift states. - Dynamic re-mapping: When legacy software calls standard functions, an extended BIOS substitutes the closest 83-key equivalents for 101-key inputs. Conversely, when modern software uses extended functions on an 83-key keyboard, the BIOS maps those inputs to mimic 101-key behaviors.
- https://cosmodoc.org/topics/keyboard-functions/
- https://www.plantation-productions.com/Webster/www.artofasm.com/DOS/ch20/CH20-1.html
- INT 16h standard/extended Scan Code Reference
- DOS program that displays INT 16h keystroke output:
-
- KB2E.COM using EXTENDED (AH=11h) keyboard functions
-
- KB2.COM using STANDARD (AH=01h) keyboard functions