skiselev / 8088_bios

BIOS for Intel 8088 based computers
GNU General Public License v3.0
513 stars 61 forks source link

Xi 8088: POST spends 20 seconds in kbc_init when PS/2 mouse is not connected #63

Closed skiselev closed 6 months ago

skiselev commented 6 months ago

This issue initially reported by @roytam1 here: https://github.com/skiselev/8088_bios/issues/15?notification_referrer_id=NT_kwDOAKzUxrMyODg5MTg3NzQ4OjExMzI2NjYy#issuecomment-1929462569

The POST on Xi 8088 or similar systems with an AT-style keyboard controller takes 20 seconds when PS/2 mouse is not connected.

When it happens the "08" POST code is shown during that time.

skiselev commented 6 months ago

The root cause seems to be the kbc_aux_send retrying kbc_aux_read -> kbc_data_read 10 times and getting a timeout there since there's no PS/2 mouse to respond to the commands. Each kbc_data_read takes about 2 seconds to timeout.

The fix is to remove the retries in kbc_aux_send. The kbc_data_read should provide enough retries already: https://github.com/skiselev/8088_bios/commit/8fd8cea2bbb94fb0e0ba03ed7d40034ea125c5d8