2009-06-29 Robert Millan <rmh.grub@aybabtu.com>

* include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro.

        * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline
        assembly in final jump, using register constraints.

        (grub_linux_boot): For text mode, initialize `have_vga' using
        GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1).

        Initialize `video_cursor_x' and `video_cursor_y' as late as possible,
        right before the final jump.

        Set `video_mode' to 0x3.

        Document initialization of `video_page', `video_mode' and
        `video_ega_bx'.
This commit is contained in:
robertmh 2009-06-29 17:19:35 +00:00
parent c6fe4d5328
commit b09db61ddd
3 changed files with 33 additions and 5 deletions

View file

@ -1,8 +1,21 @@
2009-06-29 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro.
* loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline
assembly in final jump, using register constraints.
(grub_linux_boot): For text mode, initialize `have_vga' using
GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1).
Initialize `video_cursor_x' and `video_cursor_y' as late as possible,
right before the final jump.
Set `video_mode' to 0x3.
Document initialization of `video_page', `video_mode' and
`video_ega_bx'.
2009-06-29 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro.

View file

@ -79,6 +79,7 @@ struct grub_e820_mmap
grub_uint32_t type;
} __attribute__((packed));
#define GRUB_VIDEO_TYPE_TEXT 0x01
#define GRUB_VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
#define GRUB_VIDEO_TYPE_EFI 0x70

View file

@ -479,9 +479,7 @@ grub_linux_boot (void)
params->have_vga = GRUB_VIDEO_TYPE_VLFB;
else
{
params->have_vga = 0;
params->video_cursor_x = grub_getxy () >> 8;
params->video_cursor_y = grub_getxy () & 0xff;
params->have_vga = GRUB_VIDEO_TYPE_TEXT;
params->video_width = 80;
params->video_height = 25;
}
@ -536,6 +534,13 @@ grub_linux_boot (void)
grub_mmap_iterate (hook);
params->mmap_size = e820_num;
/* Initialize these last, because terminal position could be affected by printfs above. */
if (params->have_vga == GRUB_VIDEO_TYPE_TEXT)
{
params->video_cursor_x = grub_getxy () >> 8;
params->video_cursor_y = grub_getxy () & 0xff;
}
#ifdef __x86_64__
grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12),
@ -664,8 +669,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
params->type_of_loader = (LINUX_LOADER_ID_GRUB << 4);
/* These two are used (instead of cmd_line_ptr) by older versions of Linux,
and otherwise ignored. */
params->cl_magic = GRUB_LINUX_CL_MAGIC;
params->cl_offset = 0x1000;
params->cmd_line_ptr = (unsigned long) real_mode_mem + 0x1000;
params->ramdisk_image = 0;
params->ramdisk_size = 0;
@ -679,9 +687,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
params->ext_mem = ((32 * 0x100000) >> 10);
params->alt_mem = ((32 * 0x100000) >> 10);
params->video_page = 0; /* ??? */
params->video_mode = 0;
/* Ignored by Linux. */
params->video_page = 0;
/* Must be non-zero even in text mode, or Linux will think there's no VGA. */
params->video_mode = 0x3;
/* Only used when `video_mode == 0x7', otherwise ignored. */
params->video_ega_bx = 0;
params->font_size = 16; /* XXX */
/* The other parameters are filled when booting. */