2007-10-31 22:35:13 +00:00
|
|
|
/*
|
|
|
|
* GRUB -- GRand Unified Bootloader
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
2007-10-31 22:35:13 +00:00
|
|
|
*
|
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
#include <grub/dl.h>
|
2008-11-12 17:43:39 +00:00
|
|
|
#include <grub/i386/vga_common.h>
|
|
|
|
#include <grub/i386/io.h>
|
2007-10-31 22:35:13 +00:00
|
|
|
#include <grub/types.h>
|
|
|
|
|
|
|
|
#define COLS 80
|
|
|
|
#define ROWS 25
|
|
|
|
|
|
|
|
static int grub_curr_x, grub_curr_y;
|
|
|
|
|
|
|
|
#define VGA_TEXT_SCREEN 0xb8000
|
|
|
|
|
2007-11-03 16:46:40 +00:00
|
|
|
#define CRTC_ADDR_PORT 0x3D4
|
|
|
|
#define CRTC_DATA_PORT 0x3D5
|
|
|
|
|
|
|
|
#define CRTC_CURSOR 0x0a
|
|
|
|
#define CRTC_CURSOR_ADDR_HIGH 0x0e
|
|
|
|
#define CRTC_CURSOR_ADDR_LOW 0x0f
|
|
|
|
|
2008-08-03 17:09:21 +00:00
|
|
|
#define CRTC_CURSOR_DISABLE (1 << 5)
|
|
|
|
|
2007-10-31 22:35:13 +00:00
|
|
|
static void
|
|
|
|
screen_write_char (int x, int y, short c)
|
|
|
|
{
|
|
|
|
((short *) VGA_TEXT_SCREEN)[y * COLS + x] = c;
|
|
|
|
}
|
|
|
|
|
|
|
|
static short
|
|
|
|
screen_read_char (int x, int y)
|
|
|
|
{
|
|
|
|
return ((short *) VGA_TEXT_SCREEN)[y * COLS + x];
|
|
|
|
}
|
|
|
|
|
2007-11-03 16:46:40 +00:00
|
|
|
static void
|
|
|
|
update_cursor (void)
|
|
|
|
{
|
|
|
|
unsigned int pos = grub_curr_y * COLS + grub_curr_x;
|
|
|
|
grub_outb (CRTC_CURSOR_ADDR_HIGH, CRTC_ADDR_PORT);
|
|
|
|
grub_outb (pos >> 8, CRTC_DATA_PORT);
|
|
|
|
grub_outb (CRTC_CURSOR_ADDR_LOW, CRTC_ADDR_PORT);
|
|
|
|
grub_outb (pos & 0xFF, CRTC_DATA_PORT);
|
|
|
|
}
|
|
|
|
|
2007-10-31 22:35:13 +00:00
|
|
|
static void
|
2008-01-03 22:43:46 +00:00
|
|
|
inc_y (void)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
|
|
|
grub_curr_x = 0;
|
|
|
|
if (grub_curr_y < ROWS - 1)
|
|
|
|
grub_curr_y++;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
for (y = 0; y < ROWS; y++)
|
|
|
|
for (x = 0; x < COLS; x++)
|
|
|
|
screen_write_char (x, y, screen_read_char (x, y + 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-03 22:43:46 +00:00
|
|
|
inc_x (void)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
2010-01-10 21:35:46 +00:00
|
|
|
if (grub_curr_x >= COLS - 1)
|
2007-10-31 22:35:13 +00:00
|
|
|
inc_y ();
|
|
|
|
else
|
|
|
|
grub_curr_x++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
grub_console_real_putchar (int c)
|
|
|
|
{
|
|
|
|
switch (c)
|
|
|
|
{
|
|
|
|
case '\b':
|
|
|
|
if (grub_curr_x != 0)
|
|
|
|
screen_write_char (grub_curr_x--, grub_curr_y, ' ');
|
|
|
|
break;
|
|
|
|
case '\n':
|
|
|
|
inc_y ();
|
|
|
|
break;
|
|
|
|
case '\r':
|
|
|
|
grub_curr_x = 0;
|
|
|
|
break;
|
|
|
|
default:
|
2007-11-03 16:46:40 +00:00
|
|
|
screen_write_char (grub_curr_x,
|
|
|
|
grub_curr_y, c | (grub_console_cur_color << 8));
|
2007-10-31 22:35:13 +00:00
|
|
|
inc_x ();
|
|
|
|
}
|
2007-11-03 16:46:40 +00:00
|
|
|
|
|
|
|
update_cursor ();
|
2007-10-31 22:35:13 +00:00
|
|
|
}
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
static grub_uint16_t
|
|
|
|
grub_vga_text_getxy (void)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
|
|
|
return (grub_curr_x << 8) | grub_curr_y;
|
|
|
|
}
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
static void
|
|
|
|
grub_vga_text_gotoxy (grub_uint8_t x, grub_uint8_t y)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
|
|
|
grub_curr_x = x;
|
|
|
|
grub_curr_y = y;
|
2007-11-03 16:46:40 +00:00
|
|
|
update_cursor ();
|
2007-10-31 22:35:13 +00:00
|
|
|
}
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
static void
|
|
|
|
grub_vga_text_cls (void)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < ROWS * COLS; i++)
|
2007-11-03 16:46:40 +00:00
|
|
|
((short *) VGA_TEXT_SCREEN)[i] = ' ' | (grub_console_cur_color << 8);
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
grub_vga_text_gotoxy (0, 0);
|
2007-10-31 22:35:13 +00:00
|
|
|
}
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
static void
|
|
|
|
grub_vga_text_setcursor (int on)
|
2007-10-31 22:35:13 +00:00
|
|
|
{
|
2007-11-03 16:46:40 +00:00
|
|
|
grub_uint8_t old;
|
|
|
|
grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT);
|
|
|
|
old = grub_inb (CRTC_DATA_PORT);
|
2008-08-03 17:09:21 +00:00
|
|
|
if (on)
|
|
|
|
grub_outb (old & ~CRTC_CURSOR_DISABLE, CRTC_DATA_PORT);
|
|
|
|
else
|
|
|
|
grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT);
|
2007-10-31 22:35:13 +00:00
|
|
|
}
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
|
2008-11-22 14:56:52 +00:00
|
|
|
static grub_err_t
|
2009-01-27 18:26:09 +00:00
|
|
|
grub_vga_text_init_fini (void)
|
2008-11-22 14:56:52 +00:00
|
|
|
{
|
|
|
|
grub_vga_text_cls ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
static struct grub_term_output grub_vga_text_term =
|
|
|
|
{
|
|
|
|
.name = "vga_text",
|
2008-11-22 14:56:52 +00:00
|
|
|
.init = grub_vga_text_init_fini,
|
|
|
|
.fini = grub_vga_text_init_fini,
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
.putchar = grub_console_putchar,
|
|
|
|
.getcharwidth = grub_console_getcharwidth,
|
|
|
|
.getwh = grub_console_getwh,
|
|
|
|
.getxy = grub_vga_text_getxy,
|
|
|
|
.gotoxy = grub_vga_text_gotoxy,
|
|
|
|
.cls = grub_vga_text_cls,
|
|
|
|
.setcolorstate = grub_console_setcolorstate,
|
|
|
|
.setcolor = grub_console_setcolor,
|
|
|
|
.getcolor = grub_console_getcolor,
|
|
|
|
.setcursor = grub_vga_text_setcursor,
|
|
|
|
};
|
|
|
|
|
|
|
|
GRUB_MOD_INIT(vga_text)
|
|
|
|
{
|
2009-04-14 18:12:14 +00:00
|
|
|
grub_term_register_output ("vga_text", &grub_vga_text_term);
|
2008-11-12 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'.
* conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'.
(vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New
variables.
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace
`term/i386/pc/console.c' with `term/i386/vga_common.c'.
* kern/i386/coreboot/init.c (grub_machine_init): Replace call to
grub_console_init() with call to grub_vga_text_init().
(grub_machine_fini): Replace call to
grub_console_fini() with call to grub_vga_text_fini() and
grub_at_keyboard_fini().
* include/grub/i386/pc/console.h: Include `<grub/term.h>'.
(grub_console_putchar, grub_console_getcharwidth, grub_console_getwh)
(grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): New function prototypes.
* term/i386/pc/vga_text.c: Include `<grub/dl.h>'.
(grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls)
(grub_vga_text_setcursor): Static-ize.
(grub_vga_text_term): New structure.
(GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions.
* term/i386/pc/console.c: Remove `<grub/machine/machine.h>'.
(grub_console_cur_color, grub_console_standard_color)
(grub_console_normal_color, grub_console_highlight_color)
(map_char, grub_console_putchar, grub_console_getcharwidth)
(grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor)
(grub_console_getcolor): Move from here ...
* term/i386/vga_common.c: ... to here (same function names).
2008-11-12 15:02:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GRUB_MOD_FINI(vga_text)
|
|
|
|
{
|
|
|
|
grub_term_unregister_output (&grub_vga_text_term);
|
|
|
|
}
|