uefi error unsupported when opening graphics output protocol
uefi error unsupported when opening graphics output protocol
Konichiwa, my OS dev friends.
<meme>
I am once again asking for your electoral developmental support.
</meme>
Anyway, I've been working on my bootloader. There's a few bugs I need to fix before I can get it booting on real/random hardware. I've fixed majority of them, including a weird serial port dependency bug, a related memory map bug, and an ISO imaging bug.
With all this working, I've decided to test my OS again. It "boots". It'll launch the UEFI app, and stay there. However, there's a graphical bug that really hinders everything. It'll just not open the Graphics Output Protocol. I get an EFI_UNSUPPORTED error. I don't know if it's an error in my code, or a problem with my machine. Either way, it's a critical bug for me if it means I have no way of testing my hopes and dreams. Anyway, I read somewhere that GOP was newer. My machine is relatively older for a UEFI machine (2012). Does my machine just not support GOP?
Supporting information:
--Bootloader Source--
https://github.com/microNET-OS/microCOR ... bootloader
--My Machine--
Model: HP Compaq Elite 8300 CMT (with some storage, ram, and graphics upgrades)
CPU: Intel Core i5-3470 (2012, Ivy Bridge, DDR3-era, Intel HD Graphics 2500)
BIOS: American Megatrends K01 v3.03 (HP version) [version that comes out-of-the-box with my computer is v2.02]
Year: 2012
Chipset: Intel Q77 Express
Misc: contains a serial port
<meme>
I am once again asking for your electoral developmental support.
</meme>
Anyway, I've been working on my bootloader. There's a few bugs I need to fix before I can get it booting on real/random hardware. I've fixed majority of them, including a weird serial port dependency bug, a related memory map bug, and an ISO imaging bug.
With all this working, I've decided to test my OS again. It "boots". It'll launch the UEFI app, and stay there. However, there's a graphical bug that really hinders everything. It'll just not open the Graphics Output Protocol. I get an EFI_UNSUPPORTED error. I don't know if it's an error in my code, or a problem with my machine. Either way, it's a critical bug for me if it means I have no way of testing my hopes and dreams. Anyway, I read somewhere that GOP was newer. My machine is relatively older for a UEFI machine (2012). Does my machine just not support GOP?
Supporting information:
--Bootloader Source--
https://github.com/microNET-OS/microCOR ... bootloader
--My Machine--
Model: HP Compaq Elite 8300 CMT (with some storage, ram, and graphics upgrades)
CPU: Intel Core i5-3470 (2012, Ivy Bridge, DDR3-era, Intel HD Graphics 2500)
BIOS: American Megatrends K01 v3.03 (HP version) [version that comes out-of-the-box with my computer is v2.02]
Year: 2012
Chipset: Intel Q77 Express
Misc: contains a serial port
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: uefi error unsupported when opening graphics output prot
How old is your machine? It might not support GOP and use UGA instead. I think one of my machines has that problem.
Re: uefi error unsupported when opening graphics output prot
nexos wrote:How old is your machine? It might not support GOP and use UGA instead. I think one of my machines has that problem.
8 years old...rizxt wrote:2012
I restated the age of my computer a few times ffs
Also I didn't specify the graphics card I used. My graphics card is a nVidia GTX 1050 Ti, so I don't think I have problems there, as it came out in 2017.
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: uefi error unsupported when opening graphics output prot
try this code:
sorry, I don't use neither gcc nor gnuefi, so you need to translate into that. this function does fill interface pointer for GOP or returns EFI_NOT_FOUND if there is nothing to fill. gEfiGopGuid is the GOP GUID, gGop is a pointer to GOP interface (out parameter).
Code: Select all
/* locating GOP. if we have it, we draw boot screen there */
Status = pbs->LocateProtocol(&gEfiGopGuid, NULL, &gGop);
if(Status != EFI_SUCCESS)gGop = NULL;
Re: uefi error unsupported when opening graphics output prot
that still doesn't help because if I don't have a functioning GOP I can't do jack ****. ofc there is the serial port but my pc is the only pc in the house with a serial port.zaval wrote:try this code:sorry, I don't use neither gcc nor gnuefi, so you need to translate into that. this function does fill interface pointer for GOP or returns EFI_NOT_FOUND if there is nothing to fill. gEfiGopGuid is the GOP GUID, gGop is a pointer to GOP interface (out parameter).Code: Select all
/* locating GOP. if we have it, we draw boot screen there */ Status = pbs->LocateProtocol(&gEfiGopGuid, NULL, &gGop); if(Status != EFI_SUCCESS)gGop = NULL;
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: uefi error unsupported when opening graphics output prot
well, if your FW doesn't have GOP, it won't appear magically. there is also ConOut (a combo, collecting SIMPLE_TEXT_OUTPUT_PROTOCOL to various output devices), I don't know why you ignore it and my note about it in yet another thread of yours about UEFI. try using it, it's easier, than GOP, just printing letters onto diplay, my 2011 HP laptop with UEFI does support it fine.rizxt wrote:that still doesn't help because if I don't have a functioning GOP I can't do jack ****. ofc there is the serial port but my pc is the only pc in the house with a serial port.zaval wrote:try this code:sorry, I don't use neither gcc nor gnuefi, so you need to translate into that. this function does fill interface pointer for GOP or returns EFI_NOT_FOUND if there is nothing to fill. gEfiGopGuid is the GOP GUID, gGop is a pointer to GOP interface (out parameter).Code: Select all
/* locating GOP. if we have it, we draw boot screen there */ Status = pbs->LocateProtocol(&gEfiGopGuid, NULL, &gGop); if(Status != EFI_SUCCESS)gGop = NULL;
Code: Select all
pout = pSystemTable->ConOut;
// ... and then
pout->OutputString(pout, L"lalalalala");
Re: uefi error unsupported when opening graphics output prot
There is one big problem with that, and I'll let you try to figure that one out.zaval wrote:well, if your FW doesn't have GOP, it won't appear magically. there is also ConOut (a combo, collecting SIMPLE_TEXT_OUTPUT_PROTOCOL to various output devices), I don't know why you ignore it and my note about it in yet another thread of yours about UEFI. try using it, it's easier, than GOP, just printing letters onto diplay, my 2011 HP laptop with UEFI does support it fine.rizxt wrote:that still doesn't help because if I don't have a functioning GOP I can't do jack ****. ofc there is the serial port but my pc is the only pc in the house with a serial port.zaval wrote:try this code:sorry, I don't use neither gcc nor gnuefi, so you need to translate into that. this function does fill interface pointer for GOP or returns EFI_NOT_FOUND if there is nothing to fill. gEfiGopGuid is the GOP GUID, gGop is a pointer to GOP interface (out parameter).Code: Select all
/* locating GOP. if we have it, we draw boot screen there */ Status = pbs->LocateProtocol(&gEfiGopGuid, NULL, &gGop); if(Status != EFI_SUCCESS)gGop = NULL;
I mean, ConOut will print to all detected output devices, not only to serial port. you definitely should see your print with it on the screen (if you have done all correctly), because FW definitely will attach this to the display. in fact, you can both OutputString() and BitBlt() to the display (if that's a good idea ).Code: Select all
pout = pSystemTable->ConOut; // ... and then pout->OutputString(pout, L"lalalalala");
(hint: exitbootservices/kernel)
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: uefi error unsupported when opening graphics output prot
you cannot use Boot Services and any protocols after that. you should check for GOP before, take its framebuffer paramateres, if it's present and use them after ExitBootServices(). if your system happened to not have GOP, then
\_(-.-)_/ but, it looks like there is something wrong with your approaches. did you at least check for the GOP presence as in the above example?
\_(-.-)_/ but, it looks like there is something wrong with your approaches. did you at least check for the GOP presence as in the above example?
Re: uefi error unsupported when opening graphics output prot
I need to use GOP or alternative protocols that work after the boot services bite the dust.zaval wrote:you cannot use Boot Services and any protocols after that. you should check for GOP before, take its framebuffer paramateres, if it's present and use them after ExitBootServices(). if your system happened to not have GOP, then
\_(-.-)_/ but, it looks like there is something wrong with your approaches. did you at least check for the GOP presence as in the above example?
As a side note, I've been attempting to update my BIOS in hopes that it works. (K01 3.03 -> K01 3.08)
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
-
- Member
- Posts: 5568
- Joined: Mon Mar 25, 2013 7:01 pm
Re: uefi error unsupported when opening graphics output prot
You can use GOP before ExitBootServices() to find the frame buffer.
You can use the frame buffer after ExitBootServices(), but you'll have to provide your own font in order to display text. You can find more information here.
You can use the frame buffer after ExitBootServices(), but you'll have to provide your own font in order to display text. You can find more information here.
Re: uefi error unsupported when opening graphics output prot
rixzt, you seem to not understand, that all these things (text I/O prtocols, serial protocol, GOP and actually all protocols) are for the OS Loader and not for the OS. the concept is that after you call ExitBootServices() the FW doesn't own the system anymore and except Runtime Services isn't accessible. for the early stages of the OS initialization, there is video framebuffer, about which you get to know from GOP functions/fields. after your OSL owns the system, you can draw in that framebuffer by yourself. if your computer has diplay and is UEFI compliant (most probably), then it does have GOP. so get it through LocateProtocol() and take the needed information (metrics, address, pixels per scanline). then draw to it. if you cannot get GOP (improbably), then you are unlucky with this machine, try emulators.
Re: uefi error unsupported when opening graphics output prot
There are no alternatives. It is a mandatory protocol for UEFI, it must be supported (so no alternatives exist). If you don't have GOP, that could only mean you have EFI 1.x (and not UEFI), for which only UGA exists.rizxt wrote:I need to use GOP or alternative protocols that work after the boot services bite the dust.
You can use UGA to set the resolution, but sadly it does not return the frame buffer's address like GOP does, so it sucks big time. You could use UGADraw's blit before ExitBootServices to store some magic bytes on the screen, then iterate on the GetMemoryMap list and match those magic bytes to figure out which memory entry record corresponds to the frame buffer. GRUB for example parses the PCI bus to find the display device and then it reads the PCI BARs to get the frame buffer's address.
Upgrading from EFI to UEFI would definitely solve your issue of missing GOP. But K01 3.03 -> K01 3.08 doesn't sounds like a major upgrade.rizxt wrote:As a side note, I've been attempting to update my BIOS in hopes that it works. (K01 3.03 -> K01 3.08)
Cheers,
bzt
Re: uefi error unsupported when opening graphics output prot
I know this. However you seem to know nothing about this at all. If you actually used UEFI at all, you must know that I know for a fact that you can use the GOP framebuffer after you exit boot services. It's undeniable. Cold hard evidence.zaval wrote:rixzt, you seem to not understand, that all these things (text I/O prtocols, serial protocol, GOP and actually all protocols) are for the OS Loader and not for the OS. the concept is that after you call ExitBootServices() the FW doesn't own the system anymore and except Runtime Services isn't accessible. for the early stages of the OS initialization, there is video framebuffer, about which you get to know from GOP functions/fields. after your OSL owns the system, you can draw in that framebuffer by yourself. if your computer has diplay and is UEFI compliant (most probably), then it does have GOP. so get it through LocateProtocol() and take the needed information (metrics, address, pixels per scanline). then draw to it. if you cannot get GOP (improbably), then you are unlucky with this machine, try emulators.
How can someone so unqualified say that I seem to "not understand"?
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: uefi error unsupported when opening graphics output prot
uhm, excuse me, can you read? then read yet once this:
or any other response from several ones from other people, saying to you the same. no more responses from me. because of your clowning.for the early stages of the OS initialization, there is video framebuffer, about which you get to know from GOP functions/fields. after your OSL owns the system, you can draw in that framebuffer by yourself.
Re: uefi error unsupported when opening graphics output prot
@zaval: How would UEFI prevent you from drawing to the framebuffer before ExitBootServices? It has no way of doing so! The OSL is running in kernel mode. It can draw to the framebuffer.