32-bit protected mode in C, screen resolution 1920x1080+

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
roban100
Posts: 9
Joined: Wed Aug 07, 2013 10:05 am

32-bit protected mode in C, screen resolution 1920x1080+

Post by roban100 »

Hello!,

So I have recently been programming an operating system ( in C, 32-bit protected mode ).

And I have made a keyboard driver and some text printing, but now I would like to make
my operating system's resolution to go to 1920x1080+. I have no clue how to do it
since neither vesa or svesa is capable of doing such thing ( at least not on my computer )...
But still windows 7 can do it so there must be a way! :D

So I hope someone could give me a hint in the right direction ( if no more! ) :P.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by Antti »

This is one big problem in hobby OSs. If VBE does not give you that video mode, you need to write native video drivers. Easiest way to start is to support some well-documented video cards. It is impossible to support all of them.

As a hint: writing native drivers is not probably the right direction at this point.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by bluemoon »

If you really want to try 1920x1080, you can write driver for BGA(bochs VGA), I just verified you can pass 1920x1080 to set video mode and update screen using LFB without problem.

However, 1902x1080 without any kind of acceleration is plain stupid.
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by madanra »

What resolutions does VESA/VBE give you on your computer?
roban100
Posts: 9
Joined: Wed Aug 07, 2013 10:05 am

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by roban100 »

I think I will just use what I can get for now!

Thanks anyway ! :)
Someone256
Posts: 7
Joined: Sun Jul 14, 2013 8:58 pm

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by Someone256 »

Just like what the others said, write drivers for well documented VGA cards. But writing VGA drivers is complex and takes for ever. Also, what is the resolution for your monitor? Mine is 1366x768 (16:9) but I use 1600x1200 VBE mode and fill the visible area with my graphics.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by Combuster »

VGA drivers are easy. Dedicated Graphics drivers for pretty much any other video card is going to be quite the problem. :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
AbstractYouShudNow
Member
Member
Posts: 92
Joined: Tue Aug 14, 2012 8:51 am

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by AbstractYouShudNow »

If you have a graphics card of a well-known brand (nVidia, ATI, Matrox...), well you're stuck because these cards are undocumented (though I heard that ATI was now managed by AMD and the specifications were being opened, but don't know at all if it's true). The problem is that the Windows drivers are coded by the companies themselves (because otherwise, they couldn't sell their silicon) and are closed-source. So if you want to code a graphics driver for these cards, then you'll have a hard time doing that, if you succeed at all. So as an alternative, if VGA, VESA and all documented stuff doesn't give you what you want, I suggest that you consider supporting Intel and AMD graphics cards shipped with modern CPUs (which have reasonnably good resolutions).

I've planned to contact nVidia when I'll get to implementing my GUI to ask if there is documentation available (either for free or not), but I'm still very far from it so you can either do that yourself, or just wait ;)
User avatar
AndrewAPrice
Member
Member
Posts: 2303
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: 32-bit protected mode in C, screen resolution 1920x1080+

Post by AndrewAPrice »

AbstractYouShudNow wrote:I've planned to contact nVidia when I'll get to implementing my GUI to ask if there is documentation available (either for free or not), but I'm still very far from it so you can either do that yourself, or just wait ;)
Even with hardware documentation, they tend to be awfully complicated pieces of hardware.

If you're main focus is to build your own eco-system of graphical interfaces, APIs, etc. then perhaps it'd be worth building on top of the Linux or FreeBSD kernel, otherwise you're on your own.
My OS is Perception.
Post Reply