Switch to Graphics mode in Protected 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.
Crazed1234

Re:Switch to Graphics mode in Protected mode

Post by Crazed1234 »

Very nice, but is there any chance of just using the protected mode interface? Anyone going to write a tut on that?

Sanik, how do we use your emulator in our kernels?
SANiK

Re:Switch to Graphics mode in Protected mode

Post by SANiK »

The emulator I released is buggy and crashes... so I want to rewrite it...
But basicly, you'll have to compile it, then jump to an address and execute it till a final IRET or RET is executed
Crazed1234

Re:Switch to Graphics mode in Protected mode

Post by Crazed1234 »

Hmmm... that's too bad.

Could somebody still get some work done on documenting the VESA 2 (at least) and 3 (possibly? Doesn't work under GRUB.) standards and the use of their protected mode interface once it's been obtained from BIOS or bootloader?
Therx

Re:Switch to Graphics mode in Protected mode

Post by Therx »

[rant]
Crazed1234: the whole point of OS development is that YOU get to do the research and find out / work out how YOU want to do things. There are already plenty of information sources on what you want. There's the interrupt list if you want VESA under real mode and I've seen information on BIOS32 which includes vesa support (IIRC) somewhere... And with the number of OSes around which support VESA, you could even look at that code to see how things work. If you want all the information and tutorials, choose another project...
[/rant]

Pete

(I don't have a problem with asking for information, but asking someone to "get some work done" on your behalf seems a bit unfair - why don't you help SANiK?)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Switch to Graphics mode in Protected mode

Post by Pype.Clicker »

if i can add my 2 cents, i guess we have virtually no support for Pmode interface to VBE because
- it's unclear that it worth the implementation since a few cards support it anyway
- it's unclear that the cards that claim to implement it implement it correctly, there are even rumours than most implementations are br0ken.
- it requires quite a bunch of coding, setting up extra segments in your GDT and things alike, which break the "flat" design for most of us
- none of the available emulators we have around here support the stuff.

Compared to those issues, a VM86 monitor works virtually everywhere (except in "long mode" on a x86-64. Too bad.)
oswizard

Re:Switch to Graphics mode in Protected mode

Post by oswizard »

"- it's unclear that the cards that claim to implement it implement it correctly, there are even rumours than most implementations are br0ken."

Yes... I tried to call the VBE3 extentions in my OS (AFAIK the only version with pmode entries) and I discovered the following:
- On Bochs, it is not supported at all
- On one of my computers, the bios returns (from 16-bit pmode) with a 32-bit _NEAR_ return instruction. Therefore a 32-bit pointer should have been pushed on the stack.
- On my other computer, the bios returns from 16-bit pmode with a 16-bit far return, thus expecting a 16-bit segment and offset from the stack.

I guess if the return address was 0x0000F000 or something, then the first one would return to <CS base>+0x0000F000 and the second would return to 0000:1000, and the appropriate return code could be located at each.

Overall though, it does not seem worth the effort. And not being supported in bochs is also a setback.

Mike
Crazed123

Re:Switch to Graphics mode in Protected mode

Post by Crazed123 »

Supposedly VESA2 supports a PMode interface, but making a VM86 monitor sounds all right.
GLneo

Re:Switch to Graphics mode in Protected mode

Post by GLneo »

just a question? is it just me or has any one gotten that origanal code to work ???

edit: never mind just forgot to refresh my double buffer :)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Switch to Graphics mode in Protected mode

Post by Pype.Clicker »

Crazed123 wrote: Supposedly VESA2 supports a PMode interface, but making a VM86 monitor sounds all right.
Indeed, you have a Pmode interface in VESA2, but that one is only useful for _windowed_ modes (e.g. if you're accessing your VRAM through 0xA0000..0xAFFFF and your screen has more than 64KB), or if you need the bios to reprogram the palette

As soon as you move to hicolor/truecolor mode with linear framebuffer, the pmode interface in VESA2 is simply useless.
SANiK

Re:Switch to Graphics mode in Protected mode

Post by SANiK »

Hmm, Pype, you hit a nail on the head there... If a translator for 16 to 32 bit is used, it still won't run in long mode. So I will need to go back to the interpretter core which I have 70% done already using C.

Well, proxy is interested in helping... anyone else?
We can use the source from the previous buggy one I wrote, but hopefully we can fix it up and add 16 bit/32 bit addressing support too which some interrupts rarely use.
Post Reply