OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 1:51 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: OS graphics help
PostPosted: Mon Aug 27, 2018 1:22 pm 
Offline
Member
Member

Joined: Mon Aug 27, 2018 12:50 pm
Posts: 54
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.


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:09 pm 
Offline
User avatar

Joined: Thu Jul 19, 2018 9:40 pm
Posts: 24
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.


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:20 pm 
Offline
Member
Member

Joined: Mon Aug 27, 2018 12:50 pm
Posts: 54
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:
set gfxmode=1280x720x32

or anything like that so far


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:27 pm 
Offline
User avatar

Joined: Thu Jul 19, 2018 9:40 pm
Posts: 24
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:
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.


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:29 pm 
Offline
Member
Member

Joined: Mon Aug 27, 2018 12:50 pm
Posts: 54
not even gfxmode is working... how does it work?


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:35 pm 
Offline
User avatar

Joined: Thu Jul 19, 2018 9:40 pm
Posts: 24
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


Top
 Profile  
 
 Post subject: Re: OS graphics help
PostPosted: Mon Aug 27, 2018 2:41 pm 
Offline
Member
Member

Joined: Mon Aug 27, 2018 12:50 pm
Posts: 54
thanks, super useful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 217 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group