Changing gfx mode

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
mr. x2

Changing gfx mode

Post by mr. x2 »

My kernel is running in pmode and it's using x86.
Can someone post a code snippet that will change this graphics mode, for me to study? I would have to switch over to unreal mode first huh? I would like to have it all, the code which switches to unreal mode, then setting the graphics mode, and then switching back to pmode. I prefer C or AT&T/Intel syntax asm.
Will this kind of code work with VESA, VGA, SVGA -modes too?
DennisCGc

Re:Changing gfx mode

Post by DennisCGc »

Depends what mode..
If you change to 320x200x256 or 640x480x16 you can change it when in p.mode.
To know how see this
To use VESA modes, you can either choose to return to r.mode (or unreal mode) to change it, or you can make it only for VESA 3.0 and you should initialize it before p. mode, (to get the pmode entry) and with that entry you can switch to a resolution without switching to r. mode.
Or you can do all this before switching to p. mode.
mr. x2

Re:Changing gfx mode

Post by mr. x2 »

I know I can do it like that, and thus, that's not my question! :P
But thanks for the link.
I want to set the mode when the kernel is running, and I want to switch to real mode and back.

PS: What's happened to osdever.net?
Tim

Re:Changing gfx mode

Post by Tim »

mr. x2 wrote: I know I can do it like that, and thus, that's not my question! :P
But thanks for the link.
I want to set the mode when the kernel is running, and I want to switch to real mode and back.
No, you don't want to switch back to real mode. For standard VGA modes, switch by programming the registers (see Dennis's link). For SuperVGA modes, write a V86 monitor and use VESA. You shouldn't ever need to switch back to real mode.
PS: What's happened to osdever.net?
The server suffered some sort of failure, and they didn't have any backup.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Changing gfx mode

Post by bubach »

are all there php pages and articles gone!?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
ineo

Re:Changing gfx mode

Post by ineo »

Tim Robinson wrote:
PS: What's happened to osdever.net?
The server suffered some sort of failure, and they didn't have any backup.
The previous server is still working:
http://www.osdev.neopages.net/tutorials.php?cat=0&sort=1

God save the web :)
INeo

PS: The homepage redirects to the broken server... use the tabs to navigate.
DennisCGc

Re:Changing gfx mode

Post by DennisCGc »

Will this kind of code work with VESA, VGA, SVGA -modes too?
No ? ::)
ASHLEY4

Re:Changing gfx mode

Post by ASHLEY4 »

I think its simpler to switch to unreal mode, Then making a v86 monitor, If all you want yo do is switch modes, You can do it with a few lines of code if you set some var at boot up and do not use paging.

ASHLEY4.
Post Reply