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