Vesa issue.
Posted: Sat Apr 21, 2007 7:25 pm
I am having a problem getting the physical pointer for the LFB.
I am using the following code in 16bit realmode, but after I enable the a20:
The X and Y resolutions come back right... but the PhysBasePtr is printed as 0. The mode I am passing is 0x4101 so I am telling it to you LFB.
This is a head scratcher... Ive wasted a couple of hours tweaking and googling and coming up empty handed.
Thanks in advance,
Rich
I am using the following code in 16bit realmode, but after I enable the a20:
Code: Select all
unsigned long getLFB(int mode)
{
union REGS in,out;
struct SREGS segs;
char far *modeInfo = (char far *)&ModeInfoBlock;
if (mode < 0x100) return 0; /* Ignore non-VBE modes */
in.x.ax = 0x4F01;
in.x.cx = mode;
in.x.di = FP_OFF(modeInfo);
segs.es = FP_SEG(modeInfo);
int86x(0x10, &in, &out, &segs);
if (out.x.ax != 0x4F) return -1;
printf("Res X: %u\r\n" , ModeInfoBlock.XResolution);
printf("Res Y: %u\r\n" , ModeInfoBlock.YResolution);
printf("ModeInfoBlock.PhysBasePtr: %u\r\n" , ModeInfoBlock.PhysBasePtr);
return ModeInfoBlock.PhysBasePtr;
}
This is a head scratcher... Ive wasted a couple of hours tweaking and googling and coming up empty handed.
Thanks in advance,
Rich