Changing VESA resolution in Long/Pmode

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.
tantrikwizard
Member
Member
Posts: 153
Joined: Sun Jan 07, 2007 9:40 am
Contact:

Re: Changing VESA resolution in Long/Pmode

Post by tantrikwizard »

I'm just waiting for, say, around next Tuesday for a new thread entitled "Stupid bios modifies segment registers"
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Changing VESA resolution in Long/Pmode

Post by gravaera »

^^^

Nah. It'll come a little later than that. Right now I'm a bit hassled with Uni exams. :wink:
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Re: Changing VESA resolution in Long/Pmode

Post by iammisc »

Honestly just use an emulator or vm86 mode, it's much simpler.
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Changing VESA resolution in Long/Pmode

Post by Craze Frog »

If you emulate it, it won't really be able to change the video mode, right?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Changing VESA resolution in Long/Pmode

Post by Brendan »

Hi,
Craze Frog wrote:If you emulate it, it won't really be able to change the video mode, right?
You'd emulate the CPU while using the real video device...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
tharkun
Member
Member
Posts: 51
Joined: Sat Mar 21, 2009 1:29 pm
Location: Ireland

Re: Changing VESA resolution in Long/Pmode

Post by tharkun »

Velko wrote: By simply padding it with some NULL bytes here and there you can not turn it into working 32-bit code.

http://forum.osdev.org/viewtopic.php?t=10321
AFAIK, if you pad it, and the add the 0x66 prefix, it should work.
Please correct me if I'm wrong.
User avatar
mnovotny
Member
Member
Posts: 27
Joined: Mon Aug 10, 2009 2:54 am
Location: Slovakia

Re: Changing VESA resolution in Long/Pmode

Post by mnovotny »

You're wrong. The instructions aren't 32 bit in size while in 32 bit mode, nor they are 16 bit while in 16 bit mode.
Basic instructions usually have only one byte opcode and several other bytes of additional data. The size of instructions isn't fixed!

xor eax, eax
mov eax, 0

These two instructions do exactly the same, yet the first instruction is shorter.
Keep the world with all its sin
It's not fit for livin' in
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Changing VESA resolution in Long/Pmode

Post by Craze Frog »

mnovotny wrote: xor eax, eax
mov eax, 0

These two instructions do exactly the same, yet the first instruction is shorter.
No, they don't do the same thing. xor modifies eflags.
User avatar
mnovotny
Member
Member
Posts: 27
Joined: Mon Aug 10, 2009 2:54 am
Location: Slovakia

Re: Changing VESA resolution in Long/Pmode

Post by mnovotny »

Bah, detail... 8)
Keep the world with all its sin
It's not fit for livin' in
Cognition
Member
Member
Posts: 191
Joined: Tue Apr 15, 2008 6:37 pm
Location: Gotham, Batmanistan

Re: Changing VESA resolution in Long/Pmode

Post by Cognition »

Instruction sizes aside, segmentation will actually work properly in the compatibility sub mode of long mode. Fully translating or recompiling instructions shouldn't be necessary really as you can run in 16-bit protected mode with segmentation. Flat model segmentation only applies to code actually executing in 64-bit mode. It shouldn't be too hard emulate real mode segmentation via the GDT and setting up something resembling a virtual monitor to catch a few choice instructions and deal with the final IRET.
Reserved for OEM use.
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: Changing VESA resolution in Long/Pmode

Post by Combuster »

Having segmentation or not, it won't work. Real mode segmentation != protected/compatibility mode segmentation.
"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 ]
Cognition
Member
Member
Posts: 191
Joined: Tue Apr 15, 2008 6:37 pm
Location: Gotham, Batmanistan

Re: Changing VESA resolution in Long/Pmode

Post by Cognition »

Edit: Scrap the idea, overall it's more trouble then it's worth really.
Reserved for OEM use.
Post Reply