Page 1 of 1
Is there any reference to use EFI UGA.
Posted: Sun Sep 18, 2022 3:11 pm
by devc1
UGA (EFI Universal Graphics Adapter) is from the past and replaced by GOP. Unluckily my laptop is soo old that it has the first versions of UEFI and does only support UGA, so to try my OS on it, instead of just rebooting my current PC I had to create a whole FAT32 Driver and a whoole Legacy BIOS Bootloader that I work with now, it was a big pause on the OS however I am sure that I am not launching it with Legacy BIOS Support.
Creating the FAT32 DLL that works on every OS had alot of benefits, one of them is that now I have a ready driver after supporting mass storage devices, the second is that I no longer rely on Linux tools.
Has anyone any references on the UGA_IO_PROTOCOL or something like that, I am talking about using it after ExitBootServices() ?
Does anyone have a knowledge on how to use UGA after exiting boot services ?
Cheers,
Re: Is there any reference to use EFI UGA.
Posted: Sun Sep 18, 2022 5:00 pm
by Octocontrabass
devc1 wrote:Unluckily my laptop is soo old that it has the first versions of UEFI and does only support UGA,
How did you confirm this? UGA is very rare.
devc1 wrote:I had to create a whole FAT32 Driver and a whoole Legacy BIOS Bootloader that I work with now, it was a big pause on the OS however I am sure that I am not launching it with Legacy BIOS Support.
Why did you have to create a legacy BIOS bootloader?
devc1 wrote:Has anyone any references on the UGA_IO_PROTOCOL or something like that, I am talking about using it after ExitBootServices() ?
Does anyone have a knowledge on how to use UGA after exiting boot services ?
You write an EFI virtual machine and load the UGA driver inside it. (How do you get the UGA driver? Good question, I have no idea how it's supposed to work. Maybe you grab a copy of the option ROM using EFI_PCI_IO_PROTOCOL?)
Re: Is there any reference to use EFI UGA.
Posted: Mon Sep 19, 2022 6:08 am
by devc1
Old laptop : HP 620
- How did I confirm that : When enabling UEFI on the BIOS it says a warning message like : UEFI is only in the early developement, it is not recommended to enable this boot mode. I enumerate G.O.P and it shows the resolution but frame buffer address is 0, Blt() functions does not work but it does on UGA. So it is UGA Compatible only.
- Why did I had to create a whole Legacy BIOS Bootloader : to test it on that UGA laptop, and fix problems in real hardware, I can't just keep rebooting my PC which has an HDD meaning that it will take minutes.
- How to create this virtual machine, I never used VMX, someone in stackoverflow has previously told me to copy the protocol in the ROM or something, How do I do that ? I guess you looked up that post and came up with this answer
Re: Is there any reference to use EFI UGA.
Posted: Mon Sep 19, 2022 11:22 am
by Octocontrabass
devc1 wrote:I enumerate G.O.P and it shows the resolution but frame buffer address is 0, Blt() functions does not work but it does on UGA.
Did you try setting the video mode? There are some GOP implementations that won't report complete information until after a mode set is performed.
devc1 wrote:How to create this virtual machine,
Write enough of an EFI implementation to call an EFI driver.
devc1 wrote:I never used VMX,
You don't need hardware virtualization.
devc1 wrote:someone in stackoverflow has previously told me to copy the protocol in the ROM or something, How do I do that ?
Search the configuration table for entries with EFI_UGA_IO_PROTOCOL_GUID. Each of these entries points to a EFI_DRIVER_OS_HANDOFF_HEADER that points to a copy of the PCI option ROM and the device path for the display adapter. There may be multiple option ROMs, including option ROMs for devices that are supported by the firmware but not physically present. You will need to determine which ROM(s) apply to your hardware - the device path should help.
Once you have the appropriate option ROM, load the PE executables into your EFI virtual machine and tell your EFI virtual machine to call their entry points. One of them should register the EFI_UGA_IO_PROTOCOL handle that you can use to access the display adapter. Tell your EFI virtual machine to call the functions in the EFI_UGA_IO_PROTOCOL to access the display adapter.
devc1 wrote:I guess you looked up that post and came up with this answer
No, I've been reading the EFI and UGA specifications.
Re: Is there any reference to use EFI UGA.
Posted: Mon Sep 19, 2022 11:52 am
by devc1
What virtual machine ! I don't know anything about it ? you got me confused, copy to EFI VM , call EFI VM ? What do you mean by write enough of an EFI implementation ? How I'm gonna create that VM ! I only read specs when I'm on vacations but now I cannot read the whole EFI Spec, However I can complement you as the best in this forum : ) ! Thanks for your help. I am still alone on this OS so,
Devc1,
Re: Is there any reference to use EFI UGA.
Posted: Mon Sep 19, 2022 12:20 pm
by Octocontrabass
devc1 wrote:What virtual machine ! I don't know anything about it ?
A virtual machine is a program that runs another program. To use UGA in your OS, you need to write a program that can run the UGA driver program.
You might find it helpful to research how emulators and virtual machines work.
devc1 wrote:you got me confused, copy to EFI VM , call EFI VM ?
Just like how your OS will load programs into userspace to run them, your EFI virtual machine will load the UGA driver to run it. Other parts of your OS will need to communicate with your EFI virtual machine in order to call the UGA driver functions.
devc1 wrote:What do you mean by write enough of an EFI implementation ?
The UGA driver uses protocols like EFI_PCI_IO_PROTOCOL to access the hardware. You need to provide these protocols somehow in your EFI virtual machine.
devc1 wrote:I only read specs when I'm on vacations but now I cannot read the whole EFI Spec
You don't need to read the whole EFI specification, but you will need to read some parts of it.
Re: Is there any reference to use EFI UGA.
Posted: Mon Sep 19, 2022 12:27 pm
by devc1
This seems so complicated, I will keep it to some day when I am done with the essential things in the OS. Thanks,