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.
Im implementing a simple qui and using vesa. I set my video mode in my second stage loader and I want to store WinFuncPtr pointer, which holds a pointer to switch bank in protected mode part. But I couldnt manage to do it. I have some problems with pointers I think. Here is what Im doing:
Hi,
Are you in protected mode? If you are in protected mode, you can't call the bank switching function like that.
WinFuncPtr is a real mode pointer if you want to use it in pmode, then you will have to get the vbe protected mode entry point.If you want to start with simple stuff use the linear frame buffer instead by using (0x4000+mode_number) to set a mode. Then the address pointed to by PhysBasePtr is the 32bit physical address for the frame buffer. writing data into this address will cause pixels to be displayed. If you are using paging,then PhysBasePtr has to be mapped to a virtual address and the virtual address used instead.Get vbe3.pdf - http://www.vesa.org/vbe3.pdf , it will help you alot.
A way to use a real mode far pointer in pmode DOES exist... You can use this ptr in a 16 bit segment selector with base 0xC0000... i tried this on three nvidia and one cirrus logic card and WinFuncPtr does work... I haven't seen ( or programmed ) any vesa card that use segments ( ds , es , cs , ss ... etc ) in WinFuncPtr direct implementation, of course I'm only talking about VESA here, for other things, this will not work...
...Engin...
The problem is that the code at WinFuncPtr expects to be running in real mode, and there's nothing which says it can't attempt to load real-mode segment values into the segment registers and use them. Since it's running in 16-bit pmode at best, it's not allowed to do that.
However, 16-bit and 32-bit protected mode VESA entry points do exist. As always -- read the PDF!