Changing VESA resolution in Long/Pmode
-
- Member
- Posts: 153
- Joined: Sun Jan 07, 2007 9:40 am
- Contact:
Re: Changing VESA resolution in Long/Pmode
I'm just waiting for, say, around next Tuesday for a new thread entitled "Stupid bios modifies segment registers"
- gravaera
- 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
^^^
Nah. It'll come a little later than that. Right now I'm a bit hassled with Uni exams.
Nah. It'll come a little later than that. Right now I'm a bit hassled with Uni exams.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Re: Changing VESA resolution in Long/Pmode
Honestly just use an emulator or vm86 mode, it's much simpler.
-
- Member
- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
Re: Changing VESA resolution in Long/Pmode
If you emulate it, it won't really be able to change the video mode, right?
Re: Changing VESA resolution in Long/Pmode
Hi,
Cheers,
Brendan
You'd emulate the CPU while using the real video device...Craze Frog wrote:If you emulate it, it won't really be able to change the video mode, right?
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.
Re: Changing VESA resolution in Long/Pmode
AFAIK, if you pad it, and the add the 0x66 prefix, it should work.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
Please correct me if I'm wrong.
Re: Changing VESA resolution in Long/Pmode
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.
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
It's not fit for livin' in
-
- Member
- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
Re: Changing VESA resolution in Long/Pmode
No, they don't do the same thing. xor modifies eflags.mnovotny wrote: xor eax, eax
mov eax, 0
These two instructions do exactly the same, yet the first instruction is shorter.
Re: Changing VESA resolution in Long/Pmode
Bah, detail...
Keep the world with all its sin
It's not fit for livin' in
It's not fit for livin' in
Re: Changing VESA resolution in Long/Pmode
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.
- Combuster
- 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
Having segmentation or not, it won't work. Real mode segmentation != protected/compatibility mode segmentation.
Re: Changing VESA resolution in Long/Pmode
Edit: Scrap the idea, overall it's more trouble then it's worth really.
Reserved for OEM use.