From 4c85a263af84add8f1dfa9672e6b33a34dbcf348 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 12 Feb 2012 11:50:52 -0500 Subject: [PATCH] vgabios: Minor vgabios fixes. Signed-off-by: Kevin O'Connor --- vgasrc/clext.c | 4 ++-- vgasrc/vgabios.c | 22 +++++----------------- vgasrc/vgabios.h | 4 ++++ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/vgasrc/clext.c b/vgasrc/clext.c index 7d1a604..e5dce35 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -533,8 +533,8 @@ clext_1012a0(struct bregs *regs) { struct vgamode_s *table_g = clext_find_mode(regs->al & 0x7f); regs->ah = (table_g ? 1 : 0); - regs->si = 0xffff; - regs->di = regs->ds = regs->es = regs->bx = (u32)a0h_callback; + regs->bx = (u32)a0h_callback; + regs->ds = regs->si = regs->es = regs->di = 0xffff; } static void diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index dc5d7e9..bca2e9a 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -1,16 +1,10 @@ // VGA bios implementation // -// Copyright (C) 2009 Kevin O'Connor +// Copyright (C) 2009-2012 Kevin O'Connor // Copyright (C) 2001-2008 the LGPL VGABios developers Team // // This file may be distributed under the terms of the GNU LGPLv3 license. - -// TODO: -// * review correctness of converted asm by comparing with RBIL -// -// * convert vbe/clext code - #include "bregs.h" // struct bregs #include "biosvar.h" // GET_BDA #include "util.h" // memset @@ -24,10 +18,6 @@ #include "pci.h" // pci_config_readw #include "pci_regs.h" // PCI_VENDOR_ID -// XXX -#define DEBUG_VGA_POST 1 -#define DEBUG_VGA_10 3 - // Standard Video Save Pointer Table struct VideoSavePointer_s { struct segoff_s videoparam; @@ -46,7 +36,7 @@ struct VideoParam_s video_param_table[29] VAR16; /**************************************************************** * PCI Data ****************************************************************/ -#if CONFIG_VGA_PCI == 1 + struct pci_data rom_pci_data VAR16VISIBLE = { .signature = PCI_ROM_SIGNATURE, .vendor = CONFIG_VGA_VID, @@ -57,7 +47,7 @@ struct pci_data rom_pci_data VAR16VISIBLE = { .type = PCIROM_CODETYPE_X86, .indicator = 0x80, }; -#endif + /**************************************************************** * Helper functions @@ -170,7 +160,7 @@ set_active_page(u8 page) if (!vmode_g) return; - // Get pos curs pos for the right page + // Get cursor pos for the given page struct cursorpos cp = get_cursor_pos(page); // Calculate memory address of start of page @@ -875,7 +865,7 @@ handle_101130(struct bregs *regs) regs->cx = GET_BDA(char_height) & 0xff; // Set Highest char row - regs->dx = GET_BDA(video_rows); + regs->dl = GET_BDA(video_rows); } static void @@ -1274,8 +1264,6 @@ vga_post(struct bregs *regs) extern void entry_10(void); SET_IVT(0x10, SEGOFF(get_global_seg(), (u32)entry_10)); - // XXX - clear screen and display info - SET_VGA(HaveRunInit, 1); // Fixup checksum diff --git a/vgasrc/vgabios.h b/vgasrc/vgabios.h index d32e1b0..13e5cce 100644 --- a/vgasrc/vgabios.h +++ b/vgasrc/vgabios.h @@ -73,6 +73,10 @@ extern u8 vgafont16[]; extern u8 vgafont14alt[]; extern u8 vgafont16alt[]; +// Debug settings +#define DEBUG_VGA_POST 1 +#define DEBUG_VGA_10 3 + // vgabios.c extern int VgaBDF; extern int HaveRunInit; -- 2.39.5