Make grub_console_real_putchar grub_console_putchar
This commit is contained in:
parent
84f8180158
commit
34fac099a5
5 changed files with 11 additions and 24 deletions
|
@ -46,6 +46,7 @@ grub_uint16_t grub_console_getxy (void);
|
||||||
void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y);
|
void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y);
|
||||||
void grub_console_cls (void);
|
void grub_console_cls (void);
|
||||||
void grub_console_setcursor (int on);
|
void grub_console_setcursor (int on);
|
||||||
|
void grub_console_putchar (const struct grub_unicode_glyph *c);
|
||||||
|
|
||||||
/* Initialize the console system. */
|
/* Initialize the console system. */
|
||||||
void grub_console_init (void);
|
void grub_console_init (void);
|
||||||
|
|
|
@ -25,18 +25,9 @@
|
||||||
|
|
||||||
extern grub_uint8_t grub_console_cur_color;
|
extern grub_uint8_t grub_console_cur_color;
|
||||||
|
|
||||||
void
|
|
||||||
grub_console_putchar (const struct grub_unicode_glyph *c);
|
|
||||||
grub_ssize_t
|
|
||||||
grub_console_getcharwidth (const struct grub_unicode_glyph *c);
|
|
||||||
grub_uint16_t grub_console_getwh (void);
|
grub_uint16_t grub_console_getwh (void);
|
||||||
void grub_console_setcolorstate (grub_term_color_state state);
|
void grub_console_setcolorstate (grub_term_color_state state);
|
||||||
void grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color);
|
void grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color);
|
||||||
void grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color);
|
void grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color);
|
||||||
|
|
||||||
/* Implemented in both kern/i386/pc/startup.S and vga_text.c; this symbol
|
|
||||||
is not exported, so there's no collision, but vga_common.c expects this
|
|
||||||
prototype to be the same. */
|
|
||||||
void grub_console_real_putchar (int c);
|
|
||||||
|
|
||||||
#endif /* ! GRUB_VGA_COMMON_CPU_HEADER */
|
#endif /* ! GRUB_VGA_COMMON_CPU_HEADER */
|
||||||
|
|
|
@ -1064,7 +1064,7 @@ xsmap:
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void grub_console_real_putchar (int c)
|
* void grub_console_putchar (const struct grub_unicode_glyph *c)
|
||||||
*
|
*
|
||||||
* Put the character C on the console. Because GRUB wants to write a
|
* Put the character C on the console. Because GRUB wants to write a
|
||||||
* character with an attribute, this implementation is a bit tricky.
|
* character with an attribute, this implementation is a bit tricky.
|
||||||
|
@ -1077,8 +1077,9 @@ xsmap:
|
||||||
* get the height of the screen, and the TELETYPE OUTPUT BIOS call doesn't
|
* get the height of the screen, and the TELETYPE OUTPUT BIOS call doesn't
|
||||||
* support setting a background attribute.
|
* support setting a background attribute.
|
||||||
*/
|
*/
|
||||||
FUNCTION(grub_console_real_putchar)
|
FUNCTION(grub_console_putchar)
|
||||||
movl %eax, %edx
|
/* Retrieve the base character. */
|
||||||
|
movl 0(%eax), %edx
|
||||||
pusha
|
pusha
|
||||||
movb EXT_C(grub_console_cur_color), %bl
|
movb EXT_C(grub_console_cur_color), %bl
|
||||||
|
|
||||||
|
|
|
@ -83,10 +83,10 @@ inc_x (void)
|
||||||
grub_curr_x++;
|
grub_curr_x++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
grub_console_real_putchar (int c)
|
grub_vga_text_putchar (const struct grub_unicode_glyph *c)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c->base)
|
||||||
{
|
{
|
||||||
case '\b':
|
case '\b':
|
||||||
if (grub_curr_x != 0)
|
if (grub_curr_x != 0)
|
||||||
|
@ -99,8 +99,8 @@ grub_console_real_putchar (int c)
|
||||||
grub_curr_x = 0;
|
grub_curr_x = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
screen_write_char (grub_curr_x,
|
screen_write_char (grub_curr_x, grub_curr_y,
|
||||||
grub_curr_y, c | (grub_console_cur_color << 8));
|
c->base | (grub_console_cur_color << 8));
|
||||||
inc_x ();
|
inc_x ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ static struct grub_term_output grub_vga_text_term =
|
||||||
.name = "vga_text",
|
.name = "vga_text",
|
||||||
.init = grub_vga_text_init_fini,
|
.init = grub_vga_text_init_fini,
|
||||||
.fini = grub_vga_text_init_fini,
|
.fini = grub_vga_text_init_fini,
|
||||||
.putchar = grub_console_putchar,
|
.putchar = grub_vga_text_putchar,
|
||||||
.getwh = grub_console_getwh,
|
.getwh = grub_console_getwh,
|
||||||
.getxy = grub_vga_text_getxy,
|
.getxy = grub_vga_text_getxy,
|
||||||
.gotoxy = grub_vga_text_gotoxy,
|
.gotoxy = grub_vga_text_gotoxy,
|
||||||
|
|
|
@ -25,12 +25,6 @@ static grub_uint8_t grub_console_standard_color = 0x7;
|
||||||
static grub_uint8_t grub_console_normal_color = 0x7;
|
static grub_uint8_t grub_console_normal_color = 0x7;
|
||||||
static grub_uint8_t grub_console_highlight_color = 0x70;
|
static grub_uint8_t grub_console_highlight_color = 0x70;
|
||||||
|
|
||||||
void
|
|
||||||
grub_console_putchar (const struct grub_unicode_glyph *c)
|
|
||||||
{
|
|
||||||
grub_console_real_putchar (c->base);
|
|
||||||
}
|
|
||||||
|
|
||||||
grub_uint16_t
|
grub_uint16_t
|
||||||
grub_console_getwh (void)
|
grub_console_getwh (void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue