2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 2002,2003,2005,2007,2008 Free Software Foundation, Inc.
5
* GRUB is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* GRUB is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19
#include <grub/i386/vga_common.h>
20
#include <grub/term.h>
21
#include <grub/types.h>
23
grub_uint8_t grub_console_cur_color = 0x7;
24
static grub_uint8_t grub_console_standard_color = 0x7;
25
static grub_uint8_t grub_console_normal_color = 0x7;
26
static grub_uint8_t grub_console_highlight_color = 0x70;
29
map_char (grub_uint32_t c)
33
/* Map some unicode characters to the VGA font, if possible. */
36
case 0x2190: /* left arrow */
39
case 0x2191: /* up arrow */
42
case 0x2192: /* right arrow */
45
case 0x2193: /* down arrow */
48
case 0x2501: /* horizontal line */
51
case 0x2503: /* vertical line */
54
case 0x250F: /* upper-left corner */
57
case 0x2513: /* upper-right corner */
60
case 0x2517: /* lower-left corner */
63
case 0x251B: /* lower-right corner */
77
grub_console_putchar (grub_uint32_t c)
79
grub_console_real_putchar (map_char (c));
83
grub_console_getcharwidth (grub_uint32_t c __attribute__ ((unused)))
85
/* For now, every printable character has the width 1. */
90
grub_console_getwh (void)
92
return (80 << 8) | 25;
96
grub_console_setcolorstate (grub_term_color_state state)
99
case GRUB_TERM_COLOR_STANDARD:
100
grub_console_cur_color = grub_console_standard_color;
102
case GRUB_TERM_COLOR_NORMAL:
103
grub_console_cur_color = grub_console_normal_color;
105
case GRUB_TERM_COLOR_HIGHLIGHT:
106
grub_console_cur_color = grub_console_highlight_color;
114
grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color)
116
grub_console_normal_color = normal_color;
117
grub_console_highlight_color = highlight_color;
121
grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
123
*normal_color = grub_console_normal_color;
124
*highlight_color = grub_console_highlight_color;