skiselev / 8088_bios

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

Update video row count upon setting the video mode #42

Closed zhmu closed 1 year ago

zhmu commented 1 year ago

Memory location 0040h:0084h is described in RBIL as VIDEO (EGA/MCGA/VGA) - ROWS ON SCREEN MINUS ONE. It is referred to as video_rows in the 8088_bios source code.

It turns out this value is never set, and thus is always zero. This causes strange behaviour when installing FreeDOS, since VECHO.COM (part of V8POWER tools) uses this field during initialization to determine how to scroll the screen (BasicInitialize incommon.inc). As this value is zero, it will end up overwriting the same line.

8088_bios only seems to support video modes of either 40x25 or 80x25, so simply setting video_rows to 24 is sufficient.

skiselev commented 1 year ago

Technically it is not a bug in the BIOS, but a bug in V8Power. The system BIOS is not guaranteed to initialize this variable. It appears to be initialized only by EGA or VGA BIOS extension ROMs. (While the system BIOS only supports CGA and MDA).

I submitted a bug report to V8Power https://github.com/LoopZ/V8Power/issues/4.

Nevertheless, the change looks pretty harmless to me. I'll merge it and hope that no one else does a does a stupid thing like using this value to determine whether the system has EGA/VGA or not 😉

skiselev commented 1 year ago

By the way, V8Power system requirements say "EGA or better video adapter." So I am not sure if they are going to fix an issue which occurs due to an unsupported (CGA or MDA) video controller