zyzzle wrote on 2023-03-06, 14:38:
rasteri wrote on 2023-03-06, 12:40:
For built-in graphics yeah, but I recently tried DOS games on an RTX 3080 and they mostly worked great. So I'm guessing that using an external card may allow VGA modes?
... if you can get into legacy boot in the first place. The 3080 must have a Compatibility Support Module (CSM) which means it still retains the legacy 16-bit vBIOS code within its video BIOS. The problem then becomes: Does your system support the loading of a CSM from that video card, and does the system have a legacy BIOS which isn't UEFI-only? This would allow booting into bare metal DOS. And, of course also enable the VGA modes (and VBE3 modes) in the tables of the 3080's 16-bit vBIOS. And along with SBEMU, you'd have a super souped-up DOS gaming experience...
I believe you're mixing up CSMs with Option ROMs. The CSM is an optionally integrated component of UEFI, which adds legacy BIOS compatibility. The problem is that since (I believe) 2020 or so, UEFI systems no longer ship with a CSM, and unfortunately it's not something you can load afterwards. Apparently, it needs to be compiled in when the UEFI BIOS image is built by the manufacturer. So if your system doesn't come with a CSM, you'd have to rely on the manufacturer to eventually release a BIOS update that upgrades the UEFI to a version that was compiled with a CSM. But they probably won't do that if they haven't shipped it with one in the first place.
The part that must be provided by the graphics card in order to be able to boot into DOS and support legacy VGA graphics and such is called an Option ROM. So in rasteri's case, the RTX 3080 apparently turned out to have a proper Option ROM for legacy BIOSes. This seems like a modular mature firmware component that NVIDIA has carried over from generation to generation with little cost, and continues to work well. That's nice, but I don't expect them to put serious effort in tracking down DOS game compatibility issues with it. I wouldn't be surprised if their Option ROM code has hardly been touched since the early GeForce days. 🙂
By the way, it's not just graphics cards that can have Option ROMs. It's also present on bootable disk controllers, such as SATA and SCSI controllers, as well as NICs that support network booting. There is even at least one modern NVMe SSD drive that has an Option ROM to allow it to boot into DOS and other pre-UEFI operating systems: the Samsung 950 Pro. However, that's a rare exception that fills a modest niche, since the industry's migration to UEFI was already well underway when the first NVMe drives started to appear on the market.
Option ROMs are mapped to the UMB area (the top most part of the first 1MB of RAM, which is accessible in Real Mode). Upon startup, the legacy BIOS (or in the case of a UEFI bios, the CSM) scans the memory for these Option ROMs and loads them as it finds them, before starting the boot process.
Tkchia's biefircate project that I mentioned earlier is intended to be an alternative solution to CSMs that, unlike those, can be installed on a UEFI system without having to be built with it from the factory. UEFI will simply boot it as if it were an OS. Biefircate will then try to set up the legacy BIOS API services itself, after which it will try to boot pre-UEFI operating systems in the same way that a legacy BIOS would. As part of this process, it will actually scan the UMB area for Option ROMs and if it finds any, it will try to load them. That's pretty cool.
But to summarize, as long as biefircate isn't ready yet, the following things are necessary for a modern (UEFI) PC to be able to boot DOS natively:
- The UEFI must have been built with a CSM
- The graphics card must have an Option ROM that will offer Video BIOS extensions, including legacy VGA compatibility and preferably also Vesa BIOS extensions (VBE)
- There must be a bootable controller with an Option ROM installed, either a drive controller or a NIC (or both).