GOP: Difference between revisions

Jump to navigation Jump to search
m
Fix minor grammar issues
[unchecked revision][unchecked revision]
No edit summary
m (Fix minor grammar issues)
Line 4:
It has basically the same functions as VESA, you can query the modes, set the modes. It also provides an efficient BitBlitter function, which you can't use from your OS unfortunately. GOP is an EFI Boot Time Service, meaning you can't access it after you call ExitBootServices(). However, the framebuffer provided by GOP persists, so you can continue to use it for graphics output in your OS.
 
NOTE: UEFI uses it'sits own ABI. You can either configure your build environment to use that globally, or you must use a wrapper function. These examples use the latter for compatibility reasons. Omit uefi_call_wrapper if you have configured your build system for the former. See [[GNU-EFI]] for more information.
 
=== Detecting GOP ===
Line 16:
PrintLn(L"Unable to locate GOP");
</source>
GOP is the default protocol, so you should be able to locate it on all UEFI firmware. It can probably only fail if you're on an old EFI (pre-UEFI) machine, like and old iMac or intelIntel MacbookMacBook perhaps.
 
=== Get the Current Mode ===
Line 68:
}
</source>
To get the same value as scanline in VESA (also called commonly called pitch in many graphics libraries), you have to multiply PixelsPerScanLine by the number of bytes per pixel. That can be detected by examining the gop->Mode->Info->PixelFormat field. For example with 32 bit packed pixel formats,
<source lang="c">
pitch = 4 * gop->Mode->Info->PixelsPerScanLine;
8

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu