return;
// Calculate the memory address
- u16 nbcols = GET_BDA(video_cols);
- u16 address = (GET_BDA(video_pagesize) * cp.page
- + (cp.x + cp.y * nbcols) * 2);
-
- stdvga_set_cursor_pos(address / 2);
+ int address = (GET_BDA(video_pagesize) * cp.page
+ + (cp.x + cp.y * GET_BDA(video_cols)) * 2);
+ stdvga_set_cursor_pos(address);
}
static struct cursorpos
}
int VgaBDF VAR16 = -1;
+int HaveRunInit VAR16;
void VISIBLE16
vga_post(struct bregs *regs)
{
debug_enter(regs, DEBUG_VGA_POST);
- if (CONFIG_VGA_PCI) {
+ if (CONFIG_VGA_PCI && !GET_GLOBAL(HaveRunInit)) {
u16 bdf = regs->ax;
- if (pci_config_readw(bdf, PCI_VENDOR_ID) == CONFIG_VGA_VID
- && pci_config_readw(bdf, PCI_DEVICE_ID) == CONFIG_VGA_DID)
+ if ((pci_config_readw(bdf, PCI_VENDOR_ID)
+ == GET_GLOBAL(rom_pci_data.vendor))
+ && (pci_config_readw(bdf, PCI_DEVICE_ID)
+ == GET_GLOBAL(rom_pci_data.device)))
SET_VGA(VgaBDF, bdf);
}
return;
}
+ if (GET_GLOBAL(HaveRunInit))
+ return;
+
init_bios_area();
SET_VGA(video_save_pointer_table.videoparam
// XXX - clear screen and display info
+ SET_VGA(HaveRunInit, 1);
+
// Fixup checksum
extern u8 _rom_header_size, _rom_header_checksum;
SET_VGA(_rom_header_checksum, 0);