2008-08-03 Robert Millan <rmh@aybabtu.com>

* term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro.
        (grub_console_setcursor): Make it possible to set cursor off.
This commit is contained in:
robertmh 2008-08-03 17:09:21 +00:00
parent 52768e37c2
commit e14a6184ba
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-08-03 Robert Millan <rmh@aybabtu.com>
* 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 <rmh@aybabtu.com> 2008-08-03 Robert Millan <rmh@aybabtu.com>
* util/grub.d/00_header.in: Be platform-agnostic. Probe for existence * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence

View file

@ -34,6 +34,8 @@ static int grub_curr_x, grub_curr_y;
#define CRTC_CURSOR_ADDR_HIGH 0x0e #define CRTC_CURSOR_ADDR_HIGH 0x0e
#define CRTC_CURSOR_ADDR_LOW 0x0f #define CRTC_CURSOR_ADDR_LOW 0x0f
#define CRTC_CURSOR_DISABLE (1 << 5)
static void static void
screen_write_char (int x, int y, short c) screen_write_char (int x, int y, short c)
{ {
@ -133,5 +135,8 @@ grub_console_setcursor (int on)
grub_uint8_t old; grub_uint8_t old;
grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT); grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT);
old = grub_inb (CRTC_DATA_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);
} }