-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add links to resources about drawing on the screen #436
Comments
By drawing on the screen, I mean like individual pixels and shapes, not VGA. |
The VGA text buffer is relatively special by working on characters instead of pixels. A normal framebuffer operates on individual pixels and this mode is supported by VGA too. Personally I only used the text buffer, so I can't give you good links. But the VGA Hardware page of the OSDev wiki looks useful to learn about the different VGA modes. Also, you could look at how the Redox project does it. For the blog, I plan to eventually switch to using a framebuffer instead of text mode eventually, because the text mode is not supported for UEFI booting. See #349 (comment). |
@phil-opp Thanks! Do operating systems like Apple, Windows, etc. use a VGA framebuffer or do they do something different? |
@nebrelbug real OSs tend to have specialised support for the graphics chipset or discrete graphics card, but it’s difficult and a huge time investment to develop drivers for them |
Cool! Well, I'll work on figuring them out and maybe someday I'll write a tutorial and make a pull request :) |
@nebrelbug Cool, good luck! A tutorial on this topic would be great! |
@phil-opp just from the limited research I've done, it looks like it'd be way easier to do with a UEFI kernel set up first, since VESA and VBE (I think?) only work with 16-bit code? I'm going to see if I can get a UEFI kernel running. |
Cool! Maybe #349 (comment) and #349 (comment) help. |
Actually, a memory mapped VGA text buffer is so much beginner-friendly. Meaning, there is no need explaining the Bresenheim's algorithm (one for drawing the line and another variation for the arc) and other CG (Computer Graphics) entry level stuff. @phil-opp , any chance you would not deprecate its description completely? |
The plan is to use a bitmap font, so we wouldn't need to do any rasterization. That said, there aren't any concrete plans yet, so if it turns out to be too complicated I will think of a different solution (maybe keep the text buffer post and insert an additional framebuffer post). |
@phil-opp any updates on using a framebuffer? |
@nebrelbug I'm looking into it right now. I was already able to configure the vga hardware to use a 640x480 pixel buffer and output some pixels to the screen. Now I'm working on making this a cargo feature of the bootloader. |
@nebrelbug I added initial support for a small 320x200 VGA framebuffer to the bootloader in rust-osdev/bootloader#35. |
Have there been any updates to this? I was curious about adding graphics to my fork and I wasn't sure if the bootimage crate in the tutorial would support this and if not, how I would go about adding it. |
I'm following through the tutorials and have started modifying and adding my own features. One thing that I can't find at all on the web, though, is how to display graphics on the screen. Do you write to a specific memory location, or use an I/O port? Are there OpenGL libraries that work on baremetal or that we could make work? I'd love to see some links to good resources on that topic.
The text was updated successfully, but these errors were encountered: