Page 1 of 1

vm86 vesa

Posted: Fri May 12, 2006 1:39 am
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.

Re:vm86 vesa

Posted: Fri May 12, 2006 7:29 am
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.

Re:vm86 vesa

Posted: Wed May 17, 2006 4:50 am
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().