From 731ffd8773c9e6c09b675289cb932f1a286e9ce4 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 26 Dec 2009 22:16:14 +0100 Subject: [PATCH] Fix EFI compilation --- loader/i386/efi/linux.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 8cd4d23f2..a869ca71a 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -693,13 +693,41 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - params->video_cursor_x = grub_getxy () >> 8; - params->video_cursor_y = grub_getxy () & 0xff; + { + grub_term_output_t term; + int found = 0; + FOR_ACTIVE_TERM_OUTPUTS(term) + if (grub_strcmp (term->name, "vga_text") == 0) + { + grub_uint16_t pos = grub_term_getxy (term); + params->video_cursor_x = pos >> 8; + params->video_cursor_y = pos & 0xff; + params->video_width = grub_term_width (term); + params->video_height = grub_term_height (term); + found = 1; + } + if (!found) + FOR_ACTIVE_TERM_OUTPUTS(term) + if (grub_strcmp (term->name, "console") == 0) + { + grub_uint16_t pos = grub_term_getxy (term); + params->video_cursor_x = pos >> 8; + params->video_cursor_y = pos & 0xff; + params->video_width = grub_term_width (term); + params->video_height = grub_term_height (term); + found = 1; + } + if (!found) + { + params->video_cursor_x = 0; + params->video_cursor_y = 0; + params->video_width = 80; + params->video_height = 25; + } + } params->video_page = 0; /* ??? */ params->video_mode = grub_efi_system_table->con_out->mode->mode; - params->video_width = (grub_getwh () >> 8); params->video_ega_bx = 0; - params->video_height = (grub_getwh () & 0xff); params->have_vga = 0; params->font_size = 16; /* XXX */