vm86 vesa

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
LongHorn

vm86 vesa

Post by LongHorn »

i am able to switch to graphics mode using int 0x10. If i have to switch to vesa mode, i need to traverse through vesa modes and find a best option available. Should i do everything in 16 bit assembly language. couldn't i use C language? However i seem to have an option. Copy the required details into buffer or to make a system call.
->could i write 16 bit c routine to traverse thru modes.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:vm86 vesa

Post by Solar »

LongHorn wrote: ->could i write 16 bit c routine to traverse thru modes.
Only with a select few compilers, GCC not being one of them.
Every good solution is obvious once you've found it.
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:vm86 vesa

Post by Pype.Clicker »

my suggestion would be to offer only a "limited" vm86 service that includes:
- invoking a given interrupt with a structure that tells what are the 'input' and 'output' values for the registers
- allocating memory (or mapping memory) at SEG:OFF in real-mode with a window to access it from pmode.

Using that service, you can very well code the modes crawling in pmode (in the language you find the most convenient). The disadvantage of bundling mode crawling would be that
1. you wouldn't have your debugging framework at hand
2. you would still have to do everything again if you want to do something else (such as retrieving display information or whatever) with VM86.
3. since you'll need to write more things in VM86, you'll probably need a set of OS services for VM86 mode ... with the suggested approach (which you can find implemented in the OsLib, The Mobius as well as in Clicker :P) the only 'service' you need to support is end_of_VM86_call().
Post Reply