Problems with finding VBE pmode entry point

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
VBE Problems :( Help me

Problems with finding VBE pmode entry point

Post 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 ??
morpheus

RE:Problems with finding VBE pmode entry point

Post 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 :)
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

RE:Problems with finding VBE pmode entry point

Post 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
TheUbu

RE:Problems with finding VBE pmode entry point

Post by TheUbu »

Wouldn't it be easier to call a bios routine through a v86 task?


-Christopher
pkd

RE:Problems with finding VBE pmode entry point

Post 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
morpheus

RE:Problems with finding VBE pmode entry point

Post by morpheus »

thanks I didn't tought about a bios of 64K Now I hope it will work :)
Post Reply