Browse Source

fix x86emu int10 framebuffer vesa mode.

Change-Id: Iaf91ca90942438a7c94d4c9581d8b702d9f900b5
Signed-off-by: QiaoChong <qiaochong@loongson.cn>
master
QiaoChong 9 years ago
committed by Chong Qiao
parent
commit
842154465a
  1. 8
      x86emu/int10/generic.c
  2. 24
      x86emu/int10/vesafb.c

8
x86emu/int10/generic.c

@ -272,6 +272,8 @@ unsigned long long vbios_addr;
//static unsigned long long * vfb_top;
void *vbiosMem = 0;
int cacluate_vesamode();
int vga_bios_init(void)
{
xf86Int10InfoPtr pInt;
@ -644,16 +646,18 @@ int vga_bios_init(void)
//printf("setting fb mode...\n");
pInt->BIOSseg = V_BIOS >> 4;
pInt->num = 0x10;
{
{
char *mode;
mode = getenv("vesa_mode");
if (mode != 0)
vesa_mode = strtol(mode, 0, 0);
else
vesa_mode = 0x00;
vesa_mode = cacluate_vesamode(0);
}
}
for(vesa_mode = 0; vesa_mode <= 24; vesa_mode++){
for(; vesa_mode>=0 ; vesa_mode = cacluate_vesamode(vesa_mode)){
printk("\n\nvesa_mode : 0x%x\n", vesa_mode);
pInt->ax = 0x4f02;
// pInt->bx = 0x4114;

24
x86emu/int10/vesafb.c

@ -462,6 +462,30 @@ struct vesamode *vesa_mode_head = vesamode;
static u32 io_vaddr;
int cacluate_vesamode(int start)
{
int x,y,depth,mode;
int i;
x=800;
y=600;
depth=16;
mode=-1;
#ifdef FB_XSIZE
x=FB_XSIZE;
#endif
#ifdef FB_YSIZE
y=FB_YSIZE;
#endif
for(i=start;i<sizeof(vesamode)/sizeof(vesamode[0]);i++)
if(x==vesamode[i].width && y==vesamode[i].height && depth==vesamode[i].bpp && vesamode[i].mode>0x107)
{
mode = i;
break;
}
return mode;
}
void tlbmap(u32 viraddr, u32 phyaddr, u32 size)
{

Loading…
Cancel
Save