Page 1 of 1

Problems with finding VBE pmode entry point

Posted: Sat Apr 24, 2004 11:00 pm
by VBE Problems :( Help me
I've downloaded the vbe specs, from vesa. Now I've got a serious problem:

I can't find an entry point for pmode. I tried to scan for 'PMID' but no results
:(

Can anyone help me ??

RE:Problems with finding VBE pmode entry point

Posted: Sat Apr 24, 2004 11:00 pm
by morpheus
By the way i used this code:

#include <vbe.h>
#include <memory.h>
#include <string.h>

#define BIOS_SIZE 0x8000
#define BIOS_ADDR (void*)0xc0000
#define BIOS_DATA_SIZE 0x600
#define BIOS_STACK_SIZE 0x400

typedef struct
{
dword Signature;
word EntryPoint;
word PMInitialize;
word BIOSDataSel;
word A0000Sel;
word B0000Sel;
word B8000Sel;
word CodeSegSel;
byte InProtectMode;
byte Cheksum;
} PMInfoBlock;

char* bios_image;
char* bios_stack;
char* bios_data;

PMInfoBlock* PMEntry;

void zero_mem(void* buf, dword count)
{
memset(buf, 0, count);
}

bool scan(char* src, PMInfoBlock* dest, dword sig, dword len)
{
dword i;

for(i = 0; i < len; i++)
{
memcpy(dest, src, sizeof(PMInfoBlock));

if(dest->Signature == sig)
{
return true;
}

*src++;
}

return false;
}

void init_vbe()
{
zero_mem((char*)0xb8000, 4000); // Clears the output screen (text mode)

bios_image = balloc(BIOS_SIZE);
PMEntry = balloc(sizeof(PMInfoBlock));

memcpy(bios_image, BIOS_ADDR, BIOS_SIZE);

if(!scan(bios_image, PMEntry, 0x44494d50, BIOS_SIZE))
{
printf("Failed to find VBE service: 0x08%x\n", PMEntry->Signature);

return;
}
else
{
printf("Found it!!!\n");
}

bios_data  = balloc(BIOS_DATA_SIZE);
zero_mem(bios_data, BIOS_DATA_SIZE);
}

P.S. I've another name now :)

RE:Problems with finding VBE pmode entry point

Posted: Sun Apr 25, 2004 11:00 pm
by gaf
Hi morpheus,
make sure that your graphiccard's BIOS actually supports the VBE pmode interface. As far as I know it's not very widespread.

http://ftp.nchu.edu.tw/ftp/pub/Windows/ ... vesa10.zip
After running this program, you should know your graphiccard's VESA version. You may consider using a v86 mode VESA driver using bank switching because this is, unlike the pmode interface, supported by virtually every graphicboard.

regards,
gaf

RE:Problems with finding VBE pmode entry point

Posted: Sun Apr 25, 2004 11:00 pm
by TheUbu
Wouldn't it be easier to call a bios routine through a v86 task?


-Christopher

RE:Problems with finding VBE pmode entry point

Posted: Mon Apr 26, 2004 11:00 pm
by pkd
One thing to try is search from c0000 to d0000 as some video cards have 64k Bios instead of 32k.

I Have got VBE3 working on my nvidia GeForce mx440 so if you can find it i would be glad to give any assistance.

The other thing that could be useful is if you told us what card you are using.

If you have got the VBE3 specs from www.vesa.org on page 21 there is a full description of how to set up your segments/selectors, The Only thing that i would add to this is that you need a call gate segment (16 bit) so that when you return you can use a 32 bit retf (asm) so that you can get back to your 32bit segment.

Wish you luck.
pkd

RE:Problems with finding VBE pmode entry point

Posted: Tue Apr 27, 2004 11:00 pm
by morpheus
thanks I didn't tought about a bios of 64K Now I hope it will work :)