From 19b9b0b995ec6217f572c3867f612e13e84aab3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 8 Dec 2025 17:36:42 +0100 Subject: [PATCH] [FREELDR:PC] pcvideo.c: Fix two regression bugs (#8498) - `PcVideoDetectVideoCard()`: Fix the call to Int 10h AX=1A00h. A 23-year old regression from commit 425bbb1543 (r3782), introduced by a copy-pasta error when converting video code from ASM to C. - `PcVideoSetMode80x50_80x43()`: Fix setting the 80x50 VGA text-mode, which _is_ based on the 80x25 text-mode BIOS 0x03, see e.g. https://github.com/torvalds/linux/blob/c2f2b01b74be8b40a2173372bcd770723f87e7b2/arch/x86/boot/video-vga.c A 18-year old regression from commit 1b3e649577 (r25751), where the correct mode 0x03 was replaced by a VGA graphics mode 0x12, whereas the intent in this commit was to only switch to mode 0x12 only in `PcVideoPrepareForReactOS()` -- this was because at that time, bootvid and hal didn't support changing the video mode to what they needed. This has been fixed since. --- boot/freeldr/freeldr/arch/i386/pc/pcvideo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c index f8554d34484..b48e8f7ae2e 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c +++ b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c @@ -193,8 +193,7 @@ PcVideoDetectVideoCard(VOID) * 0Ch MCGA w/ color analog display * FFh unknown display type */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x10; + Regs.w.ax = 0x1A00; Int386(0x10, &Regs, &Regs); if (0x1a == Regs.b.al) @@ -614,7 +613,7 @@ PcVideoSetMode80x50_80x43(VOID) { if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) { - PcVideoSetBiosMode(0x12); + PcVideoSetBiosMode(0x03); PcVideoSetFont8x8(); PcVideoSelectAlternatePrintScreen(); PcVideoDisableCursorEmulation();