Will this become a 3rd-party CSM for UEFI Class 3 soon?
Created by: tkchia
https://github.com/tkchia/biefircate/discussions/4
Discussed inOriginally posted by UsefulVideos January 1, 2022
Hello @tkchia, I saw your project and it is interesting! Considering the fact that your goal is to make FreeDOS run in pure UEFI, I keep wondering if when you reach the goal and everything works better than expected, will you ever consider gradually turning it into a universal CSM or a legacy bios emulator in the form of EFI executable which loads bios files (total opposite of DUET which emulates UEFI on legacy bios pc) so you can force legacy mode on unsupported UEFI (class 3)?
Originally posted by tkchia January 1, 2022
Thanks for your interest @UsefulVideos !
Considering the fact that your goal is to make FreeDOS run in pure UEFI, I keep wondering if when you reach the goal and everything works better than expected, will you ever consider gradually turning it into a universal CSM or a legacy bios emulator
That is possible, but I will need to take things one step at a time.
Are there any particular legacy OS(es) you have in mind, which you might want to run on a UEFI machine? I suspect some of these might be easier than FreeDOS to get up and running.
Thank you!
Originally posted by UsefulVideos January 2, 2022
Yeah, for example, I have tried to run Windows XP 64 bit edition, Windows 7 on my Asus x509FA Intel core i7 8th using Windows 7 EFI files, but the laptop is too new to support CSM, on VirtualBox however, it boots with a black screen (unless I have installed guest additions in BIOS mode). I have tried to use UefiSeven, VgaShim int10h emulators on XP 64 (with longhorn server 6001.16497 files, which are compatible with windows 7 bootloader and the two emulators.) and Windows 7 because the EFI files from windows 7-era still insist on using Int10h interrupts for VGA display even on UEFI mode. I have tried to use these two tools even on a virtual machine but apparently, it tells me the same error: "Unable to unlock VGA ROM memory at C0000, aborting", the same error persisted even on a virtual machine using both UefiSeven and VgaShim, I don't know if it's because of the hypervisor and paravirtualization that I have enabled, but I decided to try Biefircate for now.
When I booted Biefircate from the UEFI boot order, it tells me that I can't find the VGA/XGA display rom (probably because it tried to boot on legacy mode and my laptop has only GPT partitions maybe? and returns to firmware and prompts me to save the changes. After saving and restarting, I received the modern BSOD probably for the same reason above, not booting on GPT, I haven't tried it on MBR yet. Regarding the VGA/XGA display rom I don't know how to make it work, am I supposed to add something like a driver, rom, bin, or executable in the same directory as the EFI file and stage2.sys to make it work?).
I am gonna try to boot biefircate on VirtualBox with UEFI enabled on MBR, to see if it works this time.
The reason I am trying to use Biefircate is that I see this program as a potential in booting windows XP and/or windows 7 in UEFI class 3 because compared to UefiSeven/VgaShim, I see more progress regarding the bios interrupts. EDIT: On MBR on VirtualBox, the stage2 file worked, but if try to use other files it gives the bad emu error.
Originally posted by tkchia January 3, 2022
Hello @UsefulVideos,
Thank you for the information.
Regarding the VGA/XGA display rom I don't know how to make it work, am I supposed to add something like a driver, rom, bin, or executable in the same directory as the EFI file and stage2.sys to make it work?).
There should be no need to do that. Biefircate currently expects your PC's own firmware to contain a legacy option ROM (a.k.a. expansion ROM) image for your VGA hardware. It tries to ask the PC's UEFI system — in two different ways — to see if it might have something that looks like option ROM code that can interface with your video card (without accidentally frying it).
The option ROM will basically contain a complete video driver, which it will install as real mode int 0x10
. Legacy OSes which lack their own display drivers — FreeDOS is one such OS — can use this to set up the monitor and actually draw stuff on the screen.
Unfortunately I do not have an immediate solution at hand to your particular problem. I guess it is possible that your video card does not have a legacy option ROM for it — or maybe there is one, but it must be fished out with great difficulty (?). I should probably check out what UefiSeven and VgaShim are really doing to handle such cases.
Thank you!
Originally posted by xrayer March 24, 2022
Hi, I have the same problem with VGA. As I already wrote on BTTR forum, I got a new HP laptop at work with 11th gen Core i7 and it's completly legacy free, no BIOS option. In my case it's more complicated because I have enabled SecureBoot from IT policy and cannot disable it but I overcome this issue by alternative signed bootloader that use GRUB2 so I can load any unsigned UEFI module. I tried to boot Biefircate but it complained about VGA BIOS as wrote the user above. BTW wehere should I place the stage2.sys file when I boot it from different directory than /efi/boot ?
Also I tried GRUB4DOS-UEFI but got just black screen - do you know if it also rely on legacy VGA? This would probably be the reason. I heard that UEFI provide some FB driver that could be used at least for textmode output. How does modern UEFI-only VGA works? Does it have some FW ROM which is alternative to VGA option ROM but contains a 64bit long mode code with some UEFI functions? How this could be used when you flip to realmode at boot?
And finally there is SeaBIOS, it should be possible it to compile as CSM and load some way at boot without need of BIOS modding? I'm not sure if this can work on real HW or if it is intended just for QEMU and other VMs...
Originally posted by tkchia March 29, 2022
Hello @xrayer,
I tried to boot Biefircate but it complained about VGA BIOS as wrote the user above.
Unfortunately biefircate
currently still needs to be able to find a VGA option ROM in order to proceed, and for some reason it could not find one.
Did the bootloader display anything about a VGA device on startup? I.e. something like the following:
PCI devices: 6
locn. PCI id. class+IF ROM sz. supports attrs.
...
0000:00:02.0 1234:1111 03 00 00 0x009A00 0x04E708 0x040708 VGA -> 0x40708
ROM img.: @0x96000~@0x9F9FF (copied from @0xCAA3018)
BAR: {@0x80000000 pf} {@0x810A0000}
(note the VGA
part). If you know the PCI identifier of your graphics device, it might be possible to find a BIOS-compatible option ROM image for it, perhaps on the Internet. It will be quite a long shot, though.
BTW wehere should I place the stage2.sys file when I boot it from different directory than /efi/boot ?
For now, just put it in the same place as in the default setup (/EFI/biefirc/stage2.sys
).
Thank you!
Originally posted by tkchia March 29, 2022
Hello @xrayer,
Also I tried GRUB4DOS-UEFI but got just black screen - do you know if it also rely on legacy VGA?
No idea, unfortunately. You will probably need to ask the GRUB4DOS maintainers.
I heard that UEFI provide some FB driver that could be used at least for textmode output. How does modern UEFI-only VGA works? Does it have some FW ROM which is alternative to VGA option ROM but contains a 64bit long mode code with some UEFI functions? How this could be used when you flip to realmode at boot?
The UEFI Graphics Output Protocol is described in the UEFI Specification.
The protocol itself can only be used by the bootloader stage. But if you happen to set the video mode to a framebuffer mode just before exiting the bootloader, then the framebuffer will still persist, and you can continue using it in the OS. (Though, you cannot switch to a different video mode after that, without an actual video driver.)
And finally there is SeaBIOS, it should be possible it to compile as CSM and load some way at boot without need of BIOS modding?
This is something I am trying to do, but it is not easy...
Thank you!
Originally posted by xrayer March 30, 2022
Hi, it prints s lot messages at boot but I cannot capture it. It end with this complain about legacy ROM https://ibb.co/m5X2nX2 I cannot modify BIOS on this laptop to change videoBIOS. As it's integrated 11th gen. core HD graphics (quite new) it may not even exist from intel.
Originally posted by tkchia April 4, 2022
Hello @xrayer,
Thanks — this is interesting. So it seems that your system does have a VGA-compatible graphics device, but it cannot find any trace of a legacy option ROM for it.
Maybe, as a start, I could try to modify biefircate
so that it can more clearly display the PCI id. of the VGA-compatible graphics device — if and when I do that, I will let you know.
(Unfortunately SeaBIOS's VGA BIOS component may not be useful here — you most likely need an actual option ROM written for your particular graphics card. In particular, I know that some graphics cards are configured to become VGA-incompatible, when started in UEFI mode — they need special incantations to switch to a VGA-compatible mode. SeaBIOS does not know about these special incantations.)
Thank you!
Originally posted by tkchia April 6, 2022
Hello @xrayer,
I added some code to biefircate
to add a "slow-stepping" mode. If you press S
within the first 2 seconds that biefircate
starts up (you will be prompted about it), then biefircate
will pause and wait for a keystroke at certain points in its run. This should hopefully make it easier for you to capture the screen contents and see what is going on.
Here is a compiled binary image: hd.img.zip
.
(Edit: also, I have yet to find an option ROM image on the Internet for the 8086:9a60
device (https://pci-ids.ucw.cz/read/PC/8086/9a60) which you mentioned elsewhere. But perhaps I have not been looking hard enough.
Thank you!
Originally posted by lpsantil April 7, 2022
Could biefircatre maybe embed or otherwise load one of the VGA BIOSes that are out there?
Originally posted by tkchia April 8, 2022
Hello @lpsantil,
Could biefircatre maybe embed or otherwise load one of the VGA BIOSes that are out there?
This should be quite feasible — it is not yet implemented, though.
UEFI has a programmer interface for the bootloader to boot files from the boot partition, so it might be possible to get biefircate
to read some of the option ROM images it needs from there.
As for the option ROMs, as long as they are PC/AT-compatible and PCI-compliant and allow themselves to be positioned anywhere in main memory, there should not be much of a problem getting them to run. (Older VGA option ROMs expect to be loaded at 0xc000:0
and nowhere else. Newer VGA ROMs — including my PCs' — loosen this restriction.)
As for embedding the VGA option ROMs in the biefircate
project, I guess the main obstacles will be legal (software licenses and all that), rather than technical.
Thank you!
Originally posted by UsefulVideos April 20, 2022
I know this may not be about biefircate, but I want to mention something interesting about C0000 on UEFI Class 3 devices.
C0000 is the memory address for Int10h VESA VBios to provide VGA Video Output for a BIOS-based operating system. VgaShim/UefiSeven does this by integrating an Int10h OVMF Fakevesa handler on RAM memory every boot that replicates CSM's real Int10h handler.
FlashBoot Pro does the same, but the difference is that FlashBoot's Int10h handler may persist after restart making VgaShim/UefiSeven unusable giving the 'cannot unlock memory address C0000 on int10h handler' error.
It's also advised to avoid running UefiSeven on a virtual machine like VirtualBox because VBox's fake Int10h handler on EFI mode is designed to replicate GOP since it doesn't support GOP (when you go to UEFI shell and type 'drivers', you don't see 'GOP' in the driver name but 'VirtualBox VGA', 'VirtualBox SVGA'. Since VirtualBox's Fakevesa on EFI mode is designed to replicate GOP instead of VESA, Windows 7 will be able to boot with startup sound because of I/O outputs from fakevesa but the display will freeze without video output (at C0000, in hex editor VirtualBox's EFI fakevesa, strings specify 'VGA' instead of 'VESA'. If I'm not being mistaken, VgaShim/UefiSeven relays on 'VESA' string to be considered a valid Int10h handler that can be overwritten.) .
If C0000 is not empty, VgaShim/UefiSeven will give you the 'cannot unlock memory address C0000 on int10h handler' error on UEFI Class 3, or 'Int10h handler exists' on UEFI Class 2 with CSM enabled.
What has this to do with biefircate? Well, make sure to create a command that erases the content in memory access between C0000 and DFFF0 (Hex C0000, Length: 20000, use SLIC Toolkit V3.2 to determine if C0000 in the PC host has been tampered by the Virtual machine's Int10h emulator, in UEFI Class 3 it is supposed to empty. On UEFI Class 2, it should be empty when CSM is disabled.) length on memory access before integrating your Int10h VGA Emulator in that location in order to avoid the 'cannot unlock C0000' problem that VgaShim/UefiSeven have.
Originally posted by xrayer April 20, 2022
Hi, in my case I tested area C0000, it doesn't contain ROM header and code but it's not fully empty (may contain some temporaty used data). I tried to R/W there via UEFI Shell memory modify command and I was able to read back what I written there before so the area should be unlocked, ready to load some ROM/code there.
Originally posted by tkchia April 23, 2022
Hello @UsefulVideos,
Well, make sure to create a command that erases the content in memory access between C0000 and DFFF0 (Hex C0000, Length: 20000, use SLIC Toolkit V3.2 to determine if C0000 in the PC host has been tampered by the Virtual machine's Int10h emulator, in UEFI Class 3 it is supposed to empty. On UEFI Class 2, it should be empty when CSM is disabled.) length on memory access before integrating your Int10h VGA Emulator in that location in order to avoid the 'cannot unlock C0000' problem that VgaShim/UefiSeven have.
Hmm, I have not heard of this SLIC Toolkit before — perhaps I should learn a bit more about it. :detective:
Anyway, at the moment, my understanding is that things work this way:
biefircate |
VGAShim/UefiSeven |
---|---|
Looks for an actual VGA option ROM for initializing real mode BIOS video services (int 0x10 ) |
Installs a tiny piece of stub code — not an actual video driver — and makes real mode int 0x10 point to it, so that Windows can call it rather than crash |
Allows option ROM to be loaded anywhere in base memory (below 1 MiB mark) — say, at address 0x96000
|
Requires the tiny piece of "video driver" code to be loaded at 0xc0000 (at 768 KiB mark) |
Specially handles VirtualBox's VGA option ROM — VirtualBox simply places the code at 0xc0000 without telling UEFI about it; if VirtualBox's option ROM is present then we can simply use that |
? |
I am not sure why VGAShim and UefiSeven (still) insist that their stub code absolutely needs to be placed at 0xc0000
. Does Windows XP or Windows 7 actually require this? Perhaps VGAShim and/or UefiSeven can be modified to fall back on using some other memory location for their stub code?
I guess it would be a "nice thing to have" to have the VGA BIOS code go into the historically-used address. But I have not really found a reliable way under UEFI to do this yet.
Thank you!
Originally posted by UsefulVideos April 24, 2022
@tkchia The section for VGA VESA VBIOS is between C0000-DFFF0 (or what you called 0xc0000 - 0xdfff0), that's where Legacy Boot Windows expects to find it. If the content in that section is blank, it's supposed to say that there's no VGA/VESA VideoBios/Int10h on UEFI Class 2 with CSM disabled, especially UEFI Class 3 (Pure EFI). If on UEFI Class 3 on a functional GOP OS (Windows 8-11) there's leftover broken VGA code that persists after previously booting older OS (Windows 7 and older) using VGA Emulators (referring to Int10h OVMF Fakevesa for UEFI Class 3, not real Int10h from CSM), it may also mean that the newer pure EFI OS (Windows 8-11) would make the VGA code non-functional to prevent it from interfering with GOP (or breaking it), but wouldn't clean it up because the pure EFI OS doesn't need it. Every time the VBios code would be broken on UEFI Class 3, the C0000-DFFF0 section SHOULD have been overwritten to null (00) values by VgaShim/UefiSeven so that it becomes unlocked BEFORE trying to detect Int10h and installing the VGA emulator in that section to avoid the error. The problem is that VgaShim/UefiSeven on UEFI Class 3 tries to unlock the unclean code and fails because the code was broken by the newer Pure EFI OS (and the change persisted).
Originally posted by tkchia April 24, 2022
Hello @UsefulVideos,
Erm, no, no, no — that is quite certainly not how all this stuff works. I am not sure where you are getting your information on VGA and GOP from, but ... no.
Thank you!
Originally posted by UsefulVideos April 24, 2022
Hello @UsefulVideos,
Erm, no, no, no — that is quite certainly not how all this stuff works. I am not sure where you are getting your information on VGA and GOP from, but ... no.
Thank you!
Well, regarding Biefircate, my laptop has UEFI Class 3 (ASUS x509FA Intel Core i7 8th Coffe Lake 8 GB RAM), there's no VGA Option ROM for Biefircate to detect so I have to rely on VGA Emulators like VgaShim/UefiSeven or FlashBoot in order to boot older OSes.
So far only FlashBoot manages to boot Windows 7 setup but the mouse & keyboard aren't detected.
On VirtualBox, FlashBoot manages to boot Windows XP x64 from UEFI using a patched 16497 longhorn winload.efi (to disable signature enforcement) but the frame freezes unless I scroll, and pause the screen (basically doing anything that refreshes the frame).
UefiSeven fails to unlock C0000-DFFF0 (the C0000 section may unclean because of using hibernate/sleep function frequently instead of shutting it down). If C0000-DFFF0 is clean/empty, UefiSeven boots without video output (fails to lock C0000 but still continues). Since UefiSeven is based on VgaShim, these programs provide me with the same errors.
If FlashBoot EFI does something to the C0000 that prevents UefiSeven from unlocking it, maybe I should just use the FlashBoot efi (I'm gonna try to mess with the drivers in my custom win 7 EFI iso to get it working).
Anyway, regarding Biefircate, for laptop GOP-only GPUs, will you provide a second option (.ini file etc) for UEFI Class 3 so biefircate can either provide try to use GPU's VGA ROM first and then provide a fakevesa generic Int10h handler if no VGA ROM is detected?
Until a second option is added, what Biefircate currently does is detect the GPU's VGA ROM in CSM-free bios and boots it, the only option biefircate currently has.
Originally posted by tkchia April 26, 2022
Hello @UsefulVideos,
So far only FlashBoot manages to boot Windows 7 setup but the mouse & keyboard aren't detected.
I admit I am getting more and more confused by your problem descriptions.
For one thing, If you can get Windows 7 to show you a login prompt when you use FlashBoot, then the legacy VGA support — or lack thereof — on your laptop is almost certainly not the main issue.
My suggestion is this: perhaps try not to quickly jump to conclusions on what the problem with your Windows setups might be. Because — I am not kidding — if you do that, your guesses are highly likely to be wrong. So, it is best not to do that.
Instead, it will be much more helpful to tell us just what exactly you tried to do, and what exactly you observed. This will make it much easier to pinpoint your exact problem(s), and to better figure out whether biefircate
might actually be a good fit for whatever you are trying to do.
For a start, what exactly happened when you tried directly running an installed Windows 7 on your laptop? Directly, as in, without UefiSeven, without VGAShim, (if feasible) without FlashBoot, etc. — but simply selecting the appropriate device from your laptop's boot menu.
Thank you!
Originally posted by UsefulVideos April 26, 2022
The scope is obviously to try to boot Windows 7 (and older os) on pure UEFI without CSM (my laptop uses a CoffeeLake processor and is too new to support CSM, it doesn't even have a VGA port or a CD/DVD optical drive.) from setup and/or installed wim if possible.
Without FlashBoot, without any of Canonkong's ACPI.sys files, and without any of Flashboot's built-in splistreamed NVME/USB3.0 drivers etc, from experience the display would freeze and the os would hang up because of no Int10h, incompatible ACPI.sys, and missing storage drivers. With Flashboot + Flashboot's built in added drivers + original unpatched ACPI.sys, it would give the ACPI A5 BSOD (Without Flashboot, it would display a red bar on top instead). On windows setup, with FlashBoot + flashboot's built-in drivers + Canon Kong ACPI.sys, setup would start but laptop's keyboard and TouchPad aren't detected so it's unusable (maybe this may be only related to drivers because even on legacy mode, windows setup still doesn't detect laptop's keyboard and TouchPad). On os from install.wim, with FlashBoot + flashboot's built-in drivers + Canon Kong ACPI.sys, I received the 0x7B BSOD (in accessible boot device). I tried integrating drivers into boot.wim, install.wim using NTlite but still windows setup still hangs (even on legacy mode), while the os from install.wim has 0x7B on Uefi mode while on legacy mode during during the installation of drivers after "preparation for the first time" message, it halted telling me that installation cannot continue, I guess it is maybe because of improper drivers and improper driver configuration (I had added a lot of drivers on NTLite which may clashed with eachother, and majority of them were skipped, and some were missing because it couldn't find the file specified, in conclusion, the integration didn't work).
Originally posted by tkchia May 1, 2022
Hello @UsefulVideos,
Thanks for the information. By the way, at the moment biefircate
does not really boot anything yet, and it will likely be a few months at the very least before it does. So do not get your hopes up too soon.
Meanwhile:
On windows setup, with FlashBoot + flashboot's built-in drivers + Canon Kong ACPI.sys, setup would start but laptop's keyboard and TouchPad aren't detected so it's unusable (maybe this may be only related to drivers because even on legacy mode, windows setup still doesn't detect laptop's keyboard and TouchPad).
Perhaps you just need a little further push to get the setup working? One possibility is that your keyboard and mouse are connected (internally) to a USB xHCI controller, which Windows 7 did not yet know how to handle. According to superuser.com
(https://superuser.com/questions/1549499/windows-7-setup-cant-detect-my-keyboard-mouse), Gigabyte Technology Taiwan provides a "Windows USB Installation Tool" (https://www.gigabyte.com/Support/Utility?kw=Windows+USB+Installation+Tool), and this can be used to add USB xHCI drivers to a Windows 7 installer. I have not tried it myself, but perhaps it will work for you (if you have not already tried it).
Alternatively — you might also want to see if your PC's firmware setup menus have a "USB legacy emulation" option or some such. If your PC firmware supports this, then it should enable some voodoo magic to make your USB keyboard pretend (to Windows 7) to be an old-style PS/2 keyboard; and Windows 7 will hopefully know how to interact with this "keyboard".
Thank you!
Originally posted by tkchia May 1, 2022
Hello @UsefulVideos,
With Flashboot + Flashboot's built in added drivers + original unpatched ACPI.sys, it would give the ACPI A5 BSOD (Without Flashboot, it would display a red bar on top instead).
(This is probably going to be a tough one. Basically ACPI is a sort of mechanism by which your PC's firmware tells the OS — through a bunch of tables — how it should do power management, and also kind of informs the OS about the peripherals that the PC has. ACPI is present on newer UEFI systems and also on some of the later systems that support legacy BIOS booting. Unfortunately, the mechanism is extremely complicated and prone to bugs. Perhaps Windows 7 did not like what it read in the ACPI tables it received from your new PC. This will not be surprising.)
Thank you!
Originally posted by UsefulVideos May 19, 2022
Hello @UsefulVideos,
With Flashboot + Flashboot's built in added drivers + original unpatched ACPI.sys, it would give the ACPI A5 BSOD (Without Flashboot, it would display a red bar on top instead).
(This is probably going to be a tough one. Basically ACPI is a sort of mechanism by which your PC's firmware tells the OS — through a bunch of tables — how it should do power management, and also kind of informs the OS about the peripherals that the PC has. ACPI is present on newer UEFI systems and also on some of the later systems that support legacy BIOS booting. Unfortunately, the mechanism is extremely complicated and prone to bugs. Perhaps Windows 7 did not like what it read in the ACPI tables it received from your new PC. This will not be surprising.)
Thank you!
Actually it turns out that canonkong's patched windows 7 acpi.sys was broken because even on VirtualBox legacy boot, the setup would freeze.
If replace the acpi file with a different patched file on real hardware, UefiSeven works, the keyboard works but no cursor (I2C HID touchpad driver is needed).
Flashboot works on VirtualBox efi with mouse, but because of VBOX C0000 being present, I have to scroll or pause for the image to refresh because VirtualBox's VGA drivers interferes with Flashboot (on VMware surprisingly it works fine).
Since biefircate gives me the "no usable XGA/VGA option Rom?" error, I had attempted to make biefircate work with Uefiseven by renaming it to biefircate.efi and your tool to biefircate.original.efi, but Uefiseven complains about Biefircate not having a valid driver signature, perhaps you should try to add digital signature to biefircate.
The scope of this was to try to Uefiseven's Int10h handler as VGA Rom for Biefircate to work.
I had tried to separate FlashBoot's emulator from win 7 bootmgfw.efi by comparing the files using notepad++ but due to my lack of experience in hex code it didn't work.
The scope of that was to be able to extract the Flashboot emulator from the flashboot win7 efi and integrate it on any efi bootloader (biefircate, Vista 5384 boot loader/ efi version of xp ntldr etc) in order to use Flashboot's VGA emulator in any system.
Since I do not know how to do that very well, Uefiseven seems like an easier option since it relays on separate file but the beifircate boot loader file needs to have a valid signature otherwise Uefiseven will skip to the bootloader without applying the changes.
Originally posted by xrayer April 7, 2022
Hi, I tested the new build but paging works only partially. I can page a few screens at beginning but while it starts with PCI devices listing then paging doesn't work and it prints whole list at one time. Here's is it what I captured: https://ibb.co/NTNRQQd https://ibb.co/5BY9r9w https://ibb.co/8X90TB1
Originally posted by tkchia April 8, 2022
Hello @xrayer,
I made some improvements (https://github.com/tkchia/biefircate/commit/8c647e2d65493fee067489579e48e65347252be2), and put out a new compiled binary image (https://github.com/tkchia/biefircate/releases/download/20220407-slow-stepping/hd.img.zip). Let me know if the new binary works better for you.
As before, if you press S
early on startup, you can get the bootloader to pause and wait for a keystroke every now and then.
https://ibb.co/NTNRQQd https://ibb.co/5BY9r9w https://ibb.co/8X90TB1
This is interesting... So from the first screenshot, it seems that your system does have
- legacy option ROM image(s) for an Intel
8086:0406
graphics device (and possibly some other compatible devices), as well as - legacy option ROM(s) for an AMD
1002:67e8
graphics device.
From your second screenshot, your PC also has an nVidia 10de:25b8
graphics card — but this one has no corresponding legacy option ROM.
It seems that my earlier biefircate
code decided to glom onto the nVidia device, and use that. Perhaps this is why it failed. I have now tried to change the code, so that it will only try to enable VGA devices for which it can find an existing option ROM.
You mentioned that your PC has a 8086:9a60
device. If the option ROM image for 8086:0406
also happens to be compatible with 8086:9a60
(?), then perhaps my new code will now work a bit better.
Thank you!
Originally posted by xrayer April 8, 2022
Thanks, I will try. The laptop has 2 VGAs, primary intel integrated and secondary nVidia. There may be problem that you need some special code to switch video output from intel to nvidia otherwise the output may go to nowhere. The PCI ID 8086:0406 belongs to Haswell Integrated Graphics Controller, I have no idea why it is there. Maybe it is some legacy VGA block while 9a60 is legacy-less block.
Originally posted by xrayer April 12, 2022
I tried new build. PCI listing stepping works as expected so I was able to capture the whole printing but I didn't get any further... https://ibb.co/GPKrkRv https://ibb.co/DwkP4D6 https://ibb.co/cvrqRTq https://ibb.co/TqcJNVF https://ibb.co/NtjD2XG https://ibb.co/RcMWKfb
Originally posted by tkchia April 17, 2022
Hello @xrayer,
It seems that the option ROM image in your system's firmware is compatible with 8086:0406
and some devices in the range 8086:3e90
—3ea9
, but not compatible with the 8086:9a60
which your PC actually has. Unfortunately I am not quite sure (at the moment) how to get around this problem.
Since the 8086:9a60
device is marked in the PCI tables as a VGA device, presumably there is a method to switch it to a VGA-compatible mode, though for now I am not sure what that method might be.
Thank you!
Originally posted by xrayer April 20, 2022
Well, I'll try to find some intel datasheet of the chipset and look for VGA legacy config registers. It maybe similar to SATA block that supported IDE legacy mode in the past but later was removed (I think since 1xx or 2xx chipset family). So relying on VGA compatible HW would be only a temporal solution but for future would be better to rely on FB driver that should be always present.
Originally posted by tkchia May 3, 2022
Hello @xrayer,
So relying on VGA compatible HW would be only a temporal solution but for future would be better to rely on FB driver that should be always present.
I guess it should be possible to install a stub "option ROM" that only supports one screen mode — namely, whatever framebuffer mode might be active when we exit UEFI boot services.
Supporting or emulating other video modes — even the legacy CGA modes — will probably not be trivial. (It should probably be doable, though only after a lot of work.)
Thank you!
Originally posted by ssybesma March 5, 2023
tkchia, To me your work is very important because of the effort in the industry to do away with booting Legacy BIOS. As the old hardware dies out, old OSes are increasingly restricted to virtualization. Certain newer hardware that is much less capable both storage- and memory-wise can benefit from the ability to install an older OS. Do you have a Patreon for this? Also, are you saying that UEFI-only BIOSes with no Legacy/CSM boot option have option ROMs in them that are Legacy? I never knew that and that is interesting. Steve
Originally posted by tkchia March 5, 2023
Helo @ssybesma,
Also, are you saying that UEFI-only BIOSes with no Legacy/CSM boot option have option ROMs in them that are Legacy?
Probably not — the firmware on the machines I am testing on are not UEFI-only, they also allow for legacy BIOS booting. I am using the legacy VGA option ROMs for the time being as a way to ease development.
(UEFI firmwares apparently also have their own set of video drivers, but they work quite differently from legacy-style option ROMs, and I have not really figured out how. Also, they might not (directly) support the classical VGA screen resolutions and modes.)
Thank you!
Originally posted by ssybesma March 6, 2023
Thank you tkchia. So that really brings up the question. Will it ever be possible to boot DOS from a machine that has no Legacy boot option? I may have misread what your goal is with this project. I have a dozen 1st generation Intel Compute Sticks that are UEFI-only but have very little storage and memory and would be perfect for an OS that does not require UEFI if that were possible. Steve