void HAL_KbdScanSetup(void)
---------------------------
Called when the Kernel is ready for the HAL to start scanning the keyboard
for boot-time keys. The scan must happen under interrupts - the HAL
should arrange for its keyboard controller to be set up to generate
interrupts, and for the appropriate interrupt to be unmasked in the
IRQ controller.

void HAL_KbdScanInterrupt(void)
-------------------------------
Attached to the processor IRQ hardware vector - called whenever an IRQ
occurs between the calls to HAL_KbdScanSetup and HAL_KbdScanFinish.
Uses standard HAL calling conventions; will be in IRQ mode with IRQs
disabled.

unsigned int HAL_KbdScan(void)
------------------------------
Called when the Kernel wants to check the results of the keyboard scan
so far.

The return value indicates which keys have been detected:

    bit 0: Ctrl down (indicating hard reset)
    bit 1: Shift down (indicating reversal of *Configure Boot)
    bits 2-3: reserved, should be 0
    bit 4: R down (CMOS reset, auto sync)
    bit 5: T down (CMOS reset, separate sync)
    bit 6: Delete down (full CMOS reset, auto sync)
    bit 7: Copy/End down (full CMOS reset, separate sync)
    bits 8-30: reserved, should be 0
    bit 30: Keyboard presence detected
    bit 31: Keyboard scan complete

Bits must never be reported clear when they have been reported set
by a previous call.

The "complete" bit indicates that the HAL is confident that sufficient
time has elapsed for the keyboard (if present) to have reported all
keypresses.

The Kernel will typically make this call repeatedly until the
"complete" bit is set, although the HAL should not rely on this - the
Kernel may have its own timeout.


void HAL_KbdScanFinish(void)
----------------------------
Called when the Kernel wishes to terminate the keyboard scan.

The HAL should disable interrupt generation from the keyboard controller;
it may leave the interrupt enabled in the IRQ controller.

The calls to Setup and Finish currently bracket the RAM clear, providing a
reasonable length of time to perform a keyboard scan. The HAL may request
extra time by using the "complete" bit in the KbdScan call.
