2009-08-04 Robert Millan <rmh.grub@aybabtu.com>

Fix a bug resulting in black screen when loading Linux using a
        packed video mode.

        * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New
        function.

        * include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro.
        (grub_vbe_bios_getset_dac_palette_width): New function.
        (grub_vbe_bios_get_dac_palette_width)
        (grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for
        grub_vbe_bios_getset_dac_palette_width()).

        * video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to
        check for return status.
        (grub_vbe_get_video_mode_info): When getting information for a packed
        mode (<= 8 bpp), obtain DAC palette width using
        grub_vbe_bios_getset_dac_palette_width(), and use that for initializing
        {red,green,blue}_mark_size.
This commit is contained in:
robertmh 2009-08-04 21:28:19 +00:00
parent ecb1a6d9e9
commit f56a875639
4 changed files with 93 additions and 1 deletions

View file

@ -1732,6 +1732,52 @@ FUNCTION(grub_vbe_bios_get_mode)
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size)
*
* Register allocations for parameters:
* %eax set
* %edx *dac_mask_size
*/
FUNCTION(grub_vbe_bios_getset_dac_palette_width)
pushl %ebp
pushl %ebx
xorl %ebx, %ebx
/* If we only want to fetch the value, set %bl to 1. */
testl %eax, %eax
jne 1f
incb %bl
1:
/* Put desired width in %bh. */
movl (%edx), %eax
movb %al, %bh
call prot_to_real
.code16
movw $0x4f08, %ax
int $0x10
movw %ax, %dx /* real_to_prot destroys %eax. */
DATA32 call real_to_prot
.code32
/* Move result back to *dac_mask_size. */
movb %bh, %al
movl %eax, (%edx)
/* Return value in %eax. */
xorl %eax, %eax
movw %dx, %ax
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_bios_set_memory_window (grub_uint32_t window,
* grub_uint32_t position);