flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
bzt 09 Jul 2021, 16:16
It's not simple. First, you need an UEFI ABI wrapper. With that, you can call UEFI services. Then you get a handle for the GOP Protocol. Using that handle, you query a list of supported video modes. You pick one, and you use it's "mode code" to call SetMode method of the GOP protocol. After that you'll have a standard framebuffer, same as with VESA.
Here's some code that queries the list of video modes, sorts that and returns info in an array. The array consists of 32 bytes entries, and one looks like this: Code: ; 8 bytes handle ; 8 bytes interface ; 2 bytes horizontal resolution ; 2 bytes vertical resolution ; 2 bytes scanline ; 2 bytes pixelformat ; 8 bytes mode number To figure out the framebuffer's address and size, get the second field in an entry, then do Code: mov rax, qword [gopinterface] mov rax, qword [rax + EFI_GRAPHICS_OUTPUT_PROTOCOL.Mode] mov rbx, qword [rax + EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.FrameBufferBase] As said, once you got the framebuffer's address, you can forget UEFI, and you can draw on that by simply using mov. Each line contains "scanline" bytes, so to draw in the 3rd row on screen for example, add 3 * scanline to the framebuffer's address. Cheers, bzt |
|||
![]() |
|
dunkaist 15 Jul 2021, 20:03
You can take a look at uefi4kos -- a UEFI loader for KolibriOS.
It has both 32-bit and 64-bit versions, and it sets a video mode via GOP before jumping to the kernel. It also uses a set of UEFI headers which are based on work by bzt. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.