Page 1 of 1

Graphic modes

Posted: Mon May 22, 2023 10:33 am
by pgr
I'm playing with Rust to learn OS development basics. I was able to progress up to drawing graphics via UEFI GOP (through the uefi crate).
I'm planning to make basic window manager, maybe something slightly more advanced. Nothing serious, just curious of the OS internals.

What are my limitations when using this mode? What are the "upgrades" (in terms of image quality and other improvements) of this mode? How hard would it be to implement them? Are there good crates?

Re: Graphic modes

Posted: Wed May 31, 2023 11:34 am
by Octocontrabass
pgr wrote:What are my limitations when using this mode?
I don't know what you mean by "mode" but the limitation of UEFI GOP is that it's a boot service. It's only capable of very basic operations, and you can't call it after you exit boot services. (If you ask it for a pointer to the framebuffer before you exit boot services, that pointer is still valid afterwards.) Fortunately, the framebuffer it gives you is nice enough that you can use it to display pretty much whatever you want, as long as you do all of the hard rendering work on the CPU.
pgr wrote:What are the "upgrades" (in terms of image quality and other improvements) of this mode?
Aside from maybe selecting your display's native resolution, there's nothing you can do with GOP to improve the image quality. If you want nice features like hardware acceleration, you'll need to write a driver. Possibly more than one driver, if you want your OS to work well on more than one PC.
pgr wrote:How hard would it be to implement them?
Pretty difficult. At least if you're targeting an Intel display adapter, most of those have pretty complete documentation.
pgr wrote:Are there good crates?
Any crate that can help you plot pixels in a bitmap will work with the bitmap framebuffer provided by GOP. You're probably on your own when it comes to writing drivers, though.