VESA VESA VESA.... plz help
VESA VESA VESA.... plz help
Hello every one!
I have created an os and it's running some basic commands also....
But my main problem is that I am not at all able to program vesa....
I use turbo C++ 3.0 for developement... I am using real mode and not even able to get the mode info or even switch the screen resolution
I use
asm mov ax, 0x4f02;
asm mov bx, 0x101;
asm int 0x10;
still it displays no results.... I am using bochs 2.2 for testing... and when I open the log file i can't even find out any interrupt issued... I have also tried above on real pc but still no results please help... here is my output file log:
00000000000i[ ] reset of 'speaker' plugin device by virtual method
00000004447i[BIOS ] rombios.c,v 1.138.2.1 2005/07/06 19:30:36 vruppert Exp $
00000318308i[KBD ] reset-disable command received
00000600000i[WGUI ] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8
00004366873e[HD ] device set to 0 which does not exist
00004367166e[HD ] device set to 1 which does not exist
00055125000p[WGUI ] >>PANIC<< POWER button turned off.
00055125000i[SYS ] Last time is 1123267027
00055125000i[CPU0 ] real mode
00055125000i[CPU0 ] CS.d_b = 16 bit
00055125000i[CPU0 ] SS.d_b = 16 bit
00055125000i[CPU0 ] | EAX=0fff0020 EBX=00000a9d ECX=00000a9d EDX=0000072c
00055125000i[CPU0 ] | ESP=00000cf0 EBP=00000cf4 ESI=00007ded EDI=0000ffde
00055125000i[CPU0 ] | IOPL=0 NV UP EI PL NZ NA PE NC
00055125000i[CPU0 ] | SEG selector base limit G D
00055125000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00055125000i[CPU0 ] | CS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | DS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | SS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | ES:b800( 0000| 0| 0) 000b8000 0000ffff 0 0
00055125000i[CPU0 ] | FS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00055125000i[CPU0 ] | GS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00055125000i[CPU0 ] | EIP=000001a0 (000001a0)
00055125000i[CPU0 ] | CR0=0x00000010 CR1=0 CR2=0x00000000
00055125000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00055125000i[ ] restoring default signal behavior
00055125000i[CTRL ] quit_sim called with exit code 1
I have created an os and it's running some basic commands also....
But my main problem is that I am not at all able to program vesa....
I use turbo C++ 3.0 for developement... I am using real mode and not even able to get the mode info or even switch the screen resolution
I use
asm mov ax, 0x4f02;
asm mov bx, 0x101;
asm int 0x10;
still it displays no results.... I am using bochs 2.2 for testing... and when I open the log file i can't even find out any interrupt issued... I have also tried above on real pc but still no results please help... here is my output file log:
00000000000i[ ] reset of 'speaker' plugin device by virtual method
00000004447i[BIOS ] rombios.c,v 1.138.2.1 2005/07/06 19:30:36 vruppert Exp $
00000318308i[KBD ] reset-disable command received
00000600000i[WGUI ] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8
00004366873e[HD ] device set to 0 which does not exist
00004367166e[HD ] device set to 1 which does not exist
00055125000p[WGUI ] >>PANIC<< POWER button turned off.
00055125000i[SYS ] Last time is 1123267027
00055125000i[CPU0 ] real mode
00055125000i[CPU0 ] CS.d_b = 16 bit
00055125000i[CPU0 ] SS.d_b = 16 bit
00055125000i[CPU0 ] | EAX=0fff0020 EBX=00000a9d ECX=00000a9d EDX=0000072c
00055125000i[CPU0 ] | ESP=00000cf0 EBP=00000cf4 ESI=00007ded EDI=0000ffde
00055125000i[CPU0 ] | IOPL=0 NV UP EI PL NZ NA PE NC
00055125000i[CPU0 ] | SEG selector base limit G D
00055125000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00055125000i[CPU0 ] | CS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | DS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | SS:8000( 0000| 0| 0) 00080000 0000ffff 0 0
00055125000i[CPU0 ] | ES:b800( 0000| 0| 0) 000b8000 0000ffff 0 0
00055125000i[CPU0 ] | FS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00055125000i[CPU0 ] | GS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00055125000i[CPU0 ] | EIP=000001a0 (000001a0)
00055125000i[CPU0 ] | CR0=0x00000010 CR1=0 CR2=0x00000000
00055125000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00055125000i[ ] restoring default signal behavior
00055125000i[CTRL ] quit_sim called with exit code 1
Re:VESA VESA VESA.... plz help
Can you show the bochscr.txt file used for bochs configuration ?
Re:VESA VESA VESA.... plz help
i dont think bochs comes with vesa, as for real computer i dont know???
Re:VESA VESA VESA.... plz help
Here is a vesa demo i made for people new to vesa programming
You also like to get my compo entry that set up vesa goes to pmode has a built in cdplayer, ATAPI drive, Gui ,fonts, keyboard driver, ect that is smaller than 512bytes
Try doing that in C ;D
Its called "CdPod" you can get it here,along with the code.
http://board.flatassembler.net/topic.ph ... 4&start=50
NOTE: I was called "ASHLEY4" when i wrote these codes.
You also like to get my compo entry that set up vesa goes to pmode has a built in cdplayer, ATAPI drive, Gui ,fonts, keyboard driver, ect that is smaller than 512bytes
Try doing that in C ;D
Its called "CdPod" you can get it here,along with the code.
http://board.flatassembler.net/topic.ph ... 4&start=50
NOTE: I was called "ASHLEY4" when i wrote these codes.
Re:VESA VESA VESA.... plz help
Make sure you're using VGABIOS-lgpl-latest as the Video BIOS otherwise VESA may not actually be installed in the BIOS image.
Re:VESA VESA VESA.... plz help
# Bochs config for DoOrS-0.2.5-SR
romimage: file=$BXSHARE\BIOS-bochs-latest, address=0xf0000
vgaromimage: $BXSHARE\VGABIOS-elpin-2.40
megs: 4
floppya: 1_44=a:, status=inserted
boot: a
log:bochsout.txt
clock: sync=realtime, time0=local
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
vga_update_interval: 300000
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
floppy_command_delay: 500
ips: 1000000
romimage: file=$BXSHARE\BIOS-bochs-latest, address=0xf0000
vgaromimage: $BXSHARE\VGABIOS-elpin-2.40
megs: 4
floppya: 1_44=a:, status=inserted
boot: a
log:bochsout.txt
clock: sync=realtime, time0=local
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
vga_update_interval: 300000
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
floppy_command_delay: 500
ips: 1000000
Re:VESA VESA VESA.... plz help
here is bochsrc:
romimage: file=$BXSHARE\BIOS-bochs-latest, address=0xf0000
vgaromimage: $BXSHARE\VGABIOS-elpin-2.40
megs: 4
floppya: 1_44=a:, status=inserted
boot: a
log:bochsout.txt
clock: sync=realtime, time0=local
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
vga_update_interval: 300000
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
floppy_command_delay: 500
ips: 1000000
but shouldn't the code work on real pc atleaset.......
romimage: file=$BXSHARE\BIOS-bochs-latest, address=0xf0000
vgaromimage: $BXSHARE\VGABIOS-elpin-2.40
megs: 4
floppya: 1_44=a:, status=inserted
boot: a
log:bochsout.txt
clock: sync=realtime, time0=local
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
vga_update_interval: 300000
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
floppy_command_delay: 500
ips: 1000000
but shouldn't the code work on real pc atleaset.......
Re:VESA VESA VESA.... plz help
Yes it should work on a real PC (if the card is VESA compatible (which i think almost every card now is)).
This might help:
http://www.osdev.org/osfaq2/index.php/How%20do%20I%20draw%20things%20in%20protected%20mode%3F
This might help:
http://www.osdev.org/osfaq2/index.php/How%20do%20I%20draw%20things%20in%20protected%20mode%3F
Re:VESA VESA VESA.... plz help
Actually it should be:vgaromimage: $BXSHARE\VGABIOS-elpin-2.40
vgaromimage: $BXSHARE\VGABIOS-lgpl-latest
Only the above BIOS supports VESA modes.
Re:VESA VESA VESA.... plz help
Thanks I corrected the mistake I can switch modes but i still have problems in detection of vesa compatibility....
can any one post some .c RM code for that... It could be helpful for others also....
can any one post some .c RM code for that... It could be helpful for others also....
Re:VESA VESA VESA.... plz help
The code in the wiki is for djgpp under win or linux not for own OS....
one will have to define mem funcs before that.... and also it uses djgpp funcs. not bioses int 0x10
one will have to define mem funcs before that.... and also it uses djgpp funcs. not bioses int 0x10
Re:VESA VESA VESA.... plz help
Hi ,
I had written a program for SVGA with TC++3.0 , and I tested it on 3 different computers ,
1 - Dell Latitude Laptop , P3 500MHz , VESA 2.0
2 - An old computer P2 300MHz , VESA 3.0
3 - HP laptop AMD64 Athlon 3200+ , WXGA screen
but my test only ran on the firs computer , on the second the result was incorrect , on third the hole computer crashed.
So , I recommend to test your program on any computer you can to , this is my code , take a look at it , it's probably like yours but just to be sure.
Kourosh
/*****************************
SVGA.CPP
*****************************/
#include <dos.h>
#include "SVGA.h"
#define UCHAR unsigned int
void initmouse()
{
asm {
mov ax, 00h
int 33h
mov ax, 01h
int 33h
}
}
void initSVGA(int mode)
{
asm {
mov ax , 4f02h
mov bx , mode
int 10h
}
VBE_GetModeInfo(mode , &VesaInfo) ;
screen_width = VesaInfo.resX ;
screen_height = VesaInfo.resY ;
dcSetBank = VesaInfo.winFuncPtr;
if(dcSetBank == NULL) exit(1);
}
int VBE_GetModeInfo(int mode , VBE_ModeInfoBlock *mbi)
{
union REGS r ;
struct SREGS s ;
r.x.ax = 0x4F01 ;
r.x.cx = mode ;
r.x.di = FP_OFF(mbi) ;
s.es = FP_SEG(mbi) ;
int86x(0x10,&r,&r,&s);
return((int)r.h.ah) ;
}
void setpixel(int x , int y , long color)
{
unsigned long off = (long)x + (long)y * screen_width;
static int currBank;
int retVal = 0 , newBank = off >> 16;
unsigned char r = (UCHAR)color,
g = (UCHAR)(color << ,
b = (UCHAR)(color << 16);
r = (UCHAR)color;
g = (UCHAR)(color << ;
b = (UCHAR)(color << 16);
if(newBank != currBank)
{
asm mov bx,0000h
asm mov dx,[newBank]
retVal = directCall_setBank();
asm mov bx,0001h
asm mov dx,[newBank]
dcSetBank();
}
retVal &= 0xFF00; //isolate the upper 8 bits (the error code from AH)
/* Ok, If both calls to set-bank returned 0 (success) then
update the current bank variable. */
if( !retVal )
currBank = newBank;
pokeb(0xA000 , ofs , b);
pokeb(0xA000 , ofs + 1 , g);
pokeb(0xA000 , ofs + 2 , r);
}
/****************************************
SVGA.H
****************************************/
#ifndef __SVGA_H
#define __SVGA_H
typedef struct {
unsigned char r;
unsigned char g;
unsigned char b;
} RGB ;
typedef struct {
short modeAttrib; //Attributes of this video mode (in da bits)
char winAAttrib; //Attributes of the 'write' window
char winBAttrib; //the 'Read' window (may be merged with 'write' window
short winGranularity; //The size each bank in kilobytes (usually 64k)
short winSize; //The total size of a window (whah?)
short winASeg; //The memory segment where windowA is stored
short winBSeg; //windowB
void (far *winFuncPtr)(void);//** useful, pointer to global set-bank function
short bytesPerLine; //number of bytes in a full scanline of pixels
short resX; //number of pixels across the screen
short resY; //and down the screen.
char charSizeX; //Size (in pixels) of a BIOS char printed to the screen
char charSizeY; //in this video mode (in 320x200 mode it's 8x8)
char numPlanes; //number of colour planes in this mode.
char bitsPerPixel; //number of bits taken to represent a pixel
char numBanks; //number of banks available
char memModel; //Specifies memory organization of this mode
char bankSize; //size of a bank
char numImgPlages; //Specifies how many page-flipping buffers available
char reserved;
char redMaskSize, //___MaskSize= number of bits in a colour component
redFieldPos; //of hi-colour modes.
char greenMaskSize, //___FieldPos= number of bits to shift the colour
greenFieldPos; //component to the left to align it with its bit-mask
char blueMaskSize,
blueFieldPos;
char resrvMaskSize, //reserved ... hmm.
resrvFieldPos;
char directColourInfo; //Shows ability to change direct colour lookup tables (?)
char *physBasePtr; //If using 32-bit linear mode this points to all of vid mem
char *offScreenMemOffset; //pointer to extra memory after the on-screen stuff (32-bit only)
short offScreenMemSize; //amount of off screen memory available (in 1k units)
char reservedBlock[206]; //Not currently used by VBE.
} VBE_ModeInfoBlock;
extern VBE_ModeInfoBlock VesaInfo;
extern void (far * dcSetBank)(void);
extern int screen_width , screen_height;
extern int currBank = 0;
extern void initmouse();
extern void initSVGA(int);
extern int VBE_GetModeInfo(int , VBE_ModeInfoBlock*);
extern void setpixel(int , int , long);
#endif
I had written a program for SVGA with TC++3.0 , and I tested it on 3 different computers ,
1 - Dell Latitude Laptop , P3 500MHz , VESA 2.0
2 - An old computer P2 300MHz , VESA 3.0
3 - HP laptop AMD64 Athlon 3200+ , WXGA screen
but my test only ran on the firs computer , on the second the result was incorrect , on third the hole computer crashed.
So , I recommend to test your program on any computer you can to , this is my code , take a look at it , it's probably like yours but just to be sure.
Kourosh
/*****************************
SVGA.CPP
*****************************/
#include <dos.h>
#include "SVGA.h"
#define UCHAR unsigned int
void initmouse()
{
asm {
mov ax, 00h
int 33h
mov ax, 01h
int 33h
}
}
void initSVGA(int mode)
{
asm {
mov ax , 4f02h
mov bx , mode
int 10h
}
VBE_GetModeInfo(mode , &VesaInfo) ;
screen_width = VesaInfo.resX ;
screen_height = VesaInfo.resY ;
dcSetBank = VesaInfo.winFuncPtr;
if(dcSetBank == NULL) exit(1);
}
int VBE_GetModeInfo(int mode , VBE_ModeInfoBlock *mbi)
{
union REGS r ;
struct SREGS s ;
r.x.ax = 0x4F01 ;
r.x.cx = mode ;
r.x.di = FP_OFF(mbi) ;
s.es = FP_SEG(mbi) ;
int86x(0x10,&r,&r,&s);
return((int)r.h.ah) ;
}
void setpixel(int x , int y , long color)
{
unsigned long off = (long)x + (long)y * screen_width;
static int currBank;
int retVal = 0 , newBank = off >> 16;
unsigned char r = (UCHAR)color,
g = (UCHAR)(color << ,
b = (UCHAR)(color << 16);
r = (UCHAR)color;
g = (UCHAR)(color << ;
b = (UCHAR)(color << 16);
if(newBank != currBank)
{
asm mov bx,0000h
asm mov dx,[newBank]
retVal = directCall_setBank();
asm mov bx,0001h
asm mov dx,[newBank]
dcSetBank();
}
retVal &= 0xFF00; //isolate the upper 8 bits (the error code from AH)
/* Ok, If both calls to set-bank returned 0 (success) then
update the current bank variable. */
if( !retVal )
currBank = newBank;
pokeb(0xA000 , ofs , b);
pokeb(0xA000 , ofs + 1 , g);
pokeb(0xA000 , ofs + 2 , r);
}
/****************************************
SVGA.H
****************************************/
#ifndef __SVGA_H
#define __SVGA_H
typedef struct {
unsigned char r;
unsigned char g;
unsigned char b;
} RGB ;
typedef struct {
short modeAttrib; //Attributes of this video mode (in da bits)
char winAAttrib; //Attributes of the 'write' window
char winBAttrib; //the 'Read' window (may be merged with 'write' window
short winGranularity; //The size each bank in kilobytes (usually 64k)
short winSize; //The total size of a window (whah?)
short winASeg; //The memory segment where windowA is stored
short winBSeg; //windowB
void (far *winFuncPtr)(void);//** useful, pointer to global set-bank function
short bytesPerLine; //number of bytes in a full scanline of pixels
short resX; //number of pixels across the screen
short resY; //and down the screen.
char charSizeX; //Size (in pixels) of a BIOS char printed to the screen
char charSizeY; //in this video mode (in 320x200 mode it's 8x8)
char numPlanes; //number of colour planes in this mode.
char bitsPerPixel; //number of bits taken to represent a pixel
char numBanks; //number of banks available
char memModel; //Specifies memory organization of this mode
char bankSize; //size of a bank
char numImgPlages; //Specifies how many page-flipping buffers available
char reserved;
char redMaskSize, //___MaskSize= number of bits in a colour component
redFieldPos; //of hi-colour modes.
char greenMaskSize, //___FieldPos= number of bits to shift the colour
greenFieldPos; //component to the left to align it with its bit-mask
char blueMaskSize,
blueFieldPos;
char resrvMaskSize, //reserved ... hmm.
resrvFieldPos;
char directColourInfo; //Shows ability to change direct colour lookup tables (?)
char *physBasePtr; //If using 32-bit linear mode this points to all of vid mem
char *offScreenMemOffset; //pointer to extra memory after the on-screen stuff (32-bit only)
short offScreenMemSize; //amount of off screen memory available (in 1k units)
char reservedBlock[206]; //Not currently used by VBE.
} VBE_ModeInfoBlock;
extern VBE_ModeInfoBlock VesaInfo;
extern void (far * dcSetBank)(void);
extern int screen_width , screen_height;
extern int currBank = 0;
extern void initmouse();
extern void initSVGA(int);
extern int VBE_GetModeInfo(int , VBE_ModeInfoBlock*);
extern void setpixel(int , int , long);
#endif
Re:VESA VESA VESA.... plz help
This also is coded to work under an OS not for ur own OS...