OS graphics help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Barry
Member
Member
Posts: 54
Joined: Mon Aug 27, 2018 12:50 pm

OS graphics help

Post by Barry »

I am writing a simple OS in C and would like the function early on in development to display graphics.
I am fairly new to OS development but understand quite a bit.
I currently have a text mode OS with a kernel being booted by GRUB2.

The resolution is very low at the moment and not suitable for my needs.

How do I make it display at 1280x720 (probably from GRUB)?
And how do I set each pixel on the screen?

I have read other forum posts and been unable to get anything to work, so help would be appreciated.

My grub.cfg has the bare minimum of just a menuentry and the multiboot command linking to my kernel.

And before people comment saying not to make a GUI first and do other things like a network stack, or program loading, my OS is being designed for a specific purpose, no as a general use OS.
User avatar
Ender
Posts: 24
Joined: Thu Jul 19, 2018 9:40 pm

Re: OS graphics help

Post by Ender »

Forget the network stack, you still, at the very least, need physical memory management, and you probably wanna set up the GDT and IDT.

Anyway, maybe check out this post viewtopic.php?f=2&t=30186 (https://wiki.osdev.org/User:Omarrx024/VESA_Tutorial on the wiki), https://wiki.osdev.org/Drawing_In_Protected_Mode, https://wiki.osdev.org/Double_Buffering, and https://wiki.osdev.org/VESA_Video_Modes.

Also you are in the wrong section for this.
Barry
Member
Member
Posts: 54
Joined: Mon Aug 27, 2018 12:50 pm

Re: OS graphics help

Post by Barry »

Thanks for the reply.

Is there a simple quick way to put the OS into a higher resolution, i know grub can do it, but i can't get it working and i would like to focus on that bit of it for now, before other things, like memory management, or drawing to the screen?

i have had no luck with:

Code: Select all

set gfxmode=1280x720x32
or anything like that so far
User avatar
Ender
Posts: 24
Joined: Thu Jul 19, 2018 9:40 pm

Re: OS graphics help

Post by Ender »

Harri45 wrote:Thanks for the reply.

Is there a simple quick way to put the OS into a higher resolution, i know grub can do it, but i can't get it working and i would like to focus on that bit of it for now, before other things, like memory management, or drawing to the screen?

i have had no luck with:

Code: Select all

set gfxmode=1280x720x32
or anything like that so far
gfxmode apparently only changes GRUB's graphics mode, you probably want gfxpayload. You may also set gfxpayload to 'keep' in order for gfxpayload to mirror the value of gfxmode.
You will need to get to memory management soon though.
Barry
Member
Member
Posts: 54
Joined: Mon Aug 27, 2018 12:50 pm

Re: OS graphics help

Post by Barry »

not even gfxmode is working... how does it work?
User avatar
Ender
Posts: 24
Joined: Thu Jul 19, 2018 9:40 pm

Re: OS graphics help

Post by Ender »

Harri45 wrote:not even gfxmode is working... how does it work?
https://wiki.sabayon.org/index.php?titl ... with_GRUB2
viewtopic.php?t=31933&p=275703
Barry
Member
Member
Posts: 54
Joined: Mon Aug 27, 2018 12:50 pm

Re: OS graphics help

Post by Barry »

thanks, super useful.
Post Reply