From e14a6184ba309d9a4dbdc36a6a4aa2fa85181fdb Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Aug 2008 17:09:21 +0000 Subject: [PATCH] 2008-08-03 Robert Millan * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. (grub_console_setcursor): Make it possible to set cursor off. --- ChangeLog | 5 +++++ term/i386/pc/vga_text.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e60ca752a..e7d577ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-03 Robert Millan + + * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. + (grub_console_setcursor): Make it possible to set cursor off. + 2008-08-03 Robert Millan * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 58a3c6c2e..ec3c0f565 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -34,6 +34,8 @@ static int grub_curr_x, grub_curr_y; #define CRTC_CURSOR_ADDR_HIGH 0x0e #define CRTC_CURSOR_ADDR_LOW 0x0f +#define CRTC_CURSOR_DISABLE (1 << 5) + static void screen_write_char (int x, int y, short c) { @@ -133,5 +135,8 @@ grub_console_setcursor (int on) grub_uint8_t old; grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT); old = grub_inb (CRTC_DATA_PORT); - grub_outb ((old & ~(on << 5)), CRTC_DATA_PORT); + if (on) + grub_outb (old & ~CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); + else + grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); }