From 8c32359615a5657f1d417bb0b248e60c243851dd Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Mon, 7 Mar 2011 19:01:22 +0000 Subject: [PATCH] The VBE display extension is now a part of the Bochs core. The configure option --enable-vbe is now deprecated and the symbols BX_SUPPORT_VBE and BX_SUPPORT_PCIVGA have been removed. To enable VBE support, the bochsrc option "vga: extension=" must be set to "vbe". If PCI is present, you can assign the "pcivga" device to a PCI slot. --- bochs/.conf.everything | 1 - bochs/config.cc | 4 - bochs/config.h.in | 6 -- bochs/configure.in | 32 +++---- bochs/doc/docbook/user/user.dbk | 12 +-- bochs/iodev/devices.cc | 2 - bochs/iodev/pcivga.cc | 4 +- bochs/iodev/vga.cc | 113 ++++++------------------- bochs/iodev/vga.h | 144 ++++++++++++++------------------ bochs/main.cc | 3 +- 10 files changed, 104 insertions(+), 217 deletions(-) diff --git a/bochs/.conf.everything b/bochs/.conf.everything index 26179abdd..ca0d6f2c7 100644 --- a/bochs/.conf.everything +++ b/bochs/.conf.everything @@ -21,7 +21,6 @@ --enable-x86-debugger \ --enable-a20-pin \ --enable-instrumentation=instrument/example1 \ - --enable-vbe \ --enable-ne2000 \ --enable-pci \ --enable-acpi \ diff --git a/bochs/config.cc b/bochs/config.cc index 5af30b8d9..a7e8bc6a2 100755 --- a/bochs/config.cc +++ b/bochs/config.cc @@ -755,11 +755,7 @@ void bx_init_options() "VGA Extension", "Name of the VGA extension", "none", BX_PATHNAME_LEN); -#if BX_SUPPORT_VBE vga_extension->set_initial_val("vbe"); -#elif BX_SUPPORT_CLGD54XX - vga_extension->set_initial_val("cirrus"); -#endif display->set_options(display->SHOW_PARENT); // keyboard & mouse subtree diff --git a/bochs/config.h.in b/bochs/config.h.in index 44185a386..21c0a6250 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -636,9 +636,6 @@ typedef // limited i440FX PCI support #define BX_SUPPORT_PCI 0 -// Bochs VBE display interface -#define BX_SUPPORT_VBE 0 - // CLGD54XX emulation #define BX_SUPPORT_CLGD54XX 0 @@ -649,9 +646,6 @@ typedef #error To enable ACPI support, you must also enable PCI #endif -// Experimental VGA on PCI -#define BX_SUPPORT_PCIVGA 0 - // Experimental host PCI device mapping #define BX_SUPPORT_PCIDEV 0 diff --git a/bochs/configure.in b/bochs/configure.in index 847deb1f3..6073de031 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -1340,28 +1340,6 @@ AC_ARG_ENABLE(raw-serial, ] ) -AC_MSG_CHECKING(for VESA BIOS extensions) -AC_ARG_ENABLE(vbe, - [ --enable-vbe use VESA BIOS extensions], - [if test "$enableval" = yes; then - AC_MSG_RESULT(yes) - AC_DEFINE(BX_SUPPORT_VBE, 1) - if test "$pci" = 1; then - AC_DEFINE(BX_SUPPORT_PCIVGA, 1) - fi - else - AC_MSG_RESULT(no) - AC_DEFINE(BX_SUPPORT_VBE, 0) - fi], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(BX_SUPPORT_VBE, 1) - if test "$pci" = 1; then - AC_DEFINE(BX_SUPPORT_PCIVGA, 1) - fi - ] - ) - AC_MSG_CHECKING(for CLGD54XX emulation) AC_ARG_ENABLE(clgd54xx, [ --enable-clgd54xx enable CLGD54XX emulation], @@ -2793,6 +2771,16 @@ AC_ARG_ENABLE(vme, AC_MSG_RESULT(no) ]) +AC_MSG_CHECKING(for VESA BIOS extensions (deprecated)) +AC_ARG_ENABLE(vbe, + [ --enable-vbe use VESA BIOS extensions (deprecated)], + [AC_MSG_RESULT($enableval) + AC_MSG_ERROR([DEPRECATED - this feature always available with .bochsrc option]) + ], + [ + AC_MSG_RESULT(no) + ]) + # Create some subdirectories for when you run configure from some other # directory. diff --git a/bochs/doc/docbook/user/user.dbk b/bochs/doc/docbook/user/user.dbk index 045a0795d..c7b331d47 100644 --- a/bochs/doc/docbook/user/user.dbk +++ b/bochs/doc/docbook/user/user.dbk @@ -401,7 +401,7 @@ currently work with. VBE (VESA) Support Yes Currently resolutions up to 2560x1600x32bpp are supported. - You must compile Bochs with VBE enabled and use the LGPL'd VGABIOS. + You must enable VBE with the VGA extension option and use the LGPL'd VGABIOS. For more information see . @@ -2176,13 +2176,6 @@ turn it off. no Enable PCI pseudo NIC (network card) support. - - --enable-vbe - no - Use VGA BIOS Extensions (VBE) by Jeroen Janssen, see - for more information. - - --enable-clgd54xx no @@ -7201,8 +7194,7 @@ it may even be possible to edit the shortcut before sending it. - In order to use VESA VBE, you need to compile Bochs using the - option and enable it in your bochsrc by setting the + In order to use VESA VBE, you need to enable it in your bochsrc by setting the vga option to vbe. Finally, you need to use the LGPL'd VGABIOS diff --git a/bochs/iodev/devices.cc b/bochs/iodev/devices.cc index c70c93da3..0d737bc52 100644 --- a/bochs/iodev/devices.cc +++ b/bochs/iodev/devices.cc @@ -259,12 +259,10 @@ void bx_devices_c::init(BX_MEM_C *newmem) #if BX_SUPPORT_PCI if (SIM->get_param_bool(BXPN_I440FX_SUPPORT)->get()) { -#if BX_SUPPORT_PCIVGA && BX_SUPPORT_VBE if ((DEV_is_pci_device("pcivga")) && (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "vbe"))) { PLUG_load_plugin(pcivga, PLUGTYPE_OPTIONAL); } -#endif #if BX_SUPPORT_USB_UHCI if (is_usb_uhci_enabled()) { PLUG_load_plugin(usb_uhci, PLUGTYPE_OPTIONAL); diff --git a/bochs/iodev/pcivga.cc b/bochs/iodev/pcivga.cc index 1faf3bb90..c98db1220 100644 --- a/bochs/iodev/pcivga.cc +++ b/bochs/iodev/pcivga.cc @@ -35,7 +35,7 @@ #include "iodev.h" -#if BX_SUPPORT_PCI && BX_SUPPORT_PCIVGA +#if BX_SUPPORT_PCI #include "pci.h" #include "pcivga.h" @@ -192,4 +192,4 @@ void bx_pcivga_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len BX_DEBUG(("write PCI register 0x%02x value 0x%08x", address, value)); } -#endif // BX_SUPPORT_PCI && BX_SUPPORT_PCIVGA +#endif // BX_SUPPORT_PCI diff --git a/bochs/iodev/vga.cc b/bochs/iodev/vga.cc index d3d0e0ac6..3c655ed05 100644 --- a/bochs/iodev/vga.cc +++ b/bochs/iodev/vga.cc @@ -120,10 +120,8 @@ void bx_vga_c::init(void) { unsigned i,string_i; unsigned x,y; -#if BX_SUPPORT_VBE unsigned addr; Bit16u max_xres, max_yres, max_bpp; -#endif int argc; char *argv[16]; char *ptr; @@ -278,8 +276,7 @@ void bx_vga_c::init(void) } } -#if BX_SUPPORT_VBE - // The following is for the vbe display extension + // The following is for the VBE display extension BX_VGA_THIS vbe.enabled=0; BX_VGA_THIS vbe.dac_8bit=0; BX_VGA_THIS vbe.base_address = 0x0000; @@ -337,7 +334,6 @@ void bx_vga_c::init(void) BX_INFO(("VBE Bochs Display Extension Enabled")); } -#endif } void bx_vga_c::init_iohandlers(bx_read_handler_t f_read, bx_write_handler_t f_write) @@ -499,7 +495,7 @@ void bx_vga_c::register_state(void) new bx_shadow_bool_c(list, "y_doublescan", &BX_VGA_THIS s.y_doublescan); new bx_shadow_num_c(list, "last_bpp", &BX_VGA_THIS s.last_bpp); new bx_shadow_data_c(list, "memory", BX_VGA_THIS s.memory, BX_VGA_THIS s.memsize); -#if BX_SUPPORT_VBE + // register state for Bochs VBE if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "vbe")) { bx_list_c *vbe = new bx_list_c(list, "vbe", 18); new bx_shadow_num_c(vbe, "cur_dispi", &BX_VGA_THIS vbe.cur_dispi, BASE_HEX); @@ -520,21 +516,16 @@ void bx_vga_c::register_state(void) new bx_shadow_bool_c(vbe, "get_capabilities", &BX_VGA_THIS vbe.get_capabilities); new bx_shadow_bool_c(vbe, "dac_8bit", &BX_VGA_THIS vbe.dac_8bit); } -#endif } void bx_vga_c::after_restore_state(void) { for (unsigned i=0; i<256; i++) { -#if BX_SUPPORT_VBE if (BX_VGA_THIS vbe.dac_8bit) { bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red, BX_VGA_THIS s.pel.data[i].green, BX_VGA_THIS s.pel.data[i].blue); - } - else -#endif - { + } else { bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red<<2, BX_VGA_THIS s.pel.data[i].green<<2, BX_VGA_THIS s.pel.data[i].blue<<2); @@ -544,12 +535,10 @@ void bx_vga_c::after_restore_state(void) old_iWidth = BX_MAX_XRES; old_iHeight = BX_MAX_YRES; BX_VGA_THIS redraw_area(0, 0, BX_MAX_XRES, BX_MAX_YRES); -#if BX_SUPPORT_VBE if (BX_VGA_THIS vbe.enabled) { bx_gui->dimension_update(BX_VGA_THIS vbe.xres, BX_VGA_THIS vbe.yres, 0, 0, BX_VGA_THIS vbe.bpp); } -#endif BX_VGA_THIS update(); bx_gui->flush(); } @@ -730,7 +719,7 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len) case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: retval = BX_VGA_THIS s.attribute_ctrl.palette_reg[BX_VGA_THIS s.attribute_ctrl.address]; - RETURN(retval); + RETURN(retval); break; case 0x10: /* mode control register */ retval = @@ -741,13 +730,13 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len) (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat << 5) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select << 6) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size << 7); - RETURN(retval); + RETURN(retval); break; - case 0x11: /* overscan color register */ - RETURN(BX_VGA_THIS s.attribute_ctrl.overscan_color); + case 0x11: /* overscan color register */ + RETURN(BX_VGA_THIS s.attribute_ctrl.overscan_color); break; - case 0x12: /* color plane enable */ - RETURN(BX_VGA_THIS s.attribute_ctrl.color_plane_enable); + case 0x12: /* color plane enable */ + RETURN(BX_VGA_THIS s.attribute_ctrl.color_plane_enable); break; case 0x13: /* horizontal PEL panning register */ RETURN(BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning); @@ -1278,21 +1267,17 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l case 2: BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue = value; -#if BX_SUPPORT_VBE if (BX_VGA_THIS vbe.dac_8bit) { needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue); } else { -#endif needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red<<2, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green<<2, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue<<2); -#if BX_SUPPORT_VBE } -#endif break; } @@ -1473,10 +1458,7 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l case 0x13: case 0x14: case 0x17: -#if BX_SUPPORT_VBE - if (!BX_VGA_THIS vbe.enabled || (BX_VGA_THIS vbe.bpp == VBE_DISPI_BPP_4)) -#endif - { + if (!BX_VGA_THIS vbe.enabled || (BX_VGA_THIS vbe.bpp == VBE_DISPI_BPP_4)) { // Line offset change BX_VGA_THIS s.line_offset = BX_VGA_THIS s.CRTC.reg[0x13] << 1; if (BX_VGA_THIS s.CRTC.reg[0x14] & 0x40) BX_VGA_THIS s.line_offset <<= 2; @@ -1490,7 +1472,6 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l needs_update = 1; break; } - } break; @@ -1519,9 +1500,9 @@ Bit64s bx_vga_c::vga_param_handler(bx_param_c *param, int set, Bit64s val) { // handler for runtime parameter 'vga_update_interval' if (set) { - BX_INFO (("Changing timer interval to %d", (Bit32u)val)); - BX_VGA_THIS timer_handler (theVga); - bx_pc_system.activate_timer (BX_VGA_THIS timer_id, (Bit32u)val, 1); + BX_INFO(("Changing timer interval to %d", (Bit32u)val)); + BX_VGA_THIS timer_handler(theVga); + bx_pc_system.activate_timer(BX_VGA_THIS timer_id, (Bit32u)val, 1); } return val; } @@ -1567,9 +1548,7 @@ void bx_vga_c::update(void) if ((bx_pc_system.time_usec() % 13888) < 70) return; -#if BX_SUPPORT_VBE - if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4)) - { + if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4)) { // specific VBE code display update code unsigned pitch; unsigned xc, yc, xti, yti; @@ -1832,7 +1811,7 @@ void bx_vga_c::update(void) // after a vbe display update, don't try to do any 'normal vga' updates anymore return; } -#endif + // fields that effect the way video memory is serialized into screen output: // GRAPHICS CONTROLLER: // BX_VGA_THIS s.graphics_ctrl.shift_reg: @@ -1906,19 +1885,14 @@ void bx_vga_c::update(void) } else { // output data in serial fashion with each display plane // output on its associated serial output. Standard EGA/VGA format -#if BX_SUPPORT_VBE - if (BX_VGA_THIS vbe.enabled) - { + if (BX_VGA_THIS vbe.enabled) { plane0 = &BX_VGA_THIS s.memory[0<graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } - } - } + } + } } break; // case 2 @@ -2216,21 +2190,13 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr) Bit32u offset; Bit8u *plane0, *plane1, *plane2, *plane3; -#if BX_SUPPORT_VBE // if in a vbe enabled mode, read from the vbe_memory if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4)) { return vbe_mem_read(addr); - } - else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) - { + } else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) { return 0xff; } -#endif - -#if defined(VGA_TRACE_FEATURE) -// BX_DEBUG(("8-bit memory read from 0x%08x", addr)); -#endif #ifdef __OS2__ @@ -2268,17 +2234,12 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr) return BX_VGA_THIS s.memory[(offset & ~0x03) + (offset % 4)*65536]; } -#if BX_SUPPORT_VBE - if (BX_VGA_THIS vbe.enabled) - { + if (BX_VGA_THIS vbe.enabled) { plane0 = &BX_VGA_THIS s.memory[(0<= BX_VGA_THIS vbe.base_address)) - { + } else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) { return; } -#endif - -#if defined(VGA_TRACE_FEATURE) -//BX_DEBUG(("8-bit memory write to %08x = %02x", addr, value)); -#endif #ifdef __OS2__ @@ -2479,17 +2432,12 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value) /* addr between 0xA0000 and 0xAFFFF */ -#if BX_SUPPORT_VBE - if (BX_VGA_THIS vbe.enabled) - { + if (BX_VGA_THIS vbe.enabled) { plane0 = &BX_VGA_THIS s.memory[(0<get_param_bool(BXPN_I440FX_SUPPORT)->get() ? "yes" : "no")); BX_INFO((" SB16 support: %s",BX_SUPPORT_SB16?"yes":"no")); BX_INFO((" USB support: %s",BX_SUPPORT_PCIUSB?"yes":"no")); - BX_INFO((" VGA extension support: %s %s",BX_SUPPORT_VBE?"vbe":"", - BX_SUPPORT_CLGD54XX?"cirrus":"")); + BX_INFO((" VGA extension support: vbe %s", BX_SUPPORT_CLGD54XX?"cirrus":"")); // Check if there is a romimage if (strcmp(SIM->get_param_string(BXPN_ROM_PATH)->getptr(),"") == 0) {