From: Vladimir 'phcoder' Serbinenko Date: Sun, 28 Mar 2010 11:46:42 +0000 (+0200) Subject: Remove VBE multiboot support X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f5d5c327e3884dd99171fc7b5c17669f356f9b28;p=grub2.git Remove VBE multiboot support --- diff --git a/ChangeLog.mbivid b/ChangeLog.mbivid deleted file mode 100644 index 25db22c19..000000000 --- a/ChangeLog.mbivid +++ /dev/null @@ -1,9 +0,0 @@ -2010-01-14 Vladimir Serbinenko - - VBE multiboot support. - - * loader/i386/multiboot_mbi.c (HAS_VBE): New constant. - (grub_multiboot_get_mbi_size) [HAS_VBE]: Account for VBE structures. - (grub_multiboot_make_mbi) [HAS_VBE]: Likewise. - (fill_vbe_info) [HAS_VBE]: New function. - (retrieve_video_parameters) [HAS_VBE]: Call fill_vbe_info. diff --git a/ChangeLog.tag b/ChangeLog.tag index 73983b463..90faf3dd6 100644 --- a/ChangeLog.tag +++ b/ChangeLog.tag @@ -11,7 +11,6 @@ (grub_get_multiboot_mmap_count): New proto. (grub_fill_multiboot_mmap): Likewise. (grub_multiboot_set_video_mode): Likewise. - (grub_multiboot_fill_vbe_info_real): Likewise. (grub_multiboot_set_console): Likewise. (grub_multiboot_load): Likewise. (grub_multiboot_load_elf): Likewise. @@ -24,9 +23,6 @@ * loader/i386/multiboot_mbi.c (HAS_VGA_TEXT): Moved from here .. * include/grub/multiboot.h (GRUB_MACHINE_HAS_VGA_TEXT): ... here. All users updated. - * loader/i386/multiboot_mbi.c (HAS_VBE): Moved from here .. - * include/grub/multiboot.h (GRUB_MACHINE_HAS_VBE): ... here. All - users updated. * loader/i386/multiboot_mbi.c (accepts_video): Moved from here... * loader/i386/multiboot.c (accepts_video): ... here. All users updated. * loader/i386/multiboot_mbi.c (grub_multiboot_set_accepts_video): @@ -40,8 +36,4 @@ * loader/i386/multiboot_mbi.c (set_video_mode): Moved from here... * loader/i386/multiboot.c (grub_multiboot_set_video_mode): ... here. All users updated. - * loader/i386/multiboot_mbi.c (fill_vbe_info): Moved generic parts - from here... - * loader/i386/multiboot.c (grub_multiboot_fill_vbe_info_real): ... here. - All users updated. * loader/i386/multiboot_mbi2.c: New file. diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h index 70241ec3c..49d71fa09 100644 --- a/include/grub/multiboot.h +++ b/include/grub/multiboot.h @@ -51,17 +51,8 @@ grub_err_t grub_multiboot_set_video_mode (void); #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) #include -grub_err_t -grub_multiboot_fill_vbe_info_real (struct grub_vbe_info_block *vbe_control_info, - struct grub_vbe_mode_info_block *vbe_mode_info, - multiboot_uint16_t *vbe_mode, - multiboot_uint16_t *vbe_interface_seg, - multiboot_uint16_t *vbe_interface_off, - multiboot_uint16_t *vbe_interface_len); -#define GRUB_MACHINE_HAS_VBE 1 #define GRUB_MACHINE_HAS_VGA_TEXT 1 #else -#define GRUB_MACHINE_HAS_VBE 0 #define GRUB_MACHINE_HAS_VGA_TEXT 0 #endif diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index a89233431..99d1cf906 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -20,6 +20,7 @@ /* * FIXME: The following features from the Multiboot specification still * need to be implemented: + * - VBE support * - symbol table * - drives table * - ROM configuration table @@ -115,54 +116,6 @@ grub_multiboot_set_video_mode (void) return err; } -#if GRUB_MACHINE_HAS_VBE -grub_err_t -grub_multiboot_fill_vbe_info_real (struct grub_vbe_info_block *vbe_control_info, - struct grub_vbe_mode_info_block *vbe_mode_info, - multiboot_uint16_t *vbe_mode, - multiboot_uint16_t *vbe_interface_seg, - multiboot_uint16_t *vbe_interface_off, - multiboot_uint16_t *vbe_interface_len) -{ - grub_vbe_status_t status; - void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - - status = grub_vbe_bios_get_controller_info (scratch); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "Can't get controller info."); - grub_memcpy (vbe_control_info, scratch, sizeof (struct grub_vbe_info_block)); - - status = grub_vbe_bios_get_mode (scratch); - *vbe_mode = *(grub_uint32_t *) scratch; - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "can't get VBE mode"); - - /* get_mode_info isn't available for mode 3. */ - if (*vbe_mode == 3) - { - grub_memset (vbe_mode_info, 0, sizeof (struct grub_vbe_mode_info_block)); - vbe_mode_info->memory_model = GRUB_VBE_MEMORY_MODEL_TEXT; - vbe_mode_info->x_resolution = 80; - vbe_mode_info->y_resolution = 25; - } - else - { - status = grub_vbe_bios_get_mode_info (*vbe_mode, scratch); - if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_IO, "can't get mode info"); - grub_memcpy (vbe_mode_info, scratch, - sizeof (struct grub_vbe_mode_info_block)); - } - - /* FIXME: retrieve those. */ - *vbe_interface_seg = 0; - *vbe_interface_off = 0; - *vbe_interface_len = 0; - - return GRUB_ERR_NONE; -} -#endif - static grub_err_t grub_multiboot_boot (void) { diff --git a/loader/i386/multiboot_mbi.c b/loader/i386/multiboot_mbi.c index 0deca8930..2a7c70f96 100644 --- a/loader/i386/multiboot_mbi.c +++ b/loader/i386/multiboot_mbi.c @@ -186,10 +186,6 @@ grub_multiboot_get_mbi_size (void) + modcnt * sizeof (struct multiboot_mod_list) + total_modcmd + ALIGN_UP (sizeof(PACKAGE_STRING), 4) + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry) -#if GRUB_MACHINE_HAS_VBE - + sizeof (struct grub_vbe_info_block) - + sizeof (struct grub_vbe_mode_info_block) -#endif + 256 * sizeof (struct multiboot_color); } @@ -391,12 +387,6 @@ grub_multiboot_make_mbi (void *orig, grub_uint32_t dest, grub_off_t buf_off, grub_print_error (); grub_errno = GRUB_ERR_NONE; } -#if GRUB_MACHINE_HAS_VBE - ptrorig += sizeof (struct grub_vbe_info_block); - ptrdest += sizeof (struct grub_vbe_info_block); - ptrorig += sizeof (struct grub_vbe_mode_info_block); - ptrdest += sizeof (struct grub_vbe_mode_info_block); -#endif return GRUB_ERR_NONE; } diff --git a/loader/i386/multiboot_mbi2.c b/loader/i386/multiboot_mbi2.c index 09d09d5a9..436cd0901 100644 --- a/loader/i386/multiboot_mbi2.c +++ b/loader/i386/multiboot_mbi2.c @@ -127,10 +127,10 @@ grub_multiboot_load (grub_file_t file) case MULTIBOOT_TAG_TYPE_BASIC_MEMINFO: case MULTIBOOT_TAG_TYPE_BOOTDEV: case MULTIBOOT_TAG_TYPE_MMAP: - case MULTIBOOT_TAG_TYPE_VBE: case MULTIBOOT_TAG_TYPE_FRAMEBUFFER: break; + case MULTIBOOT_TAG_TYPE_VBE: case MULTIBOOT_TAG_TYPE_ELF_SECTIONS: case MULTIBOOT_TAG_TYPE_APM: default: @@ -271,37 +271,6 @@ grub_multiboot_get_mbi_size (void) + sizeof (struct multiboot_tag_vbe) + MULTIBOOT_TAG_ALIGN - 1; } -#ifdef GRUB_MACHINE_HAS_VBE - -static grub_err_t -fill_vbe_info (struct grub_vbe_mode_info_block **vbe_mode_info_out, - grub_uint8_t **ptrorig) -{ - struct multiboot_tag_vbe *tag = (struct multiboot_tag_vbe *) *ptrorig; - grub_err_t err; - - tag->type = MULTIBOOT_TAG_TYPE_VBE; - tag->size = 0; - err = grub_multiboot_fill_vbe_info_real ((struct grub_vbe_info_block *) - &(tag->vbe_control_info), - (struct grub_vbe_mode_info_block *) - &(tag->vbe_mode_info), - &(tag->vbe_mode), - &(tag->vbe_interface_seg), - &(tag->vbe_interface_off), - &(tag->vbe_interface_len)); - if (err) - return err; - if (vbe_mode_info_out) - *vbe_mode_info_out = (struct grub_vbe_mode_info_block *) - &(tag->vbe_mode_info); - tag->size = sizeof (struct multiboot_tag_vbe); - *ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN); - return GRUB_ERR_NONE; -} - -#endif - /* Fill previously allocated Multiboot mmap. */ static void grub_fill_multiboot_mmap (struct multiboot_tag_mmap *tag) @@ -373,11 +342,35 @@ retrieve_video_parameters (grub_uint8_t **ptrorig) #if HAS_VGA_TEXT if (driv_id == GRUB_VIDEO_DRIVER_NONE) { - struct grub_vbe_mode_info_block *vbe_mode_info; - err = fill_vbe_info (&vbe_mode_info, ptrorig); - if (err) - return err; - if (vbe_mode_info->memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + struct grub_vbe_mode_info_block vbe_mode_info; + grub_vbe_status_t status; + grub_uint32_t vbe_mode; + void *scratch = (void *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + + status = grub_vbe_bios_get_mode (scratch); + vbe_mode = *(grub_uint32_t *) scratch; + if (status != GRUB_VBE_STATUS_OK) + return GRUB_ERR_NONE; + + /* get_mode_info isn't available for mode 3. */ + if (vbe_mode == 3) + { + grub_memset (&vbe_mode_info, 0, + sizeof (struct grub_vbe_mode_info_block)); + vbe_mode_info.memory_model = GRUB_VBE_MEMORY_MODEL_TEXT; + vbe_mode_info.x_resolution = 80; + vbe_mode_info.y_resolution = 25; + } + else + { + status = grub_vbe_bios_get_mode_info (vbe_mode, scratch); + if (status != GRUB_VBE_STATUS_OK) + return GRUB_ERR_NONE; + grub_memcpy (&vbe_mode_info, scratch, + sizeof (struct grub_vbe_mode_info_block)); + } + + if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) { tag = (struct multiboot_tag_framebuffer *) *ptrorig; tag->common.type = MULTIBOOT_TAG_TYPE_FRAMEBUFFER; @@ -385,9 +378,9 @@ retrieve_video_parameters (grub_uint8_t **ptrorig) tag->common.framebuffer_addr = 0xb8000; - tag->common.framebuffer_pitch = 2 * vbe_mode_info->x_resolution; - tag->common.framebuffer_width = vbe_mode_info->x_resolution; - tag->common.framebuffer_height = vbe_mode_info->y_resolution; + tag->common.framebuffer_pitch = 2 * vbe_mode_info.x_resolution; + tag->common.framebuffer_width = vbe_mode_info.x_resolution; + tag->common.framebuffer_height = vbe_mode_info.y_resolution; tag->common.framebuffer_bpp = 16; @@ -453,15 +446,6 @@ retrieve_video_parameters (grub_uint8_t **ptrorig) } *ptrorig += ALIGN_UP (tag->common.size, MULTIBOOT_TAG_ALIGN); -#if HAS_VBE - if (driv_id == GRUB_VIDEO_DRIVER_VBE) - { - err = fill_vbe_info (NULL, ptrorig); - if (err) - return err; - } -#endif - return GRUB_ERR_NONE; }