shithub: riscv

Download patch

ref: a597496b19993379ad2cde4d7dd11e20b2122c00
parent: 3e9ae26c2ea9c1b0c1bfcc0ad02c58bc65cb5294
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Apr 6 12:35:37 EDT 2024

9boot: use BIOS tick counter instead of INT 0x15 WAIT

To implement keyboard input timeout, we used
to poll the keyboard in a loop with a 100ms
sleep in between using INT 0x15 WAIT BIOS call.

But it seems iPXE breaks the BIOS call, making
it just hang.

The BIOS has a 32-bit tick counter at
040:006C that has a period of 54.9254ms.

Using that instead of the WAIT call appears to be
more reliable and makes it work in iPXE.

Implementation note:

Because the counter has a wrap around value
at non-power-of-two, only check if the counter changed
and counting down the millisecond timeout when it did.