2002-06-12 Yoshinori K. Okuji <okuji@enbug.org>

The terminal handling code is rewritten radically.

	* stage2/console.c: New file.
	* stage2/term.h: Likewise.

	* stage2/Makefile.am (noinst_HEADERS): Added term.h.
	(libgrub_a_SOURCES): Added serial.c.
	(pre_stage2_exec_SOURCES): Added console.c.

	* stage2/asm.S (console_putchar): Rewritten from scratch.
	[!STAGE1_5] (translation_table): New variable.
	[!STAGE1_5] (translate_keycode): New function.
	[!STAGE1_5] (console_getkey): Call translate_keycode.
	[!STAGE1_5] (console_checkkey): Likewise.
	[!STAGE1_5] (nocursor): Renamed to ...
	[!STAGE1_5] (console_nocursor): ... this.
	[!STAGE1_5] (console_set_attrib): Removed.

	* stage2/builtins.c: Include term.h.
	(terminal): Removed.
	(normal_color): Likewise.
	(highlight_color): Likewise.
	(cat_func): Display a question mark when a non-printable
	character was read.
	(terminal_func): Rewritten almost from scratch.

	* stage2/char_io.c: Include term.h.
	[!STAGE1_5] (auto_fill): Removed.
	[!STAGE1_5] (term_table): New variable.
	[!STAGE1_5] (current_term): Likewise.
	[!STAGE1_5] (real_get_cmdline): New function. The code was
	stolen from the previous version of get_cmdline.
	[!STAGE1_5] (get_cmdline): Rewritten from scratch.
	[!STAGE1_5] (translate_keycode): Removed.
	[!STAGE1_5] (getkey): Rewritten from scratch.
	[!STAGE1_5] (checkkey): Likewise.
	(grub_putchar): Likewise.
	[!STAGE1_5] (gotoxy): Likewise.
	[!STAGE1_5] (getxy): Likewise.
	[!STAGE1_5] (cls): Likewise.
	[!STAGE1_5] (nocursor): New function.
	[SUPPORT_SERIAL] (serial_getxy): Removed.
	[SUPPORT_SERIAL] (serial_gotoxy): Likewise.
	[SUPPORT_SERIAL] (serial_cls): Likewise.
	[SUPPORT_SERIAL] (serial_getxy): Likewise.
	[!STAGE1_5] (set_attrib): Likewise.

	* stage2/cmdline.c (init_cmdline): Set COUNT_LINES to -1.

	* stage2/common.c [!STAGE1_5] (err_list): Removed
	ERR_NEED_SERIAL and added ERR_DEV_NEED_INIT.

	* stage2/hercules.c: Rewritten almost from scratch.
	* stage2/hercules.h (herc_putchar): Removed.
	(herc_cls): Likewise.
	(herc_getxy): Likewise.
	(herc_gotoxy): Likewise.
	(herc_set_attrib): Likewise.

	* stage2/serial.c: Rewritten almost from scratch.
	* stage2/serial.h: Likewise.

	* stage2/shared.h [GRUB_UTIL] (DISP_UL): Set to the same value
	as VGA's.
	[GRUB_UTIL] (DISP_UR): Likewise.
	[GRUB_UTIL] (DISP_LL): Likewise.
	[GRUB_UTIL] (DISP_LR): Likewise.
	[GRUB_UTIL] (DISP_HORIZ): Likewise.
	[GRUB_UTIL] (DISP_VERT): Likewise.
	[GRUB_UTIL] (DISP_LEFT): Likewise.
	[GRUB_UTIL] (DISP_RIGHT): Likewise.
	[GRUB_UTIL] (DISP_UP): Likewise.
	[GRUB_UTIL] (DISP_DOWN): Likewise.
	(grub_error_t): Removed ERR_NEED_SERIAL.
	Added ERR_DEV_NEED_INIT.
	(normal_color): Removed.
	(highlight_color): Likewise.
	(console_cls): Removed, because this is declared in term.h.
	(console_getxy): Likewise.
	(console_gotoxy): Likewise.
	(console_putchar): Likewise.
	(console_getkey): Likewise.
	(console_checkkey): Likewise.
	(console_set_attrib): Removed.
	(set_attrib): Likewise.
	[GRUB_UTIL] (nocursor): Declared.
	(auto_fill): Removed.
	(terminal): Likewise.
	(TERMINAL_CONSOLE): Likewise.
	(TERMINAL_SERIAL): Likewise.
	(TERMINAL_HERCULES): Likewise.
	(TERMINAL_DUMB): Likewise.
	(translate_keycode): Likewise.

	* stage2/stage2.c: Include term.h.
	(print_entry): Rewritten from scratch.
	(print_entries): Likewise.
	(print_border): Likewise.
	(set_line): Removed.
	(set_line_normal): Likewise.
	(set_line_highlight): Likewise.

	* grub/Makefile.am (AM_CFLAGS): Added -DSUPPORT_HERCULES=1.

	* grub/asmstub.c: Don't include hercules.h. Include term.h.
	(console_current_color): New variable.
	(console_translate_key): New function.
	(console_checkkey): Rewritten from scratch.
	(console_getkey): Likewise.
	(console_putchar): Likewise.
	(console_set_attrib): Removed.
	(console_highlight): New function.
	(console_setcolor): Likewise.
	(console_nocursor): Likewise.
	(serial_getkey): Removed.
	(serial_checkkey): Likewise.
	(serial_putchar): Likewise.
	(serial_exists): Likewise.
	(serial_get_port): Likewise.
	(serial_init): Likewise.
	(serial_hw_fetch): New function.
	(serial_hw_put): Likewise.
	(serial_hw_delay): Likewise.
	(serial_hw_get_port): Likewise.
	(serial_hw_init): Likewise.
	(set_serial_device): Renamed to ...
	(serial_set_device): ... this.
	(herc_putchar): Renamed to ...
	(hercules_putchar): ... this.
	(herc_cls): Renamed to ...
	(hercules_cls): ... this.
	(herc_getxy): Renamed to ...
	(hercules_getxy): ... this.
	(herc_gotoxy): Renamed to ...
	(hercules_gotoxy): ... this.
	(hercules_highlight): New function.
	(hercules_setcolor): Likewise.
	(hercules_nocursor): Likewise.
	(herc_set_attrib): Removed.

	* grub/main.c: Include term.h.
	(main): If USE_CURSES is false, set CURRENT_TERM->FLAGS to
	TERM_NO_EDIT | TERM_DUMB. TERMINAL is not used any longer.
This commit is contained in:
okuji 2002-06-11 16:36:54 +00:00
parent 9ab2360b15
commit 2369202e83
22 changed files with 1626 additions and 1502 deletions

146
ChangeLog
View file

@ -1,3 +1,149 @@
2002-06-12 Yoshinori K. Okuji <okuji@enbug.org>
The terminal handling code is rewritten radically.
* stage2/console.c: New file.
* stage2/term.h: Likewise.
* stage2/Makefile.am (noinst_HEADERS): Added term.h.
(libgrub_a_SOURCES): Added serial.c.
(pre_stage2_exec_SOURCES): Added console.c.
* stage2/asm.S (console_putchar): Rewritten from scratch.
[!STAGE1_5] (translation_table): New variable.
[!STAGE1_5] (translate_keycode): New function.
[!STAGE1_5] (console_getkey): Call translate_keycode.
[!STAGE1_5] (console_checkkey): Likewise.
[!STAGE1_5] (nocursor): Renamed to ...
[!STAGE1_5] (console_nocursor): ... this.
[!STAGE1_5] (console_set_attrib): Removed.
* stage2/builtins.c: Include term.h.
(terminal): Removed.
(normal_color): Likewise.
(highlight_color): Likewise.
(cat_func): Display a question mark when a non-printable
character was read.
(terminal_func): Rewritten almost from scratch.
* stage2/char_io.c: Include term.h.
[!STAGE1_5] (auto_fill): Removed.
[!STAGE1_5] (term_table): New variable.
[!STAGE1_5] (current_term): Likewise.
[!STAGE1_5] (real_get_cmdline): New function. The code was
stolen from the previous version of get_cmdline.
[!STAGE1_5] (get_cmdline): Rewritten from scratch.
[!STAGE1_5] (translate_keycode): Removed.
[!STAGE1_5] (getkey): Rewritten from scratch.
[!STAGE1_5] (checkkey): Likewise.
(grub_putchar): Likewise.
[!STAGE1_5] (gotoxy): Likewise.
[!STAGE1_5] (getxy): Likewise.
[!STAGE1_5] (cls): Likewise.
[!STAGE1_5] (nocursor): New function.
[SUPPORT_SERIAL] (serial_getxy): Removed.
[SUPPORT_SERIAL] (serial_gotoxy): Likewise.
[SUPPORT_SERIAL] (serial_cls): Likewise.
[SUPPORT_SERIAL] (serial_getxy): Likewise.
[!STAGE1_5] (set_attrib): Likewise.
* stage2/cmdline.c (init_cmdline): Set COUNT_LINES to -1.
* stage2/common.c [!STAGE1_5] (err_list): Removed
ERR_NEED_SERIAL and added ERR_DEV_NEED_INIT.
* stage2/hercules.c: Rewritten almost from scratch.
* stage2/hercules.h (herc_putchar): Removed.
(herc_cls): Likewise.
(herc_getxy): Likewise.
(herc_gotoxy): Likewise.
(herc_set_attrib): Likewise.
* stage2/serial.c: Rewritten almost from scratch.
* stage2/serial.h: Likewise.
* stage2/shared.h [GRUB_UTIL] (DISP_UL): Set to the same value
as VGA's.
[GRUB_UTIL] (DISP_UR): Likewise.
[GRUB_UTIL] (DISP_LL): Likewise.
[GRUB_UTIL] (DISP_LR): Likewise.
[GRUB_UTIL] (DISP_HORIZ): Likewise.
[GRUB_UTIL] (DISP_VERT): Likewise.
[GRUB_UTIL] (DISP_LEFT): Likewise.
[GRUB_UTIL] (DISP_RIGHT): Likewise.
[GRUB_UTIL] (DISP_UP): Likewise.
[GRUB_UTIL] (DISP_DOWN): Likewise.
(grub_error_t): Removed ERR_NEED_SERIAL.
Added ERR_DEV_NEED_INIT.
(normal_color): Removed.
(highlight_color): Likewise.
(console_cls): Removed, because this is declared in term.h.
(console_getxy): Likewise.
(console_gotoxy): Likewise.
(console_putchar): Likewise.
(console_getkey): Likewise.
(console_checkkey): Likewise.
(console_set_attrib): Removed.
(set_attrib): Likewise.
[GRUB_UTIL] (nocursor): Declared.
(auto_fill): Removed.
(terminal): Likewise.
(TERMINAL_CONSOLE): Likewise.
(TERMINAL_SERIAL): Likewise.
(TERMINAL_HERCULES): Likewise.
(TERMINAL_DUMB): Likewise.
(translate_keycode): Likewise.
* stage2/stage2.c: Include term.h.
(print_entry): Rewritten from scratch.
(print_entries): Likewise.
(print_border): Likewise.
(set_line): Removed.
(set_line_normal): Likewise.
(set_line_highlight): Likewise.
* grub/Makefile.am (AM_CFLAGS): Added -DSUPPORT_HERCULES=1.
* grub/asmstub.c: Don't include hercules.h. Include term.h.
(console_current_color): New variable.
(console_translate_key): New function.
(console_checkkey): Rewritten from scratch.
(console_getkey): Likewise.
(console_putchar): Likewise.
(console_set_attrib): Removed.
(console_highlight): New function.
(console_setcolor): Likewise.
(console_nocursor): Likewise.
(serial_getkey): Removed.
(serial_checkkey): Likewise.
(serial_putchar): Likewise.
(serial_exists): Likewise.
(serial_get_port): Likewise.
(serial_init): Likewise.
(serial_hw_fetch): New function.
(serial_hw_put): Likewise.
(serial_hw_delay): Likewise.
(serial_hw_get_port): Likewise.
(serial_hw_init): Likewise.
(set_serial_device): Renamed to ...
(serial_set_device): ... this.
(herc_putchar): Renamed to ...
(hercules_putchar): ... this.
(herc_cls): Renamed to ...
(hercules_cls): ... this.
(herc_getxy): Renamed to ...
(hercules_getxy): ... this.
(herc_gotoxy): Renamed to ...
(hercules_gotoxy): ... this.
(hercules_highlight): New function.
(hercules_setcolor): Likewise.
(hercules_nocursor): Likewise.
(herc_set_attrib): Removed.
* grub/main.c: Include term.h.
(main): If USE_CURSES is false, set CURRENT_TERM->FLAGS to
TERM_NO_EDIT | TERM_DUMB. TERMINAL is not used any longer.
2002-06-01 Yoshinori K. Okuji <okuji@enbug.org> 2002-06-01 Yoshinori K. Okuji <okuji@enbug.org>
* docs/grub.texi (FAQ): Removed. See the GNU GRUB FAQ on the web * docs/grub.texi (FAQ): Removed. See the GNU GRUB FAQ on the web

8
NEWS
View file

@ -10,6 +10,14 @@ New in 0.93:
details. details.
* The appendix "FAQ" in the manual is removed. See the GNU GRUB FAQ on * The appendix "FAQ" in the manual is removed. See the GNU GRUB FAQ on
the web <http://www.gnu.org/software/grub/grub-faq.html> instead. the web <http://www.gnu.org/software/grub/grub-faq.html> instead.
* The terminal handling code is rewritten radically, and many bugfixes
are made at the same time.
* The command "color" is effective even in the command-line.
* The command "terminal" takes two new options, ``--no-echo'' and
``--no-edit''. If you specify ``--no-echo'', GRUB won't echo back
input characters. If you specify ``--no-edit'', GRUB will disable the
BASH-like editing feature. These options are useful when using an
intelligent terminal (such as the comint mode in GNU Emacs).
New in 0.92 - 2002-04-30: New in 0.92 - 2002-04-30:
* The command "displaymem" uses only hex digits for consistency. * The command "displaymem" uses only hex digits for consistency.

View file

@ -2273,7 +2273,7 @@ character each of the symbols corresponds:
@node terminal @node terminal
@subsection terminal @subsection terminal
@deffn Command terminal [@option{--dumb}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{--silent}] [@option{console}] [@option{serial}] [@option{hercules}] @deffn Command terminal [@option{--dumb}] [@option{--no-echo}] [@option{--no-edit}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{--silent}] [@option{console}] [@option{serial}] [@option{hercules}]
Select a terminal for user interaction. The terminal is assumed to be Select a terminal for user interaction. The terminal is assumed to be
VT100-compatible unless @option{--dumb} is specified. If both VT100-compatible unless @option{--dumb} is specified. If both
@option{console} and @option{serial} are specified, then GRUB will use @option{console} and @option{serial} are specified, then GRUB will use
@ -2292,7 +2292,13 @@ terminal, and it is used for the internal pager function. If you don't
specify this option, the number is assumed as 24. specify this option, the number is assumed as 24.
The option @option{--silent} suppresses the message to prompt you to The option @option{--silent} suppresses the message to prompt you to
hit any key. This might be useful if your system has no terminal device. hit any key. This might be useful if your system has no terminal
device.
The option @option{--no-echo} has GRUB not to echo back input
characters. This implies the option @option{--no-edit}.
The option @option{--no-edit} disables the BASH-like editing feature.
@end deffn @end deffn

View file

@ -1,4 +1,4 @@
@set UPDATED 1 June 2002 @set UPDATED 12 June 2002
@set UPDATED-MONTH June 2002 @set UPDATED-MONTH June 2002
@set EDITION 0.93 @set EDITION 0.93
@set VERSION 0.93 @set VERSION 0.93

View file

@ -1,4 +1,4 @@
@set UPDATED 1 June 2002 @set UPDATED 12 June 2002
@set UPDATED-MONTH June 2002 @set UPDATED-MONTH June 2002
@set EDITION 0.93 @set EDITION 0.93
@set VERSION 0.93 @set VERSION 0.93

View file

@ -7,7 +7,8 @@ SERIAL_FLAGS = -DSUPPORT_SERIAL=1
endif endif
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \ AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 $(SERIAL_FLAGS) \ -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
$(SERIAL_FLAGS) \
-fwritable-strings -I$(top_srcdir)/stage2 \ -fwritable-strings -I$(top_srcdir)/stage2 \
-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib -I$(top_srcdir)/stage1 -I$(top_srcdir)/lib

View file

@ -92,7 +92,8 @@ sbin_PROGRAMS = grub
@SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 @SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \ AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 $(SERIAL_FLAGS) \ -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
$(SERIAL_FLAGS) \
-fwritable-strings -I$(top_srcdir)/stage2 \ -fwritable-strings -I$(top_srcdir)/stage2 \
-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib -I$(top_srcdir)/stage1 -I$(top_srcdir)/lib

View file

@ -1,7 +1,7 @@
/* asmstub.c - a version of shared_src/asm.S that works under Unix */ /* asmstub.c - a version of shared_src/asm.S that works under Unix */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -61,7 +61,7 @@ int grub_stage2 (void);
#include <shared.h> #include <shared.h>
#include <device.h> #include <device.h>
#include <serial.h> #include <serial.h>
#include <hercules.h> #include <term.h>
/* Simulated memory sizes. */ /* Simulated memory sizes. */
#define EXTENDED_MEMSIZE (3 * 1024 * 1024) /* 3MB */ #define EXTENDED_MEMSIZE (3 * 1024 * 1024) /* 3MB */
@ -87,6 +87,9 @@ char **device_map = 0;
/* The jump buffer for exiting correctly. */ /* The jump buffer for exiting correctly. */
static jmp_buf env_for_exit; static jmp_buf env_for_exit;
/* The current color for console. */
static int console_current_color = A_NORMAL;
/* The file descriptor for a serial device. */ /* The file descriptor for a serial device. */
static int serial_fd = -1; static int serial_fd = -1;
@ -507,46 +510,48 @@ currticks (void)
return ticks_per_csec + ticks_per_usec; return ticks_per_csec + ticks_per_usec;
} }
/* low-level character I/O */
void
console_cls (void)
{
#ifdef HAVE_LIBCURSES
if (use_curses)
clear ();
#endif
}
/* returns packed values, LSB+1 is x, LSB is y */
int
console_getxy (void)
{
int y, x;
#ifdef HAVE_LIBCURSES
if (use_curses)
getyx (stdscr, y, x);
else
#endif
y = x = 0;
return (x << 8) | (y & 0xff);
}
void
console_gotoxy (int x, int y)
{
#ifdef HAVE_LIBCURSES
if (use_curses)
move (y, x);
#endif
}
/* displays an ASCII character. IBM displays will translate some /* displays an ASCII character. IBM displays will translate some
characters to special graphical ones */ characters to special graphical ones */
void void
console_putchar (int c) console_putchar (int c)
{ {
/* Curses doesn't have VGA fonts. */
switch (c)
{
case DISP_UL:
c = ACS_ULCORNER;
break;
case DISP_UR:
c = ACS_URCORNER;
break;
case DISP_LL:
c = ACS_LLCORNER;
break;
case DISP_LR:
c = ACS_LRCORNER;
break;
case DISP_HORIZ:
c = ACS_HLINE;
break;
case DISP_VERT:
c = ACS_VLINE;
break;
case DISP_LEFT:
c = ACS_LARROW;
break;
case DISP_RIGHT:
c = ACS_RARROW;
break;
case DISP_UP:
c = ACS_UARROW;
break;
case DISP_DOWN:
c = ACS_DARROW;
break;
default:
break;
}
#ifdef HAVE_LIBCURSES #ifdef HAVE_LIBCURSES
if (use_curses) if (use_curses)
{ {
@ -562,14 +567,27 @@ console_putchar (int c)
else else
move (y + 1, x); move (y + 1, x);
} }
else if (isprint (c))
{
int x, y;
getyx (stdscr, y, x);
if (x + 1 == COLS)
{
console_putchar ('\r');
console_putchar ('\n');
}
addch (c | console_current_color);
}
else else
{ {
addch (c); addch (c);
}
#ifdef REFRESH_IMMEDIATELY #ifdef REFRESH_IMMEDIATELY
refresh (); refresh ();
#endif #endif
} }
}
else else
#endif #endif
{ {
@ -579,7 +597,6 @@ console_putchar (int c)
} }
} }
/* The store for ungetch simulation. This is necessary, because /* The store for ungetch simulation. This is necessary, because
ncurses-1.9.9g is still used in the world and its ungetch is ncurses-1.9.9g is still used in the world and its ungetch is
completely broken. */ completely broken. */
@ -587,38 +604,34 @@ console_putchar (int c)
static int save_char = ERR; static int save_char = ERR;
#endif #endif
/* returns packed BIOS/ASCII code */ static int
int console_translate_key (int c)
console_getkey (void)
{ {
int c; switch (c)
#ifdef HAVE_LIBCURSES
if (use_curses)
{ {
/* If checkkey has already got a character, then return it. */ case KEY_LEFT:
if (save_char != ERR) return 2;
{ case KEY_RIGHT:
c = save_char; return 6;
save_char = ERR; case KEY_UP:
return c; return 16;
case KEY_DOWN:
return 14;
case KEY_DC:
return 4;
case KEY_BACKSPACE:
return 8;
case KEY_HOME:
return 1;
case KEY_END:
return 5;
default:
break;
} }
wtimeout (stdscr, -1);
c = getch ();
wtimeout (stdscr, 100);
}
else
#endif
c = getchar ();
/* Quit if we get EOF. */
if (c == -1)
stop ();
return c; return c;
} }
/* like 'getkey', but doesn't wait, returns -1 if nothing available */ /* like 'getkey', but doesn't wait, returns -1 if nothing available */
int int
console_checkkey (void) console_checkkey (void)
@ -637,7 +650,7 @@ console_checkkey (void)
/* If C is not ERR, then put it back in the input queue. */ /* If C is not ERR, then put it back in the input queue. */
if (c != ERR) if (c != ERR)
save_char = c; save_char = c;
return c; return console_translate_key (c);
} }
#endif #endif
@ -646,23 +659,87 @@ console_checkkey (void)
return ' '; return ' ';
} }
/* returns packed BIOS/ASCII code */
/* sets text mode character attribute at the cursor position */ int
void console_getkey (void)
console_set_attrib (int attr)
{ {
int c;
#ifdef HAVE_LIBCURSES #ifdef HAVE_LIBCURSES
if (use_curses) if (use_curses)
{ {
/* FIXME: I don't know why, but chgat doesn't work as expected, so /* If checkkey has already got a character, then return it. */
use this dirty way... - okuji */ if (save_char != ERR)
chtype ch = inch (); {
addch ((ch & A_CHARTEXT) | attr); c = save_char;
# if 0 save_char = ERR;
chgat (1, attr, 0, NULL); return console_translate_key (c);
# endif
} }
wtimeout (stdscr, -1);
c = getch ();
wtimeout (stdscr, 100);
}
else
#endif #endif
c = getchar ();
/* Quit if we get EOF. */
if (c == -1)
stop ();
return console_translate_key (c);
}
/* returns packed values, LSB+1 is x, LSB is y */
int
console_getxy (void)
{
int y, x;
#ifdef HAVE_LIBCURSES
if (use_curses)
getyx (stdscr, y, x);
else
#endif
y = x = 0;
return (x << 8) | (y & 0xff);
}
void
console_gotoxy (int x, int y)
{
#ifdef HAVE_LIBCURSES
if (use_curses)
move (y, x);
#endif
}
/* low-level character I/O */
void
console_cls (void)
{
#ifdef HAVE_LIBCURSES
if (use_curses)
clear ();
#endif
}
void
console_highlight (int state)
{
console_current_color = state ? A_REVERSE : A_NORMAL;
}
void
console_setcolor (int normal_color, int highlight_color)
{
/* Nothing to do. */
}
void
console_nocursor (void)
{
/* Nothing to do. */
} }
/* Low-level disk I/O. Our stubbed version just returns a file /* Low-level disk I/O. Our stubbed version just returns a file
@ -923,71 +1000,50 @@ stop_floppy (void)
/* NOTUSED */ /* NOTUSED */
} }
/* The serial version of getkey. */ /* Fetch a key from a serial device. */
int int
serial_getkey (void) serial_hw_fetch (void)
{
char c;
#ifdef SIMULATE_SLOWNESS_OF_SERIAL
struct timeval otv, tv;
gettimeofday (&otv, 0);
#endif /* SIMULATE_SLOWNESS_OF_SERIAL */
if (nread (serial_fd, &c, 1) != 1)
stop ();
#ifdef SIMULATE_SLOWNESS_OF_SERIAL
while (1)
{
long delta;
gettimeofday (&tv, 0);
delta = tv.tv_usec - otv.tv_usec;
if (delta < 0)
delta += 1000000;
if (delta >= 1000000 / (serial_speed >> 3))
break;
}
#endif /* SIMULATE_SLOWNESS_OF_SERIAL */
return c;
}
/* The serial version of checkkey. */
int
serial_checkkey (void)
{ {
fd_set fds; fd_set fds;
struct timeval to; struct timeval to;
char c;
/* Wait only for the serial device. */ /* Wait only for the serial device. */
FD_ZERO (&fds); FD_ZERO (&fds);
FD_SET (serial_fd, &fds); FD_SET (serial_fd, &fds);
/* Set the timeout to 100ms. */
to.tv_sec = 0; to.tv_sec = 0;
to.tv_usec = 100000; to.tv_usec = 0;
return select (serial_fd + 1, &fds, 0, 0, &to) > 0 ? : -1; if (select (serial_fd + 1, &fds, 0, 0, &to) > 0)
{
if (nread (serial_fd, &c, 1) != 1)
stop ();
return c;
}
return -1;
} }
/* The serial version of grub_putchar. */ /* Put a character to a serial device. */
void void
serial_putchar (int c) serial_hw_put (int c)
{ {
char ch = (char) c; char ch = (char) c;
if (nwrite (serial_fd, &ch, 1) != 1)
stop ();
}
void
serial_hw_delay (void)
{
#ifdef SIMULATE_SLOWNESS_OF_SERIAL #ifdef SIMULATE_SLOWNESS_OF_SERIAL
struct timeval otv, tv; struct timeval otv, tv;
gettimeofday (&otv, 0); gettimeofday (&otv, 0);
#endif /* SIMULATE_SLOWNESS_OF_SERIAL */
if (nwrite (serial_fd, &ch, 1) != 1)
stop ();
#ifdef SIMULATE_SLOWNESS_OF_SERIAL
while (1) while (1)
{ {
long delta; long delta;
@ -1027,25 +1083,19 @@ get_termios_speed (int speed)
/* Get the port number of the unit UNIT. In the grub shell, this doesn't /* Get the port number of the unit UNIT. In the grub shell, this doesn't
make sense. */ make sense. */
unsigned short unsigned short
serial_get_port (int unit) serial_hw_get_port (int unit)
{ {
return 0; return 0;
} }
/* Check if a serial port is set up. */
int
serial_exists (void)
{
return serial_fd >= 0;
}
/* Initialize a serial device. In the grub shell, PORT is unused. */ /* Initialize a serial device. In the grub shell, PORT is unused. */
int int
serial_init (unsigned short port, unsigned int speed, serial_hw_init (unsigned short port, unsigned int speed,
int word_len, int parity, int stop_bit_len) int word_len, int parity, int stop_bit_len)
{ {
struct termios termios; struct termios termios;
speed_t termios_speed; speed_t termios_speed;
int i;
/* Check if the file name is specified. */ /* Check if the file name is specified. */
if (! serial_device) if (! serial_device)
@ -1143,6 +1193,16 @@ serial_init (unsigned short port, unsigned int speed,
serial_speed = speed; serial_speed = speed;
#endif /* SIMUATE_SLOWNESS_OF_SERIAL */ #endif /* SIMUATE_SLOWNESS_OF_SERIAL */
/* Get rid of the flag TERM_NEED_INIT from the serial terminal. */
for (i = 0; term_table[i].name; i++)
{
if (strcmp (term_table[i].name, "serial") == 0)
{
term_table[i].flags &= ~(TERM_NEED_INIT);
break;
}
}
return 1; return 1;
fail: fail:
@ -1154,7 +1214,7 @@ serial_init (unsigned short port, unsigned int speed,
/* Set the file name of a serial device (or a pty device). This is a /* Set the file name of a serial device (or a pty device). This is a
function specific to the grub shell. */ function specific to the grub shell. */
void void
set_serial_device (const char *device) serial_set_device (const char *device)
{ {
if (serial_device) if (serial_device)
free (serial_device); free (serial_device);
@ -1164,31 +1224,43 @@ set_serial_device (const char *device)
/* There is no difference between console and hercules in the grub shell. */ /* There is no difference between console and hercules in the grub shell. */
void void
herc_cls (void) hercules_putchar (int c)
{ {
console_cls (); console_putchar (c);
} }
int int
herc_getxy (void) hercules_getxy (void)
{ {
return console_getxy (); return console_getxy ();
} }
void void
herc_gotoxy (int x, int y) hercules_gotoxy (int x, int y)
{ {
console_gotoxy (x, y); console_gotoxy (x, y);
} }
void void
herc_putchar (int c) hercules_cls (void)
{ {
console_putchar (c); console_cls ();
} }
void void
herc_set_attrib (int attr) hercules_highlight (int state)
{ {
console_set_attrib (attr); console_highlight (state);
}
void
hercules_setcolor (int normal_color, int highlight_color)
{
console_setcolor (normal_color, highlight_color);
}
void
hercules_nocursor (void)
{
console_nocursor ();
} }

View file

@ -30,7 +30,8 @@ int grub_stage2 (void);
#include <setjmp.h> #include <setjmp.h>
#define WITHOUT_LIBC_STUBS 1 #define WITHOUT_LIBC_STUBS 1
#include "shared.h" #include <shared.h>
#include <term.h>
char *program_name = 0; char *program_name = 0;
int use_config_file = 1; int use_config_file = 1;
@ -256,8 +257,8 @@ main (int argc, char **argv)
/* If we don't have curses (!HAVE_LIBCURSES or --no-curses or /* If we don't have curses (!HAVE_LIBCURSES or --no-curses or
--batch) put terminal to dumb for better handling of line i/o */ --batch) put terminal to dumb for better handling of line i/o */
if (!use_curses) if (! use_curses)
terminal |= TERMINAL_DUMB; current_term->flags = TERM_NO_EDIT | TERM_DUMB;
/* Transfer control to the stage2 simulator. */ /* Transfer control to the stage2 simulator. */
exit (grub_stage2 ()); exit (grub_stage2 ());

View file

@ -5,8 +5,9 @@ noinst_SCRIPTS = $(TESTS)
# For dist target. # For dist target.
noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \ noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \ fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \
imgact_aout.h jfs.h mb_header.h mb_info.h md5.h pc_slice.h \ imgact_aout.h jfs.h mb_header.h mb_info.h md5.h nbi.h \
serial.h shared.h smp-imps.h nbi.h vstafs.h xfs.h pc_slice.h serial.h shared.h smp-imps.h term.h nbi.h vstafs.h \
xfs.h
EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS)
# For <stage1.h>. # For <stage1.h>.
@ -14,10 +15,10 @@ INCLUDES = -I$(top_srcdir)/stage1
# The library for /sbin/grub. # The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c builtins.c common.c char_io.c cmdline.c \ libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
disk_io.c gunzip.c fsys_ffs.c fsys_ext2fs.c fsys_fat.c \ disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_jfs.c \
fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_vstafs.c \ fsys_minix.c fsys_reiserfs.c fsys_vstafs.c fsys_xfs.c gunzip.c \
fsys_xfs.c stage2.c md5.c md5.c serial.c stage2.c
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
-DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 \ -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 \
@ -81,11 +82,11 @@ STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1
# For stage2 target. # For stage2 target.
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c common.c \ pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
char_io.c cmdline.c disk_io.c gunzip.c fsys_ext2fs.c \ cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \ fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \
fsys_vstafs.c fsys_xfs.c hercules.c serial.c smp-imps.c \ fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c md5.c serial.c \
stage2.c md5.c smp-imps.c stage2.c
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK) pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)

View file

@ -96,8 +96,9 @@ noinst_SCRIPTS = $(TESTS)
# For dist target. # For dist target.
noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \ noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \ fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \
imgact_aout.h jfs.h mb_header.h mb_info.h md5.h pc_slice.h \ imgact_aout.h jfs.h mb_header.h mb_info.h md5.h nbi.h \
serial.h shared.h smp-imps.h nbi.h vstafs.h xfs.h pc_slice.h serial.h shared.h smp-imps.h term.h nbi.h vstafs.h \
xfs.h
EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS)
@ -106,10 +107,10 @@ INCLUDES = -I$(top_srcdir)/stage1
# The library for /sbin/grub. # The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c builtins.c common.c char_io.c cmdline.c \ libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
disk_io.c gunzip.c fsys_ffs.c fsys_ext2fs.c fsys_fat.c \ disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_jfs.c \
fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_vstafs.c \ fsys_minix.c fsys_reiserfs.c fsys_vstafs.c fsys_xfs.c gunzip.c \
fsys_xfs.c stage2.c md5.c md5.c serial.c stage2.c
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
@ -165,11 +166,11 @@ STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1
# For stage2 target. # For stage2 target.
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c common.c \ pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
char_io.c cmdline.c disk_io.c gunzip.c fsys_ext2fs.c \ cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \ fsys_fat.c fsys_ffs.c fsys_jfs.c fsys_minix.c fsys_reiserfs.c \
fsys_vstafs.c fsys_xfs.c hercules.c serial.c smp-imps.c \ fsys_vstafs.c fsys_xfs.c gunzip.c hercules.c md5.c serial.c \
stage2.c md5.c smp-imps.c stage2.c
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
pre_stage2_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
@ -311,15 +312,15 @@ LIBRARIES = $(noinst_LIBRARIES)
libgrub_a_AR = $(AR) cru libgrub_a_AR = $(AR) cru
libgrub_a_LIBADD = libgrub_a_LIBADD =
am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \ am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \
libgrub_a-builtins.$(OBJEXT) libgrub_a-common.$(OBJEXT) \ libgrub_a-builtins.$(OBJEXT) libgrub_a-char_io.$(OBJEXT) \
libgrub_a-char_io.$(OBJEXT) libgrub_a-cmdline.$(OBJEXT) \ libgrub_a-cmdline.$(OBJEXT) libgrub_a-common.$(OBJEXT) \
libgrub_a-disk_io.$(OBJEXT) libgrub_a-gunzip.$(OBJEXT) \ libgrub_a-disk_io.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \
libgrub_a-fsys_ffs.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \ libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_ffs.$(OBJEXT) \
libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_jfs.$(OBJEXT) \ libgrub_a-fsys_jfs.$(OBJEXT) libgrub_a-fsys_minix.$(OBJEXT) \
libgrub_a-fsys_minix.$(OBJEXT) \
libgrub_a-fsys_reiserfs.$(OBJEXT) \ libgrub_a-fsys_reiserfs.$(OBJEXT) \
libgrub_a-fsys_vstafs.$(OBJEXT) libgrub_a-fsys_xfs.$(OBJEXT) \ libgrub_a-fsys_vstafs.$(OBJEXT) libgrub_a-fsys_xfs.$(OBJEXT) \
libgrub_a-stage2.$(OBJEXT) libgrub_a-md5.$(OBJEXT) libgrub_a-gunzip.$(OBJEXT) libgrub_a-md5.$(OBJEXT) \
libgrub_a-serial.$(OBJEXT) libgrub_a-stage2.$(OBJEXT)
libgrub_a_OBJECTS = $(am_libgrub_a_OBJECTS) libgrub_a_OBJECTS = $(am_libgrub_a_OBJECTS)
EXTRA_PROGRAMS = nbloader.exec$(EXEEXT) pxeloader.exec$(EXEEXT) \ EXTRA_PROGRAMS = nbloader.exec$(EXEEXT) pxeloader.exec$(EXEEXT) \
diskless.exec$(EXEEXT) diskless.exec$(EXEEXT)
@ -350,9 +351,10 @@ PROGRAMS = $(noinst_PROGRAMS)
am_diskless_exec_OBJECTS = diskless_exec-asm.$(OBJEXT) \ am_diskless_exec_OBJECTS = diskless_exec-asm.$(OBJEXT) \
diskless_exec-bios.$(OBJEXT) diskless_exec-boot.$(OBJEXT) \ diskless_exec-bios.$(OBJEXT) diskless_exec-boot.$(OBJEXT) \
diskless_exec-builtins.$(OBJEXT) diskless_exec-common.$(OBJEXT) \ diskless_exec-builtins.$(OBJEXT) \
diskless_exec-char_io.$(OBJEXT) diskless_exec-cmdline.$(OBJEXT) \ diskless_exec-char_io.$(OBJEXT) diskless_exec-cmdline.$(OBJEXT) \
diskless_exec-disk_io.$(OBJEXT) diskless_exec-gunzip.$(OBJEXT) \ diskless_exec-common.$(OBJEXT) diskless_exec-console.$(OBJEXT) \
diskless_exec-disk_io.$(OBJEXT) \
diskless_exec-fsys_ext2fs.$(OBJEXT) \ diskless_exec-fsys_ext2fs.$(OBJEXT) \
diskless_exec-fsys_fat.$(OBJEXT) \ diskless_exec-fsys_fat.$(OBJEXT) \
diskless_exec-fsys_ffs.$(OBJEXT) \ diskless_exec-fsys_ffs.$(OBJEXT) \
@ -360,10 +362,10 @@ am_diskless_exec_OBJECTS = diskless_exec-asm.$(OBJEXT) \
diskless_exec-fsys_minix.$(OBJEXT) \ diskless_exec-fsys_minix.$(OBJEXT) \
diskless_exec-fsys_reiserfs.$(OBJEXT) \ diskless_exec-fsys_reiserfs.$(OBJEXT) \
diskless_exec-fsys_vstafs.$(OBJEXT) \ diskless_exec-fsys_vstafs.$(OBJEXT) \
diskless_exec-fsys_xfs.$(OBJEXT) \ diskless_exec-fsys_xfs.$(OBJEXT) diskless_exec-gunzip.$(OBJEXT) \
diskless_exec-hercules.$(OBJEXT) diskless_exec-serial.$(OBJEXT) \ diskless_exec-hercules.$(OBJEXT) diskless_exec-md5.$(OBJEXT) \
diskless_exec-smp-imps.$(OBJEXT) diskless_exec-stage2.$(OBJEXT) \ diskless_exec-serial.$(OBJEXT) diskless_exec-smp-imps.$(OBJEXT) \
diskless_exec-md5.$(OBJEXT) diskless_exec-stage2.$(OBJEXT)
diskless_exec_OBJECTS = $(am_diskless_exec_OBJECTS) diskless_exec_OBJECTS = $(am_diskless_exec_OBJECTS)
diskless_exec_DEPENDENCIES = ../netboot/libdrivers.a diskless_exec_DEPENDENCIES = ../netboot/libdrivers.a
am_e2fs_stage1_5_exec_OBJECTS = e2fs_stage1_5_exec-start.$(OBJEXT) \ am_e2fs_stage1_5_exec_OBJECTS = e2fs_stage1_5_exec-start.$(OBJEXT) \
@ -428,11 +430,11 @@ nbloader_exec_DEPENDENCIES =
am_pre_stage2_exec_OBJECTS = pre_stage2_exec-asm.$(OBJEXT) \ am_pre_stage2_exec_OBJECTS = pre_stage2_exec-asm.$(OBJEXT) \
pre_stage2_exec-bios.$(OBJEXT) pre_stage2_exec-boot.$(OBJEXT) \ pre_stage2_exec-bios.$(OBJEXT) pre_stage2_exec-boot.$(OBJEXT) \
pre_stage2_exec-builtins.$(OBJEXT) \ pre_stage2_exec-builtins.$(OBJEXT) \
pre_stage2_exec-common.$(OBJEXT) \
pre_stage2_exec-char_io.$(OBJEXT) \ pre_stage2_exec-char_io.$(OBJEXT) \
pre_stage2_exec-cmdline.$(OBJEXT) \ pre_stage2_exec-cmdline.$(OBJEXT) \
pre_stage2_exec-common.$(OBJEXT) \
pre_stage2_exec-console.$(OBJEXT) \
pre_stage2_exec-disk_io.$(OBJEXT) \ pre_stage2_exec-disk_io.$(OBJEXT) \
pre_stage2_exec-gunzip.$(OBJEXT) \
pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \ pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \
pre_stage2_exec-fsys_fat.$(OBJEXT) \ pre_stage2_exec-fsys_fat.$(OBJEXT) \
pre_stage2_exec-fsys_ffs.$(OBJEXT) \ pre_stage2_exec-fsys_ffs.$(OBJEXT) \
@ -441,10 +443,11 @@ am_pre_stage2_exec_OBJECTS = pre_stage2_exec-asm.$(OBJEXT) \
pre_stage2_exec-fsys_reiserfs.$(OBJEXT) \ pre_stage2_exec-fsys_reiserfs.$(OBJEXT) \
pre_stage2_exec-fsys_vstafs.$(OBJEXT) \ pre_stage2_exec-fsys_vstafs.$(OBJEXT) \
pre_stage2_exec-fsys_xfs.$(OBJEXT) \ pre_stage2_exec-fsys_xfs.$(OBJEXT) \
pre_stage2_exec-gunzip.$(OBJEXT) \
pre_stage2_exec-hercules.$(OBJEXT) \ pre_stage2_exec-hercules.$(OBJEXT) \
pre_stage2_exec-serial.$(OBJEXT) \ pre_stage2_exec-md5.$(OBJEXT) pre_stage2_exec-serial.$(OBJEXT) \
pre_stage2_exec-smp-imps.$(OBJEXT) \ pre_stage2_exec-smp-imps.$(OBJEXT) \
pre_stage2_exec-stage2.$(OBJEXT) pre_stage2_exec-md5.$(OBJEXT) pre_stage2_exec-stage2.$(OBJEXT)
pre_stage2_exec_OBJECTS = $(am_pre_stage2_exec_OBJECTS) pre_stage2_exec_OBJECTS = $(am_pre_stage2_exec_OBJECTS)
@NETBOOT_SUPPORT_TRUE@pre_stage2_exec_DEPENDENCIES = \ @NETBOOT_SUPPORT_TRUE@pre_stage2_exec_DEPENDENCIES = \
@NETBOOT_SUPPORT_TRUE@ ../netboot/libdrivers.a @NETBOOT_SUPPORT_TRUE@ ../netboot/libdrivers.a
@ -506,6 +509,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-char_io.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-char_io.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-cmdline.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-cmdline.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-common.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-common.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-console.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-disk_io.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-disk_io.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-fsys_ext2fs.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-fsys_ext2fs.Po \
@AMDEP_TRUE@ $(DEPDIR)/diskless_exec-fsys_fat.Po \ @AMDEP_TRUE@ $(DEPDIR)/diskless_exec-fsys_fat.Po \
@ -561,6 +565,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@ $(DEPDIR)/libgrub_a-fsys_xfs.Po \ @AMDEP_TRUE@ $(DEPDIR)/libgrub_a-fsys_xfs.Po \
@AMDEP_TRUE@ $(DEPDIR)/libgrub_a-gunzip.Po \ @AMDEP_TRUE@ $(DEPDIR)/libgrub_a-gunzip.Po \
@AMDEP_TRUE@ $(DEPDIR)/libgrub_a-md5.Po \ @AMDEP_TRUE@ $(DEPDIR)/libgrub_a-md5.Po \
@AMDEP_TRUE@ $(DEPDIR)/libgrub_a-serial.Po \
@AMDEP_TRUE@ $(DEPDIR)/libgrub_a-stage2.Po \ @AMDEP_TRUE@ $(DEPDIR)/libgrub_a-stage2.Po \
@AMDEP_TRUE@ $(DEPDIR)/minix_stage1_5_exec-bios.Po \ @AMDEP_TRUE@ $(DEPDIR)/minix_stage1_5_exec-bios.Po \
@AMDEP_TRUE@ $(DEPDIR)/minix_stage1_5_exec-char_io.Po \ @AMDEP_TRUE@ $(DEPDIR)/minix_stage1_5_exec-char_io.Po \
@ -574,6 +579,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-char_io.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-char_io.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-cmdline.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-cmdline.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-common.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-common.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-console.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-disk_io.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-disk_io.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po \
@AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-fsys_fat.Po \ @AMDEP_TRUE@ $(DEPDIR)/pre_stage2_exec-fsys_fat.Po \
@ -646,21 +652,22 @@ clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libgrub_a-boot.$(OBJEXT): boot.c libgrub_a-boot.$(OBJEXT): boot.c
libgrub_a-builtins.$(OBJEXT): builtins.c libgrub_a-builtins.$(OBJEXT): builtins.c
libgrub_a-common.$(OBJEXT): common.c
libgrub_a-char_io.$(OBJEXT): char_io.c libgrub_a-char_io.$(OBJEXT): char_io.c
libgrub_a-cmdline.$(OBJEXT): cmdline.c libgrub_a-cmdline.$(OBJEXT): cmdline.c
libgrub_a-common.$(OBJEXT): common.c
libgrub_a-disk_io.$(OBJEXT): disk_io.c libgrub_a-disk_io.$(OBJEXT): disk_io.c
libgrub_a-gunzip.$(OBJEXT): gunzip.c
libgrub_a-fsys_ffs.$(OBJEXT): fsys_ffs.c
libgrub_a-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c libgrub_a-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c
libgrub_a-fsys_fat.$(OBJEXT): fsys_fat.c libgrub_a-fsys_fat.$(OBJEXT): fsys_fat.c
libgrub_a-fsys_ffs.$(OBJEXT): fsys_ffs.c
libgrub_a-fsys_jfs.$(OBJEXT): fsys_jfs.c libgrub_a-fsys_jfs.$(OBJEXT): fsys_jfs.c
libgrub_a-fsys_minix.$(OBJEXT): fsys_minix.c libgrub_a-fsys_minix.$(OBJEXT): fsys_minix.c
libgrub_a-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c libgrub_a-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c
libgrub_a-fsys_vstafs.$(OBJEXT): fsys_vstafs.c libgrub_a-fsys_vstafs.$(OBJEXT): fsys_vstafs.c
libgrub_a-fsys_xfs.$(OBJEXT): fsys_xfs.c libgrub_a-fsys_xfs.$(OBJEXT): fsys_xfs.c
libgrub_a-stage2.$(OBJEXT): stage2.c libgrub_a-gunzip.$(OBJEXT): gunzip.c
libgrub_a-md5.$(OBJEXT): md5.c libgrub_a-md5.$(OBJEXT): md5.c
libgrub_a-serial.$(OBJEXT): serial.c
libgrub_a-stage2.$(OBJEXT): stage2.c
libgrub.a: $(libgrub_a_OBJECTS) $(libgrub_a_DEPENDENCIES) libgrub.a: $(libgrub_a_OBJECTS) $(libgrub_a_DEPENDENCIES)
-rm -f libgrub.a -rm -f libgrub.a
$(libgrub_a_AR) libgrub.a $(libgrub_a_OBJECTS) $(libgrub_a_LIBADD) $(libgrub_a_AR) libgrub.a $(libgrub_a_OBJECTS) $(libgrub_a_LIBADD)
@ -672,11 +679,11 @@ diskless_exec-asm.$(OBJEXT): asm.S
diskless_exec-bios.$(OBJEXT): bios.c diskless_exec-bios.$(OBJEXT): bios.c
diskless_exec-boot.$(OBJEXT): boot.c diskless_exec-boot.$(OBJEXT): boot.c
diskless_exec-builtins.$(OBJEXT): builtins.c diskless_exec-builtins.$(OBJEXT): builtins.c
diskless_exec-common.$(OBJEXT): common.c
diskless_exec-char_io.$(OBJEXT): char_io.c diskless_exec-char_io.$(OBJEXT): char_io.c
diskless_exec-cmdline.$(OBJEXT): cmdline.c diskless_exec-cmdline.$(OBJEXT): cmdline.c
diskless_exec-common.$(OBJEXT): common.c
diskless_exec-console.$(OBJEXT): console.c
diskless_exec-disk_io.$(OBJEXT): disk_io.c diskless_exec-disk_io.$(OBJEXT): disk_io.c
diskless_exec-gunzip.$(OBJEXT): gunzip.c
diskless_exec-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c diskless_exec-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c
diskless_exec-fsys_fat.$(OBJEXT): fsys_fat.c diskless_exec-fsys_fat.$(OBJEXT): fsys_fat.c
diskless_exec-fsys_ffs.$(OBJEXT): fsys_ffs.c diskless_exec-fsys_ffs.$(OBJEXT): fsys_ffs.c
@ -685,11 +692,12 @@ diskless_exec-fsys_minix.$(OBJEXT): fsys_minix.c
diskless_exec-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c diskless_exec-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c
diskless_exec-fsys_vstafs.$(OBJEXT): fsys_vstafs.c diskless_exec-fsys_vstafs.$(OBJEXT): fsys_vstafs.c
diskless_exec-fsys_xfs.$(OBJEXT): fsys_xfs.c diskless_exec-fsys_xfs.$(OBJEXT): fsys_xfs.c
diskless_exec-gunzip.$(OBJEXT): gunzip.c
diskless_exec-hercules.$(OBJEXT): hercules.c diskless_exec-hercules.$(OBJEXT): hercules.c
diskless_exec-md5.$(OBJEXT): md5.c
diskless_exec-serial.$(OBJEXT): serial.c diskless_exec-serial.$(OBJEXT): serial.c
diskless_exec-smp-imps.$(OBJEXT): smp-imps.c diskless_exec-smp-imps.$(OBJEXT): smp-imps.c
diskless_exec-stage2.$(OBJEXT): stage2.c diskless_exec-stage2.$(OBJEXT): stage2.c
diskless_exec-md5.$(OBJEXT): md5.c
diskless.exec$(EXEEXT): $(diskless_exec_OBJECTS) $(diskless_exec_DEPENDENCIES) diskless.exec$(EXEEXT): $(diskless_exec_OBJECTS) $(diskless_exec_DEPENDENCIES)
@rm -f diskless.exec$(EXEEXT) @rm -f diskless.exec$(EXEEXT)
$(LINK) $(diskless_exec_LDFLAGS) $(diskless_exec_OBJECTS) $(diskless_exec_LDADD) $(LIBS) $(LINK) $(diskless_exec_LDFLAGS) $(diskless_exec_OBJECTS) $(diskless_exec_LDADD) $(LIBS)
@ -756,11 +764,11 @@ pre_stage2_exec-asm.$(OBJEXT): asm.S
pre_stage2_exec-bios.$(OBJEXT): bios.c pre_stage2_exec-bios.$(OBJEXT): bios.c
pre_stage2_exec-boot.$(OBJEXT): boot.c pre_stage2_exec-boot.$(OBJEXT): boot.c
pre_stage2_exec-builtins.$(OBJEXT): builtins.c pre_stage2_exec-builtins.$(OBJEXT): builtins.c
pre_stage2_exec-common.$(OBJEXT): common.c
pre_stage2_exec-char_io.$(OBJEXT): char_io.c pre_stage2_exec-char_io.$(OBJEXT): char_io.c
pre_stage2_exec-cmdline.$(OBJEXT): cmdline.c pre_stage2_exec-cmdline.$(OBJEXT): cmdline.c
pre_stage2_exec-common.$(OBJEXT): common.c
pre_stage2_exec-console.$(OBJEXT): console.c
pre_stage2_exec-disk_io.$(OBJEXT): disk_io.c pre_stage2_exec-disk_io.$(OBJEXT): disk_io.c
pre_stage2_exec-gunzip.$(OBJEXT): gunzip.c
pre_stage2_exec-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c pre_stage2_exec-fsys_ext2fs.$(OBJEXT): fsys_ext2fs.c
pre_stage2_exec-fsys_fat.$(OBJEXT): fsys_fat.c pre_stage2_exec-fsys_fat.$(OBJEXT): fsys_fat.c
pre_stage2_exec-fsys_ffs.$(OBJEXT): fsys_ffs.c pre_stage2_exec-fsys_ffs.$(OBJEXT): fsys_ffs.c
@ -769,11 +777,12 @@ pre_stage2_exec-fsys_minix.$(OBJEXT): fsys_minix.c
pre_stage2_exec-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c pre_stage2_exec-fsys_reiserfs.$(OBJEXT): fsys_reiserfs.c
pre_stage2_exec-fsys_vstafs.$(OBJEXT): fsys_vstafs.c pre_stage2_exec-fsys_vstafs.$(OBJEXT): fsys_vstafs.c
pre_stage2_exec-fsys_xfs.$(OBJEXT): fsys_xfs.c pre_stage2_exec-fsys_xfs.$(OBJEXT): fsys_xfs.c
pre_stage2_exec-gunzip.$(OBJEXT): gunzip.c
pre_stage2_exec-hercules.$(OBJEXT): hercules.c pre_stage2_exec-hercules.$(OBJEXT): hercules.c
pre_stage2_exec-md5.$(OBJEXT): md5.c
pre_stage2_exec-serial.$(OBJEXT): serial.c pre_stage2_exec-serial.$(OBJEXT): serial.c
pre_stage2_exec-smp-imps.$(OBJEXT): smp-imps.c pre_stage2_exec-smp-imps.$(OBJEXT): smp-imps.c
pre_stage2_exec-stage2.$(OBJEXT): stage2.c pre_stage2_exec-stage2.$(OBJEXT): stage2.c
pre_stage2_exec-md5.$(OBJEXT): md5.c
pre_stage2.exec$(EXEEXT): $(pre_stage2_exec_OBJECTS) $(pre_stage2_exec_DEPENDENCIES) pre_stage2.exec$(EXEEXT): $(pre_stage2_exec_OBJECTS) $(pre_stage2_exec_DEPENDENCIES)
@rm -f pre_stage2.exec$(EXEEXT) @rm -f pre_stage2.exec$(EXEEXT)
$(LINK) $(pre_stage2_exec_LDFLAGS) $(pre_stage2_exec_OBJECTS) $(pre_stage2_exec_LDADD) $(LIBS) $(LINK) $(pre_stage2_exec_LDFLAGS) $(pre_stage2_exec_OBJECTS) $(pre_stage2_exec_LDADD) $(LIBS)
@ -831,6 +840,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-char_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-char_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-console.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@
@ -886,6 +896,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-fsys_xfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-fsys_xfs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-gunzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-gunzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-md5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-serial.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-stage2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgrub_a-stage2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/minix_stage1_5_exec-bios.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/minix_stage1_5_exec-bios.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/minix_stage1_5_exec-char_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/minix_stage1_5_exec-char_io.Po@am__quote@
@ -899,6 +910,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-char_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-char_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-console.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@
@ -1104,18 +1116,6 @@ libgrub_a-builtins.obj: builtins.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-builtins.obj `cygpath -w builtins.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-builtins.obj `cygpath -w builtins.c`
libgrub_a-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='libgrub_a-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-common.Po' tmpdepfile='$(DEPDIR)/libgrub_a-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.o `test -f common.c || echo '$(srcdir)/'`common.c
libgrub_a-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='libgrub_a-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-common.Po' tmpdepfile='$(DEPDIR)/libgrub_a-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `cygpath -w common.c`
libgrub_a-char_io.o: char_io.c libgrub_a-char_io.o: char_io.c
@AMDEP_TRUE@ source='char_io.c' object='libgrub_a-char_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='char_io.c' object='libgrub_a-char_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-char_io.Po' tmpdepfile='$(DEPDIR)/libgrub_a-char_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-char_io.Po' tmpdepfile='$(DEPDIR)/libgrub_a-char_io.TPo' @AMDEPBACKSLASH@
@ -1140,6 +1140,18 @@ libgrub_a-cmdline.obj: cmdline.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-cmdline.obj `cygpath -w cmdline.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-cmdline.obj `cygpath -w cmdline.c`
libgrub_a-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='libgrub_a-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-common.Po' tmpdepfile='$(DEPDIR)/libgrub_a-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.o `test -f common.c || echo '$(srcdir)/'`common.c
libgrub_a-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='libgrub_a-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-common.Po' tmpdepfile='$(DEPDIR)/libgrub_a-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `cygpath -w common.c`
libgrub_a-disk_io.o: disk_io.c libgrub_a-disk_io.o: disk_io.c
@AMDEP_TRUE@ source='disk_io.c' object='libgrub_a-disk_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='disk_io.c' object='libgrub_a-disk_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-disk_io.Po' tmpdepfile='$(DEPDIR)/libgrub_a-disk_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-disk_io.Po' tmpdepfile='$(DEPDIR)/libgrub_a-disk_io.TPo' @AMDEPBACKSLASH@
@ -1152,30 +1164,6 @@ libgrub_a-disk_io.obj: disk_io.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-disk_io.obj `cygpath -w disk_io.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-disk_io.obj `cygpath -w disk_io.c`
libgrub_a-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='libgrub_a-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-gunzip.Po' tmpdepfile='$(DEPDIR)/libgrub_a-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
libgrub_a-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='libgrub_a-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-gunzip.Po' tmpdepfile='$(DEPDIR)/libgrub_a-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-gunzip.obj `cygpath -w gunzip.c`
libgrub_a-fsys_ffs.o: fsys_ffs.c
@AMDEP_TRUE@ source='fsys_ffs.c' object='libgrub_a-fsys_ffs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ffs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ffs.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_ffs.o `test -f fsys_ffs.c || echo '$(srcdir)/'`fsys_ffs.c
libgrub_a-fsys_ffs.obj: fsys_ffs.c
@AMDEP_TRUE@ source='fsys_ffs.c' object='libgrub_a-fsys_ffs.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ffs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ffs.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_ffs.obj `cygpath -w fsys_ffs.c`
libgrub_a-fsys_ext2fs.o: fsys_ext2fs.c libgrub_a-fsys_ext2fs.o: fsys_ext2fs.c
@AMDEP_TRUE@ source='fsys_ext2fs.c' object='libgrub_a-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='fsys_ext2fs.c' object='libgrub_a-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ext2fs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ext2fs.TPo' @AMDEPBACKSLASH@
@ -1200,6 +1188,18 @@ libgrub_a-fsys_fat.obj: fsys_fat.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_fat.obj `cygpath -w fsys_fat.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_fat.obj `cygpath -w fsys_fat.c`
libgrub_a-fsys_ffs.o: fsys_ffs.c
@AMDEP_TRUE@ source='fsys_ffs.c' object='libgrub_a-fsys_ffs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ffs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ffs.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_ffs.o `test -f fsys_ffs.c || echo '$(srcdir)/'`fsys_ffs.c
libgrub_a-fsys_ffs.obj: fsys_ffs.c
@AMDEP_TRUE@ source='fsys_ffs.c' object='libgrub_a-fsys_ffs.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_ffs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_ffs.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_ffs.obj `cygpath -w fsys_ffs.c`
libgrub_a-fsys_jfs.o: fsys_jfs.c libgrub_a-fsys_jfs.o: fsys_jfs.c
@AMDEP_TRUE@ source='fsys_jfs.c' object='libgrub_a-fsys_jfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='fsys_jfs.c' object='libgrub_a-fsys_jfs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_jfs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_jfs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-fsys_jfs.Po' tmpdepfile='$(DEPDIR)/libgrub_a-fsys_jfs.TPo' @AMDEPBACKSLASH@
@ -1260,17 +1260,17 @@ libgrub_a-fsys_xfs.obj: fsys_xfs.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_xfs.obj `cygpath -w fsys_xfs.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-fsys_xfs.obj `cygpath -w fsys_xfs.c`
libgrub_a-stage2.o: stage2.c libgrub_a-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='stage2.c' object='libgrub_a-stage2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='gunzip.c' object='libgrub_a-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-stage2.Po' tmpdepfile='$(DEPDIR)/libgrub_a-stage2.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-gunzip.Po' tmpdepfile='$(DEPDIR)/libgrub_a-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-stage2.o `test -f stage2.c || echo '$(srcdir)/'`stage2.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
libgrub_a-stage2.obj: stage2.c libgrub_a-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='stage2.c' object='libgrub_a-stage2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='gunzip.c' object='libgrub_a-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-stage2.Po' tmpdepfile='$(DEPDIR)/libgrub_a-stage2.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-gunzip.Po' tmpdepfile='$(DEPDIR)/libgrub_a-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-stage2.obj `cygpath -w stage2.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-gunzip.obj `cygpath -w gunzip.c`
libgrub_a-md5.o: md5.c libgrub_a-md5.o: md5.c
@AMDEP_TRUE@ source='md5.c' object='libgrub_a-md5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='md5.c' object='libgrub_a-md5.o' libtool=no @AMDEPBACKSLASH@
@ -1284,6 +1284,30 @@ libgrub_a-md5.obj: md5.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-md5.obj `cygpath -w md5.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-md5.obj `cygpath -w md5.c`
libgrub_a-serial.o: serial.c
@AMDEP_TRUE@ source='serial.c' object='libgrub_a-serial.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-serial.Po' tmpdepfile='$(DEPDIR)/libgrub_a-serial.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-serial.o `test -f serial.c || echo '$(srcdir)/'`serial.c
libgrub_a-serial.obj: serial.c
@AMDEP_TRUE@ source='serial.c' object='libgrub_a-serial.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-serial.Po' tmpdepfile='$(DEPDIR)/libgrub_a-serial.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-serial.obj `cygpath -w serial.c`
libgrub_a-stage2.o: stage2.c
@AMDEP_TRUE@ source='stage2.c' object='libgrub_a-stage2.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-stage2.Po' tmpdepfile='$(DEPDIR)/libgrub_a-stage2.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-stage2.o `test -f stage2.c || echo '$(srcdir)/'`stage2.c
libgrub_a-stage2.obj: stage2.c
@AMDEP_TRUE@ source='stage2.c' object='libgrub_a-stage2.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgrub_a-stage2.Po' tmpdepfile='$(DEPDIR)/libgrub_a-stage2.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-stage2.obj `cygpath -w stage2.c`
diskless_exec-bios.o: bios.c diskless_exec-bios.o: bios.c
@AMDEP_TRUE@ source='bios.c' object='diskless_exec-bios.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='bios.c' object='diskless_exec-bios.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-bios.Po' tmpdepfile='$(DEPDIR)/diskless_exec-bios.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-bios.Po' tmpdepfile='$(DEPDIR)/diskless_exec-bios.TPo' @AMDEPBACKSLASH@
@ -1320,18 +1344,6 @@ diskless_exec-builtins.obj: builtins.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-builtins.obj `cygpath -w builtins.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-builtins.obj `cygpath -w builtins.c`
diskless_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='diskless_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-common.Po' tmpdepfile='$(DEPDIR)/diskless_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-common.o `test -f common.c || echo '$(srcdir)/'`common.c
diskless_exec-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='diskless_exec-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-common.Po' tmpdepfile='$(DEPDIR)/diskless_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-common.obj `cygpath -w common.c`
diskless_exec-char_io.o: char_io.c diskless_exec-char_io.o: char_io.c
@AMDEP_TRUE@ source='char_io.c' object='diskless_exec-char_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='char_io.c' object='diskless_exec-char_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-char_io.Po' tmpdepfile='$(DEPDIR)/diskless_exec-char_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-char_io.Po' tmpdepfile='$(DEPDIR)/diskless_exec-char_io.TPo' @AMDEPBACKSLASH@
@ -1356,6 +1368,30 @@ diskless_exec-cmdline.obj: cmdline.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-cmdline.obj `cygpath -w cmdline.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-cmdline.obj `cygpath -w cmdline.c`
diskless_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='diskless_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-common.Po' tmpdepfile='$(DEPDIR)/diskless_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-common.o `test -f common.c || echo '$(srcdir)/'`common.c
diskless_exec-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='diskless_exec-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-common.Po' tmpdepfile='$(DEPDIR)/diskless_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-common.obj `cygpath -w common.c`
diskless_exec-console.o: console.c
@AMDEP_TRUE@ source='console.c' object='diskless_exec-console.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-console.Po' tmpdepfile='$(DEPDIR)/diskless_exec-console.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.o `test -f console.c || echo '$(srcdir)/'`console.c
diskless_exec-console.obj: console.c
@AMDEP_TRUE@ source='console.c' object='diskless_exec-console.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-console.Po' tmpdepfile='$(DEPDIR)/diskless_exec-console.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.obj `cygpath -w console.c`
diskless_exec-disk_io.o: disk_io.c diskless_exec-disk_io.o: disk_io.c
@AMDEP_TRUE@ source='disk_io.c' object='diskless_exec-disk_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='disk_io.c' object='diskless_exec-disk_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-disk_io.Po' tmpdepfile='$(DEPDIR)/diskless_exec-disk_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-disk_io.Po' tmpdepfile='$(DEPDIR)/diskless_exec-disk_io.TPo' @AMDEPBACKSLASH@
@ -1368,18 +1404,6 @@ diskless_exec-disk_io.obj: disk_io.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-disk_io.obj `cygpath -w disk_io.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-disk_io.obj `cygpath -w disk_io.c`
diskless_exec-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='diskless_exec-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/diskless_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
diskless_exec-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='diskless_exec-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/diskless_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-gunzip.obj `cygpath -w gunzip.c`
diskless_exec-fsys_ext2fs.o: fsys_ext2fs.c diskless_exec-fsys_ext2fs.o: fsys_ext2fs.c
@AMDEP_TRUE@ source='fsys_ext2fs.c' object='diskless_exec-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='fsys_ext2fs.c' object='diskless_exec-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/diskless_exec-fsys_ext2fs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/diskless_exec-fsys_ext2fs.TPo' @AMDEPBACKSLASH@
@ -1476,6 +1500,18 @@ diskless_exec-fsys_xfs.obj: fsys_xfs.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-fsys_xfs.obj `cygpath -w fsys_xfs.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-fsys_xfs.obj `cygpath -w fsys_xfs.c`
diskless_exec-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='diskless_exec-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/diskless_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
diskless_exec-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='diskless_exec-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/diskless_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-gunzip.obj `cygpath -w gunzip.c`
diskless_exec-hercules.o: hercules.c diskless_exec-hercules.o: hercules.c
@AMDEP_TRUE@ source='hercules.c' object='diskless_exec-hercules.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='hercules.c' object='diskless_exec-hercules.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-hercules.Po' tmpdepfile='$(DEPDIR)/diskless_exec-hercules.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-hercules.Po' tmpdepfile='$(DEPDIR)/diskless_exec-hercules.TPo' @AMDEPBACKSLASH@
@ -1488,6 +1524,18 @@ diskless_exec-hercules.obj: hercules.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-hercules.obj `cygpath -w hercules.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-hercules.obj `cygpath -w hercules.c`
diskless_exec-md5.o: md5.c
@AMDEP_TRUE@ source='md5.c' object='diskless_exec-md5.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-md5.Po' tmpdepfile='$(DEPDIR)/diskless_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-md5.o `test -f md5.c || echo '$(srcdir)/'`md5.c
diskless_exec-md5.obj: md5.c
@AMDEP_TRUE@ source='md5.c' object='diskless_exec-md5.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-md5.Po' tmpdepfile='$(DEPDIR)/diskless_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-md5.obj `cygpath -w md5.c`
diskless_exec-serial.o: serial.c diskless_exec-serial.o: serial.c
@AMDEP_TRUE@ source='serial.c' object='diskless_exec-serial.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='serial.c' object='diskless_exec-serial.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-serial.Po' tmpdepfile='$(DEPDIR)/diskless_exec-serial.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-serial.Po' tmpdepfile='$(DEPDIR)/diskless_exec-serial.TPo' @AMDEPBACKSLASH@
@ -1524,18 +1572,6 @@ diskless_exec-stage2.obj: stage2.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-stage2.obj `cygpath -w stage2.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-stage2.obj `cygpath -w stage2.c`
diskless_exec-md5.o: md5.c
@AMDEP_TRUE@ source='md5.c' object='diskless_exec-md5.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-md5.Po' tmpdepfile='$(DEPDIR)/diskless_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-md5.o `test -f md5.c || echo '$(srcdir)/'`md5.c
diskless_exec-md5.obj: md5.c
@AMDEP_TRUE@ source='md5.c' object='diskless_exec-md5.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/diskless_exec-md5.Po' tmpdepfile='$(DEPDIR)/diskless_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-md5.obj `cygpath -w md5.c`
e2fs_stage1_5_exec-common.o: common.c e2fs_stage1_5_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='e2fs_stage1_5_exec-common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='common.c' object='e2fs_stage1_5_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/e2fs_stage1_5_exec-common.Po' tmpdepfile='$(DEPDIR)/e2fs_stage1_5_exec-common.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/e2fs_stage1_5_exec-common.Po' tmpdepfile='$(DEPDIR)/e2fs_stage1_5_exec-common.TPo' @AMDEPBACKSLASH@
@ -1932,18 +1968,6 @@ pre_stage2_exec-builtins.obj: builtins.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-builtins.obj `cygpath -w builtins.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-builtins.obj `cygpath -w builtins.c`
pre_stage2_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='pre_stage2_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-common.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-common.o `test -f common.c || echo '$(srcdir)/'`common.c
pre_stage2_exec-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='pre_stage2_exec-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-common.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-common.obj `cygpath -w common.c`
pre_stage2_exec-char_io.o: char_io.c pre_stage2_exec-char_io.o: char_io.c
@AMDEP_TRUE@ source='char_io.c' object='pre_stage2_exec-char_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='char_io.c' object='pre_stage2_exec-char_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-char_io.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-char_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-char_io.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-char_io.TPo' @AMDEPBACKSLASH@
@ -1968,6 +1992,30 @@ pre_stage2_exec-cmdline.obj: cmdline.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-cmdline.obj `cygpath -w cmdline.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-cmdline.obj `cygpath -w cmdline.c`
pre_stage2_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='pre_stage2_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-common.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-common.o `test -f common.c || echo '$(srcdir)/'`common.c
pre_stage2_exec-common.obj: common.c
@AMDEP_TRUE@ source='common.c' object='pre_stage2_exec-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-common.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-common.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-common.obj `cygpath -w common.c`
pre_stage2_exec-console.o: console.c
@AMDEP_TRUE@ source='console.c' object='pre_stage2_exec-console.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-console.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-console.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.o `test -f console.c || echo '$(srcdir)/'`console.c
pre_stage2_exec-console.obj: console.c
@AMDEP_TRUE@ source='console.c' object='pre_stage2_exec-console.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-console.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-console.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.obj `cygpath -w console.c`
pre_stage2_exec-disk_io.o: disk_io.c pre_stage2_exec-disk_io.o: disk_io.c
@AMDEP_TRUE@ source='disk_io.c' object='pre_stage2_exec-disk_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='disk_io.c' object='pre_stage2_exec-disk_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-disk_io.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-disk_io.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-disk_io.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-disk_io.TPo' @AMDEPBACKSLASH@
@ -1980,18 +2028,6 @@ pre_stage2_exec-disk_io.obj: disk_io.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-disk_io.obj `cygpath -w disk_io.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-disk_io.obj `cygpath -w disk_io.c`
pre_stage2_exec-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='pre_stage2_exec-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
pre_stage2_exec-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='pre_stage2_exec-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-gunzip.obj `cygpath -w gunzip.c`
pre_stage2_exec-fsys_ext2fs.o: fsys_ext2fs.c pre_stage2_exec-fsys_ext2fs.o: fsys_ext2fs.c
@AMDEP_TRUE@ source='fsys_ext2fs.c' object='pre_stage2_exec-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='fsys_ext2fs.c' object='pre_stage2_exec-fsys_ext2fs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.TPo' @AMDEPBACKSLASH@
@ -2088,6 +2124,18 @@ pre_stage2_exec-fsys_xfs.obj: fsys_xfs.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-fsys_xfs.obj `cygpath -w fsys_xfs.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-fsys_xfs.obj `cygpath -w fsys_xfs.c`
pre_stage2_exec-gunzip.o: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='pre_stage2_exec-gunzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-gunzip.o `test -f gunzip.c || echo '$(srcdir)/'`gunzip.c
pre_stage2_exec-gunzip.obj: gunzip.c
@AMDEP_TRUE@ source='gunzip.c' object='pre_stage2_exec-gunzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-gunzip.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-gunzip.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-gunzip.obj `cygpath -w gunzip.c`
pre_stage2_exec-hercules.o: hercules.c pre_stage2_exec-hercules.o: hercules.c
@AMDEP_TRUE@ source='hercules.c' object='pre_stage2_exec-hercules.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='hercules.c' object='pre_stage2_exec-hercules.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-hercules.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-hercules.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-hercules.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-hercules.TPo' @AMDEPBACKSLASH@
@ -2100,6 +2148,18 @@ pre_stage2_exec-hercules.obj: hercules.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-hercules.obj `cygpath -w hercules.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-hercules.obj `cygpath -w hercules.c`
pre_stage2_exec-md5.o: md5.c
@AMDEP_TRUE@ source='md5.c' object='pre_stage2_exec-md5.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-md5.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-md5.o `test -f md5.c || echo '$(srcdir)/'`md5.c
pre_stage2_exec-md5.obj: md5.c
@AMDEP_TRUE@ source='md5.c' object='pre_stage2_exec-md5.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-md5.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-md5.obj `cygpath -w md5.c`
pre_stage2_exec-serial.o: serial.c pre_stage2_exec-serial.o: serial.c
@AMDEP_TRUE@ source='serial.c' object='pre_stage2_exec-serial.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='serial.c' object='pre_stage2_exec-serial.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-serial.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-serial.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-serial.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-serial.TPo' @AMDEPBACKSLASH@
@ -2136,18 +2196,6 @@ pre_stage2_exec-stage2.obj: stage2.c
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-stage2.obj `cygpath -w stage2.c` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-stage2.obj `cygpath -w stage2.c`
pre_stage2_exec-md5.o: md5.c
@AMDEP_TRUE@ source='md5.c' object='pre_stage2_exec-md5.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-md5.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-md5.o `test -f md5.c || echo '$(srcdir)/'`md5.c
pre_stage2_exec-md5.obj: md5.c
@AMDEP_TRUE@ source='md5.c' object='pre_stage2_exec-md5.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/pre_stage2_exec-md5.Po' tmpdepfile='$(DEPDIR)/pre_stage2_exec-md5.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-md5.obj `cygpath -w md5.c`
reiserfs_stage1_5_exec-common.o: common.c reiserfs_stage1_5_exec-common.o: common.c
@AMDEP_TRUE@ source='common.c' object='reiserfs_stage1_5_exec-common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ source='common.c' object='reiserfs_stage1_5_exec-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/reiserfs_stage1_5_exec-common.Po' tmpdepfile='$(DEPDIR)/reiserfs_stage1_5_exec-common.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/reiserfs_stage1_5_exec-common.Po' tmpdepfile='$(DEPDIR)/reiserfs_stage1_5_exec-common.TPo' @AMDEPBACKSLASH@

View file

@ -1,6 +1,6 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1313,42 +1313,8 @@ probe_values:
# include "apm.S" # include "apm.S"
#endif /* ! STAGE1_5 */ #endif /* ! STAGE1_5 */
/*
* console_putchar(c)
*
* Puts character on the screen, interpreting '\n' as in the UNIX fashion.
*
* BIOS call "INT 10H Function 0Eh" to write character to console
* Call with %ah = 0x0e
* %al = character
* %bh = page
* %bl = foreground color ( graphics modes)
*/
ENTRY(console_putchar)
push %ebp
push %eax
push %ebx
movb 0x10(%esp), %bl
call EXT_C(prot_to_real)
.code16
movb %bl, %al
movb $0xe, %ah
movw $1, %bx
int $0x10
DATA32 call EXT_C(real_to_prot)
.code32
pop %ebx
pop %eax
pop %ebp
ret
#ifndef STAGE1_5 #ifndef STAGE1_5
/* get_code_end() : return the address of the end of the code /* get_code_end() : return the address of the end of the code
* This is here so that it can be replaced by asmstub.c. * This is here so that it can be replaced by asmstub.c.
@ -1824,68 +1790,249 @@ ENTRY(multi_boot)
/* error */ /* error */
call EXT_C(stop) call EXT_C(stop)
#endif /* ! STAGE1_5 */
/* /*
* console_cls() * void console_putchar (int c)
* BIOS call "INT 10H Function 0Fh" to get current video mode *
* Call with %ah = 0x0f * Put the character C on the console. Because GRUB wants to write a
* Returns %al = (video mode) * character with an attribute, this implementation is a bit tricky.
* %bh = (page number) * If C is a control character (CR, LF, BEL, BS), use INT 10, AH = 0Eh
* BIOS call "INT 10H Function 00h" to set the video mode (clears screen) * (TELETYPE OUTPUT). Otherwise, save the original position, put a space,
* Call with %ah = 0x00 * save the current position, restore the original position, write the
* %al = (video mode) * character and the attribute, and restore the current position.
*
* The reason why this is so complicated is that there is no easy way to
* get the height of the screen, and the TELETYPE OUPUT BIOS call doesn't
* support setting a background attribute.
*/ */
ENTRY(console_putchar)
movl 0x4(%esp), %edx
ENTRY(console_cls) pusha
push %ebp #ifdef STAGE1_5
push %ebx /* save EBX */ movb $0x07, %bl
#else
movl EXT_C(console_current_color), %ebx
#endif
call EXT_C(prot_to_real) call EXT_C(prot_to_real)
.code16 .code16
movb %dl, %al
xorb %bh, %bh
movb $0xf, %ah #ifndef STAGE1_5
int $0x10 /* Get Current Video mode */ /* use teletype output if control character */
xorb %ah, %ah cmpb $0x7, %al
int $0x10 /* Set Video mode (clears screen) */ je 1f
cmpb $0x8, %al
je 1f
cmpb $0xa, %al
je 1f
cmpb $0xd, %al
je 1f
DATA32 call EXT_C(real_to_prot) /* save the character and the attribute on the stack */
.code32 pushw %ax
pushw %bx
pop %ebx /* get the current position */
pop %ebp movb $0x3, %ah
ret
/*
* nocursor()
* BIOS call "INT 10H Function 01h" to set cursor type
* Call with %ah = 0x01
* %ch = cursor starting scanline
* %cl = cursor ending scanline
*/
ENTRY(nocursor)
push %ebp
push %ebx /* save EBX */
call EXT_C(prot_to_real)
.code16
movw $0x2000, %cx
movb $0x1, %ah
int $0x10 int $0x10
/* check the column with the width */
cmpb $79, %dl
jl 2f
/* print CR and LF, if next write will exceed the width */
movw $0x0e0d, %ax
int $0x10
movb $0x0a, %al
int $0x10
/* get the current position */
movb $0x3, %ah
int $0x10
2:
/* restore the character and the attribute */
popw %bx
popw %ax
/* write the character with the attribute */
movb $0x9, %ah
movw $1, %cx
int $0x10
/* move the cursor forward */
incb %dl
movb $0x2, %ah
int $0x10
jmp 3f
#endif /* ! STAGE1_5 */
1: movb $0xe, %ah
int $0x10
3: DATA32 call EXT_C(real_to_prot)
.code32
popa
ret
#ifndef STAGE1_5
/* this table is used in translate_keycode below */
translation_table:
.word KEY_LEFT, 2
.word KEY_RIGHT, 6
.word KEY_UP, 16
.word KEY_DOWN, 14
.word KEY_HOME, 1
.word KEY_END, 5
.word KEY_DC, 4
.word KEY_BACKSPACE, 8
.word 0
/*
* translate_keycode translates the key code %dx to an ascii code.
*/
.code16
translate_keycode:
pushw %bx
pushw %si
movw $ABS(translation_table), %si
1: lodsw
/* check if this is the end */
testw %ax, %ax
jz 2f
/* load the ascii code into %ax */
movw %ax, %bx
lodsw
/* check if this matches the key code */
cmpw %bx, %dx
jne 1b
/* translate %dx, if successful */
movw %ax, %dx
2: popw %si
popw %bx
ret
.code32
/*
* remap_ascii_char remaps the ascii code %dl to another if the code is
* contained in ASCII_KEY_MAP.
*/
.code16
remap_ascii_char:
pushw %si
movw $ABS(EXT_C(ascii_key_map)), %si
1:
lodsw
/* check if this is the end */
testw %ax, %ax
jz 2f
/* check if this matches the ascii code */
cmpb %al, %dl
jne 1b
/* if so, perform the mapping */
movb %ah, %dl
2:
/* restore %si */
popw %si
ret
.code32
.align 4
ENTRY(ascii_key_map)
.space (KEY_MAP_SIZE + 1) * 2
/*
* int console_getkey (void)
* BIOS call "INT 16H Function 00H" to read character from keyboard
* Call with %ah = 0x0
* Return: %ah = keyboard scan code
* %al = ASCII character
*/
ENTRY(console_getkey)
push %ebp
call EXT_C(prot_to_real)
.code16
int $0x16
movw %ax, %dx /* real_to_prot uses %eax */
call translate_keycode
call remap_ascii_char
DATA32 call EXT_C(real_to_prot) DATA32 call EXT_C(real_to_prot)
.code32 .code32
pop %ebx movw %dx, %ax
pop %ebp pop %ebp
ret ret
/* /*
* console_getxy() * int console_checkkey (void)
* if there is a character pending, return it; otherwise return -1
* BIOS call "INT 16H Function 01H" to check whether a character is pending
* Call with %ah = 0x1
* Return:
* If key waiting to be input:
* %ah = keyboard scan code
* %al = ASCII character
* Zero flag = clear
* else
* Zero flag = set
*/
ENTRY(console_checkkey)
push %ebp
xorl %edx, %edx
call EXT_C(prot_to_real) /* enter real mode */
.code16
movb $0x1, %ah
int $0x16
DATA32 jz notpending
movw %ax, %dx
call translate_keycode
call remap_ascii_char
DATA32 jmp pending
notpending:
movl $0xFFFFFFFF, %edx
pending:
DATA32 call EXT_C(real_to_prot)
.code32
mov %edx, %eax
pop %ebp
ret
/*
* int console_getxy (void)
* BIOS call "INT 10H Function 03h" to get cursor position * BIOS call "INT 10H Function 03h" to get cursor position
* Call with %ah = 0x03 * Call with %ah = 0x03
* %bh = page * %bh = page
@ -1919,7 +2066,7 @@ ENTRY(console_getxy)
/* /*
* console_gotoxy(x,y) * void console_gotoxy(int x, int y)
* BIOS call "INT 10H Function 02h" to set cursor position * BIOS call "INT 10H Function 02h" to set cursor position
* Call with %ah = 0x02 * Call with %ah = 0x02
* %bh = page * %bh = page
@ -1951,56 +2098,28 @@ ENTRY(console_gotoxy)
/* /*
* console_set_attrib(attr) : Sets the character attributes for character at * void console_cls (void)
* current cursor position. * BIOS call "INT 10H Function 0Fh" to get current video mode
* * Call with %ah = 0x0f
* Bitfields for character's display attribute: * Returns %al = (video mode)
* Bit(s) Description * %bh = (page number)
* 7 foreground blink * BIOS call "INT 10H Function 00h" to set the video mode (clears screen)
* 6-4 background color * Call with %ah = 0x00
* 3 foreground bright * %al = (video mode)
* 2-0 foreground color
*
* Values for character color:
* Normal Bright
* 000b black dark gray
* 001b blue light blue
* 010b green light green
* 011b cyan light cyan
* 100b red light red
* 101b magenta light magenta
* 110b brown yellow
* 111b light gray white
*
* BIOS call "INT 10H Function 08h" to read character and attribute data
* Call with %ah = 0x08
* %bh = page
* Returns %ah = character attribute
* %al = character value
* BIOS call "INT 10H Function 09h" to write character and attribute data
* Call with %ah = 0x09
* %al = character value
* %bh = page
* %bl = character attribute
* %cx = count to display (???, possible side-effects!!)
*/ */
ENTRY(console_set_attrib)
push %ebp
push %ebx
movl 0xc(%esp), %ecx ENTRY(console_cls)
xorl %ebx, %ebx push %ebp
push %ebx /* save EBX */
call EXT_C(prot_to_real) call EXT_C(prot_to_real)
.code16 .code16
movb $0x8, %ah movb $0xf, %ah
int $0x10 int $0x10 /* Get Current Video mode */
movb $0x9, %ah xorb %ah, %ah
movb %cl, %bl int $0x10 /* Set Video mode (clears screen) */
movw $1, %cx
int $0x10
DATA32 call EXT_C(real_to_prot) DATA32 call EXT_C(real_to_prot)
.code32 .code32
@ -2010,6 +2129,30 @@ ENTRY(console_set_attrib)
ret ret
/*
* void console_nocursor (void)
* BIOS call "INT 10H Function 01h" to set cursor type
* Call with %ah = 0x01
* %ch = cursor starting scanline
* %cl = cursor ending scanline
*/
ENTRY(console_nocursor)
push %ebp
call EXT_C(prot_to_real)
.code16
movw $0x2000, %cx
movb $0x1, %ah
int $0x10
DATA32 call EXT_C(real_to_prot)
.code32
pop %ebp
ret
/* /*
* getrtsecs() * getrtsecs()
* if a seconds value can be read, read it and return it (BCD), * if a seconds value can be read, read it and return it (BCD),
@ -2074,114 +2217,6 @@ ENTRY(currticks)
popl %ebp popl %ebp
ret ret
/*
* remap_ascii_char remaps the ascii code %bl to another if the code is
* contained in ASCII_KEY_MAP.
*/
.code16
remap_ascii_char:
pushw %si
movw $ABS(EXT_C(ascii_key_map)), %si
1:
lodsw
/* check if this is the end */
testw %ax, %ax
jz 2f
/* check if this matches the ascii code */
cmpb %al, %bl
jne 1b
/* if so, perform the mapping */
movb %ah, %bl
2:
/* restore %si */
popw %si
ret
.code32
.align 4
ENTRY(ascii_key_map)
.space (KEY_MAP_SIZE + 1) * 2
/*
* console_getkey()
* BIOS call "INT 16H Function 00H" to read character from keyboard
* Call with %ah = 0x0
* Return: %ah = keyboard scan code
* %al = ASCII character
*/
ENTRY(console_getkey)
push %ebp
push %ebx /* save %ebx */
call EXT_C(prot_to_real)
.code16
int $0x16
movw %ax, %bx /* real_to_prot uses %eax */
call remap_ascii_char
DATA32 call EXT_C(real_to_prot)
.code32
movw %bx, %ax
pop %ebx
pop %ebp
ret
/*
* console_checkkey()
* if there is a character pending, return it; otherwise return -1
* BIOS call "INT 16H Function 01H" to check whether a character is pending
* Call with %ah = 0x1
* Return:
* If key waiting to be input:
* %ah = keyboard scan code
* %al = ASCII character
* Zero flag = clear
* else
* Zero flag = set
*/
ENTRY(console_checkkey)
push %ebp
push %ebx
xorl %ebx, %ebx
call EXT_C(prot_to_real) /* enter real mode */
.code16
movb $0x1, %ah
int $0x16
DATA32 jz notpending
movw %ax, %bx
call remap_ascii_char
DATA32 jmp pending
notpending:
movl $0xFFFFFFFF, %ebx
pending:
DATA32 call EXT_C(real_to_prot)
.code32
mov %ebx, %eax
pop %ebx
pop %ebp
ret
#endif /* STAGE1_5 */ #endif /* STAGE1_5 */
/* /*

View file

@ -26,6 +26,7 @@
#include <shared.h> #include <shared.h>
#include <filesys.h> #include <filesys.h>
#include <term.h>
#ifdef SUPPORT_NETBOOT #ifdef SUPPORT_NETBOOT
# define GRUB 1 # define GRUB 1
@ -47,8 +48,6 @@
# include <md5.h> # include <md5.h>
#endif #endif
/* Terminal types. */
int terminal = TERMINAL_CONSOLE;
/* The type of kernel loaded. */ /* The type of kernel loaded. */
kernel_t kernel_type; kernel_t kernel_type;
/* The boot device. */ /* The boot device. */
@ -70,9 +69,6 @@ char *password;
password_t password_type; password_t password_type;
/* The flag for indicating that the user is authoritative. */ /* The flag for indicating that the user is authoritative. */
int auth = 0; int auth = 0;
/* Color settings. */
int normal_color;
int highlight_color;
/* The timeout. */ /* The timeout. */
int grub_timeout = -1; int grub_timeout = -1;
/* Whether to show the menu or not. */ /* Whether to show the menu or not. */
@ -99,8 +95,6 @@ void
init_config (void) init_config (void)
{ {
default_entry = 0; default_entry = 0;
normal_color = A_NORMAL;
highlight_color = A_REVERSE;
password = 0; password = 0;
fallback_entry = -1; fallback_entry = -1;
grub_timeout = -1; grub_timeout = -1;
@ -413,7 +407,14 @@ cat_func (char *arg, int flags)
return 1; return 1;
while (grub_read (&c, 1)) while (grub_read (&c, 1))
{
/* Because running "cat" with a binary file can confuse the terminal,
print only some characters as they are. */
if (grub_isspace (c) || (c >= ' ' && c <= '~'))
grub_putchar (c); grub_putchar (c);
else
grub_putchar ('?');
}
grub_close (); grub_close ();
return 0; return 0;
@ -696,8 +697,9 @@ color_func (char *arg, int flags)
return 1; return 1;
} }
normal_color = new_normal_color; if (current_term->setcolor)
highlight_color = new_highlight_color; current_term->setcolor (new_normal_color, new_highlight_color);
return 0; return 0;
} }
@ -3276,7 +3278,7 @@ static struct builtin builtin_savedefault =
static int static int
serial_func (char *arg, int flags) serial_func (char *arg, int flags)
{ {
unsigned short port = serial_get_port (0); unsigned short port = serial_hw_get_port (0);
unsigned int speed = 9600; unsigned int speed = 9600;
int word_len = UART_8BITS_WORD; int word_len = UART_8BITS_WORD;
int parity = UART_NO_PARITY; int parity = UART_NO_PARITY;
@ -3301,7 +3303,7 @@ serial_func (char *arg, int flags)
return 1; return 1;
} }
port = serial_get_port (unit); port = serial_hw_get_port (unit);
} }
else if (grub_memcmp (arg, "--speed=", sizeof ("--speed=") - 1) == 0) else if (grub_memcmp (arg, "--speed=", sizeof ("--speed=") - 1) == 0)
{ {
@ -3388,7 +3390,7 @@ serial_func (char *arg, int flags)
*q++ = *p++; *q++ = *p++;
*q = 0; *q = 0;
set_serial_device (dev); serial_set_device (dev);
} }
# endif /* GRUB_UTIL */ # endif /* GRUB_UTIL */
else else
@ -3398,7 +3400,7 @@ serial_func (char *arg, int flags)
} }
/* Initialize the serial unit. */ /* Initialize the serial unit. */
if (! serial_init (port, speed, word_len, parity, stop_bit_len)) if (! serial_hw_init (port, speed, word_len, parity, stop_bit_len))
{ {
errnum = ERR_BAD_ARGUMENT; errnum = ERR_BAD_ARGUMENT;
return 1; return 1;
@ -3981,18 +3983,26 @@ static struct builtin builtin_setup =
static int static int
terminal_func (char *arg, int flags) terminal_func (char *arg, int flags)
{ {
int default_terminal = 0; /* The index of the default terminal in TERM_TABLE. */
int default_term = -1;
struct term_entry *prev_term = current_term;
int to = -1; int to = -1;
int dumb = 0;
int saved_terminal = terminal;
int lines = 0; int lines = 0;
int no_message = 0; int no_message = 0;
unsigned long term_flags = 0;
/* XXX: Assume less than 32 terminals. */
unsigned long term_bitmap = 0;
/* Get GNU-style long options. */ /* Get GNU-style long options. */
while (1) while (1)
{ {
if (grub_memcmp (arg, "--dumb", sizeof ("--dumb") - 1) == 0) if (grub_memcmp (arg, "--dumb", sizeof ("--dumb") - 1) == 0)
dumb = 1; term_flags |= TERM_DUMB;
else if (grub_memcmp (arg, "--no-echo", sizeof ("--no-echo") - 1) == 0)
/* ``--no-echo'' implies ``--no-edit''. */
term_flags |= (TERM_NO_ECHO | TERM_NO_EDIT);
else if (grub_memcmp (arg, "--no-edit", sizeof ("--no-edit") - 1) == 0)
term_flags |= TERM_NO_EDIT;
else if (grub_memcmp (arg, "--timeout=", sizeof ("--timeout=") - 1) == 0) else if (grub_memcmp (arg, "--timeout=", sizeof ("--timeout=") - 1) == 0)
{ {
char *val = arg + sizeof ("--timeout=") - 1; char *val = arg + sizeof ("--timeout=") - 1;
@ -4025,72 +4035,51 @@ terminal_func (char *arg, int flags)
/* If no argument is specified, show current setting. */ /* If no argument is specified, show current setting. */
if (! *arg) if (! *arg)
{ {
if (terminal & TERMINAL_CONSOLE) grub_printf ("%s%s%s%s\n",
grub_printf ("console%s\n", current_term->name,
terminal & TERMINAL_DUMB ? " (dumb)" : ""); current_term->flags & TERM_DUMB ? " (dumb)" : "",
#ifdef SUPPORT_HERCULES current_term->flags & TERM_NO_EDIT ? " (no edit)" : "",
else if (terminal & TERMINAL_HERCULES) current_term->flags & TERM_NO_ECHO ? " (no echo)" : "");
grub_printf ("hercules%s\n",
terminal & TERMINAL_DUMB ? " (dumb)" : "");
#endif /* SUPPORT_HERCULES */
#ifdef SUPPORT_SERIAL
else if (terminal & TERMINAL_SERIAL)
grub_printf ("serial%s\n",
terminal & TERMINAL_DUMB ? " (dumb)" : " (vt100)");
#endif /* SUPPORT_SERIAL */
return 0; return 0;
} }
/* Clear current setting. */
terminal = dumb ? TERMINAL_DUMB : 0;
while (*arg) while (*arg)
{ {
if (grub_memcmp (arg, "console", sizeof ("console") - 1) == 0) int i;
char *next = skip_to (0, arg);
nul_terminate (arg);
for (i = 0; term_table[i].name; i++)
{ {
terminal |= TERMINAL_CONSOLE; if (grub_strcmp (arg, term_table[i].name) == 0)
if (! default_terminal)
default_terminal = TERMINAL_CONSOLE;
}
#ifdef SUPPORT_HERCULES
else if (grub_memcmp (arg, "hercules", sizeof ("hercules") - 1) == 0)
{ {
terminal |= TERMINAL_HERCULES; if (term_table[i].flags & TERM_NEED_INIT)
if (! default_terminal)
default_terminal = TERMINAL_HERCULES;
}
#endif /* SUPPORT_HERCULES */
#ifdef SUPPORT_SERIAL
else if (grub_memcmp (arg, "serial", sizeof ("serial") - 1) == 0)
{ {
if (serial_exists ()) errnum = ERR_DEV_NEED_INIT;
{
terminal |= TERMINAL_SERIAL;
if (! default_terminal)
default_terminal = TERMINAL_SERIAL;
}
else
{
terminal = saved_terminal;
errnum = ERR_NEED_SERIAL;
return 1; return 1;
} }
if (default_term < 0)
default_term = i;
term_bitmap |= (1 << i);
break;
} }
#endif /* SUPPORT_SERIAL */ }
else
if (! term_table[i].name)
{ {
terminal = saved_terminal;
errnum = ERR_BAD_ARGUMENT; errnum = ERR_BAD_ARGUMENT;
return 1; return 1;
} }
arg = skip_to (0, arg); arg = next;
} }
#ifdef SUPPORT_SERIAL /* If multiple terminals are specified, wait until the user pushes any
/* If a seial console is turned on, wait until the user pushes any key. */ key on one of the terminals. */
if (terminal & TERMINAL_SERIAL) if (term_bitmap & ~(1 << default_term))
{ {
int time1, time2 = -1; int time1, time2 = -1;
@ -4104,23 +4093,20 @@ terminal_func (char *arg, int flags)
/* Wait for a key input. */ /* Wait for a key input. */
while (to) while (to)
{ {
if ((terminal & TERMINAL_CONSOLE) && console_checkkey () != -1) int i;
for (i = 0; term_table[i].name; i++)
{ {
terminal &= (TERMINAL_CONSOLE | TERMINAL_DUMB); if (term_bitmap & (1 << i))
(void) getkey (); {
return 0; if (term_table[i].checkkey () >= 0)
{
(void) term_table[i].getkey ();
default_term = i;
goto end;
}
} }
else if ((terminal & TERMINAL_SERIAL) && serial_checkkey () != -1)
{
terminal &= (TERMINAL_SERIAL | TERMINAL_DUMB);
(void) getkey ();
/* If the interface is currently the command-line, restart
it to repaint the screen. */
if (flags & BUILTIN_CMDLINE)
grub_longjmp (restart_cmdline_env, 0);
return 0;
} }
/* Prompt the user, once per sec. */ /* Prompt the user, once per sec. */
@ -4134,11 +4120,11 @@ terminal_func (char *arg, int flags)
to--; to--;
} }
} }
/* Expired. */
terminal &= (default_terminal | TERMINAL_DUMB);
} }
#endif /* SUPPORT_SERIAL */
end:
current_term = term_table + default_term;
current_term->flags = term_flags;
if (lines) if (lines)
max_lines = lines; max_lines = lines;
@ -4146,6 +4132,11 @@ terminal_func (char *arg, int flags)
/* 24 would be a good default value. */ /* 24 would be a good default value. */
max_lines = 24; max_lines = 24;
/* If the interface is currently the command-line,
restart it to repaint the screen. */
if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
grub_longjmp (restart_cmdline_env, 0);
return 0; return 0;
} }
@ -4154,12 +4145,14 @@ static struct builtin builtin_terminal =
"terminal", "terminal",
terminal_func, terminal_func,
BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
"terminal [--dumb] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial]", "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
"Select a terminal. When serial is specified, wait until you push any key" "Select a terminal. When multiple terminals are specified, wait until"
" to continue. If both console and serial are specified, the terminal" " you push any key to continue. If both console and serial are specified,"
" to which you input a key first will be selected. If no argument is" " the terminal to which you input a key first will be selected. If no"
" specified, print current setting. The option --dumb specifies that" " argument is specified, print current setting. The option --dumb"
" your terminal is dumb, otherwise, vt100-compatibility is assumed." " specifies that your terminal is dumb, otherwise, vt100-compatibility"
" is assumed. If you specify --no-echo, input characters won't be echoed."
" If you specify --no-edit, the BASH-like editing feature will be disabled."
" If --timeout is present, this command will wait at most for SECS" " If --timeout is present, this command will wait at most for SECS"
" seconds. The option --lines specifies the maximum number of lines." " seconds. The option --lines specifies the maximum number of lines."
" The option --silent is used to suppress messages." " The option --silent is used to suppress messages."

View file

@ -19,6 +19,7 @@
*/ */
#include <shared.h> #include <shared.h>
#include <term.h>
#ifdef SUPPORT_HERCULES #ifdef SUPPORT_HERCULES
# include <hercules.h> # include <hercules.h>
@ -29,7 +30,59 @@
#endif #endif
#ifndef STAGE1_5 #ifndef STAGE1_5
int auto_fill = 1; struct term_entry term_table[] =
{
{
"console",
0,
console_putchar,
console_checkkey,
console_getkey,
console_getxy,
console_gotoxy,
console_cls,
console_highlight,
console_setcolor,
console_nocursor
},
#ifdef SUPPORT_SERIAL
{
"serial",
/* A serial device must be initialized. */
TERM_NEED_INIT,
serial_putchar,
serial_checkkey,
serial_getkey,
serial_getxy,
serial_gotoxy,
serial_cls,
serial_highlight,
0,
0
},
#endif /* SUPPORT_SERIAL */
#ifdef SUPPORT_HERCULES
{
"hercules",
0,
hercules_putchar,
console_checkkey,
console_getkey,
hercules_getxy,
hercules_gotoxy,
hercules_cls,
hercules_highlight,
hercules_setcolor,
hercules_nocursor
},
#endif /* SUPPORT_HERCULES */
/* This must be the last entry. */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
/* This must be console. */
struct term_entry *current_term = term_table;
int max_lines = 24; int max_lines = 24;
int count_lines = -1; int count_lines = -1;
int use_pager = 1; int use_pager = 1;
@ -101,7 +154,7 @@ grub_printf (const char *format,...)
while ((c = *(format++)) != 0) while ((c = *(format++)) != 0)
{ {
if (c != '%') if (c != '%')
putchar (c); grub_putchar (c);
else else
switch (c = *(format++)) switch (c = *(format++))
{ {
@ -120,19 +173,19 @@ grub_printf (const char *format,...)
ptr = str; ptr = str;
while (*ptr) while (*ptr)
putchar (*(ptr++)); grub_putchar (*(ptr++));
break; break;
#ifndef STAGE1_5 #ifndef STAGE1_5
case 'c': case 'c':
putchar ((*(dataptr++)) & 0xff); grub_putchar ((*(dataptr++)) & 0xff);
break; break;
case 's': case 's':
ptr = (char *) (*(dataptr++)); ptr = (char *) (*(dataptr++));
while ((c = *(ptr++)) != 0) while ((c = *(ptr++)) != 0)
putchar (c); grub_putchar (c);
break; break;
#endif #endif
} }
@ -220,16 +273,8 @@ add_history (const char *cmdline, int no)
num_history++; num_history++;
} }
/* Don't use this with a MAXLEN greater than 1600 or so! The problem static int
is that GET_CMDLINE depends on the everything fitting on the screen real_get_cmdline (char *prompt, char *cmdline, int maxlen,
at once. So, the whole screen is about 2000 characters, minus the
PROMPT, and space for error and status lines, etc. MAXLEN must be
at least 1, and PROMPT and CMDLINE must be valid strings (not NULL
or zero-length).
If ECHO_CHAR is nonzero, echo it instead of the typed character. */
int
get_cmdline (char *prompt, char *cmdline, int maxlen,
int echo_char, int readline) int echo_char, int readline)
{ {
/* This is a rather complicated function. So explain the concept. /* This is a rather complicated function. So explain the concept.
@ -279,8 +324,6 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
char *buf = (char *) CMDLINE_BUF; char *buf = (char *) CMDLINE_BUF;
/* The kill buffer. */ /* The kill buffer. */
char *kill_buf = (char *) KILL_BUF; char *kill_buf = (char *) KILL_BUF;
/* The original state of AUTO_FILL. */
int saved_auto_fill = auto_fill;
/* Nested function definitions for code simplicity. */ /* Nested function definitions for code simplicity. */
@ -308,29 +351,15 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
{ {
xpos -= count; xpos -= count;
if ((terminal & TERMINAL_CONSOLE) if (current_term->flags & TERM_DUMB)
# ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
# endif /* SUPPORT_HERCULES */
)
{
int y = getxy () & 0xFF;
gotoxy (xpos, y);
}
# ifdef SUPPORT_SERIAL
else if (! (terminal & TERMINAL_DUMB) && (count > 4))
{
grub_printf ("\e[%dD", count);
}
else
{ {
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
grub_putchar ('\b'); grub_putchar ('\b');
} }
# endif /* SUPPORT_SERIAL */ else
gotoxy (xpos, getxy () & 0xFF);
} }
} }
@ -346,22 +375,7 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
{ {
xpos += count; xpos += count;
if ((terminal & TERMINAL_CONSOLE) if (current_term->flags & TERM_DUMB)
# ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
# endif /* SUPPORT_HERCULES */
)
{
int y = getxy () & 0xFF;
gotoxy (xpos, y);
}
# ifdef SUPPORT_SERIAL
else if (! (terminal & TERMINAL_DUMB) && (count > 4))
{
grub_printf ("\e[%dC", count);
}
else
{ {
int i; int i;
@ -373,7 +387,8 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
grub_putchar (echo_char); grub_putchar (echo_char);
} }
} }
# endif /* SUPPORT_SERIAL */ else
gotoxy (xpos, getxy () & 0xFF);
} }
} }
@ -388,8 +403,7 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
if (full) if (full)
{ {
/* Recompute the section number. */ /* Recompute the section number. */
if ((terminal & TERMINAL_DUMB) if (lpos + plen < CMDLINE_WIDTH)
|| (lpos + plen < CMDLINE_WIDTH))
section = 0; section = 0;
else else
section = ((lpos + plen - CMDLINE_WIDTH) section = ((lpos + plen - CMDLINE_WIDTH)
@ -453,8 +467,6 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
pos++; pos++;
} }
if (! (terminal & TERMINAL_DUMB))
{
/* Fill up the rest of the line with spaces. */ /* Fill up the rest of the line with spaces. */
for (; i < start + len; i++) for (; i < start + len; i++)
{ {
@ -475,28 +487,13 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
} }
/* Back to XPOS. */ /* Back to XPOS. */
if ((terminal & TERMINAL_CONSOLE) if (current_term->flags & TERM_DUMB)
# ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
# endif /* SUPPORT_HERCULES */
)
{
int y = getxy () & 0xFF;
gotoxy (xpos, y);
}
# ifdef SUPPORT_SERIAL
else if (! (terminal & TERMINAL_SERIAL) && (pos - xpos > 4))
{
grub_printf ("\e[%dD", pos - xpos);
}
else
{ {
for (i = 0; i < pos - xpos; i++) for (i = 0; i < pos - xpos; i++)
grub_putchar ('\b'); grub_putchar ('\b');
} }
# endif /* SUPPORT_SERIAL */ else
} gotoxy (xpos, getxy () & 0xFF);
} }
/* Initialize the command-line. */ /* Initialize the command-line. */
@ -562,15 +559,10 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
lpos = llen; lpos = llen;
grub_strcpy (buf, cmdline); grub_strcpy (buf, cmdline);
/* Disable the auto fill mode. */
auto_fill = 0;
cl_init (); cl_init ();
while (ASCII_CHAR (c = getkey ()) != '\n' && ASCII_CHAR (c) != '\r') while ((c = ASCII_CHAR (getkey ())) != '\n' && c != '\r')
{ {
c = translate_keycode (c);
/* If READLINE is non-zero, handle readline-like key bindings. */ /* If READLINE is non-zero, handle readline-like key bindings. */
if (readline) if (readline)
{ {
@ -617,11 +609,7 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
completion. */ completion. */
grub_memmove (completion_buffer, buf + i, lpos - i); grub_memmove (completion_buffer, buf + i, lpos - i);
completion_buffer[lpos - i] = 0; completion_buffer[lpos - i] = 0;
/* Enable the auto fill mode temporarily. */
auto_fill = 1;
ret = print_completions (is_filename, 1); ret = print_completions (is_filename, 1);
/* Disable the auto fill mode again. */
auto_fill = 0;
errnum = ERR_NONE; errnum = ERR_NONE;
if (ret >= 0) if (ret >= 0)
@ -633,13 +621,8 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
{ {
/* There are more than one candidates, so print /* There are more than one candidates, so print
the list. */ the list. */
grub_putchar ('\n'); grub_putchar ('\n');
/* Enable the auto fill mode temporarily. */
auto_fill = 1;
print_completions (is_filename, 0); print_completions (is_filename, 0);
/* Disable the auto fill mode again. */
auto_fill = 0;
errnum = ERR_NONE; errnum = ERR_NONE;
} }
} }
@ -792,124 +775,66 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
if (readline && lpos < llen) if (readline && lpos < llen)
add_history (cmdline, 0); add_history (cmdline, 0);
/* Restore the auto fill mode. */
auto_fill = saved_auto_fill;
return 0; return 0;
} }
/* Translate a special key to a common ascii code. */ /* Don't use this with a MAXLEN greater than 1600 or so! The problem
is that GET_CMDLINE depends on the everything fitting on the screen
at once. So, the whole screen is about 2000 characters, minus the
PROMPT, and space for error and status lines, etc. MAXLEN must be
at least 1, and PROMPT and CMDLINE must be valid strings (not NULL
or zero-length).
If ECHO_CHAR is nonzero, echo it instead of the typed character. */
int int
translate_keycode (int c) get_cmdline (char *prompt, char *cmdline, int maxlen,
int echo_char, int readline)
{ {
# ifdef SUPPORT_SERIAL /* Because it is hard to deal with different conditions simultaneously,
if (terminal & TERMINAL_SERIAL) less functional cases are handled here. Assume that TERM_NO_ECHO
implies TERM_NO_EDIT. */
if (current_term->flags & (TERM_NO_ECHO | TERM_NO_EDIT))
{ {
/* In a serial terminal, things are complicated, because several char *p = cmdline;
key codes start from the character ESC, while we want to accept int c;
ESC itself. */
if (c == '\e')
{
int start;
/* Get current time. */ /* Make sure that MAXLEN is not too large. */
start = currticks (); if (maxlen > MAX_CMDLINE)
maxlen = MAX_CMDLINE;
while (checkkey () == -1) /* Print only the prompt. The contents of CMDLINE is simply discarded,
{ even if it is not empty. */
/* Wait for a next character, at least for 0.1 sec grub_printf ("%s", prompt);
(18.2 ticks/sec). */
int now;
now = currticks (); /* Gather characters until a newline is gotten. */
if (now - start >= 2) while ((c = ASCII_CHAR (getkey ())) != '\n' && c != '\r')
return c; {
} /* Return immediately if ESC is pressed. */
if (c == 27)
return 1;
c = getkey (); /* Printable characters are added into CMDLINE. */
if (c == '[') if (c >= ' ' && c <= '~')
{ {
int c1, c2; if (! (current_term->flags & TERM_NO_ECHO))
grub_putchar (c);
/* To filter illegal states. */ /* Preceding space characters must be ignored. */
c = 0; if (c != ' ' || p != cmdline)
c1 = getkey (); *p++ = c;
switch (c1)
{
case 'A': /* KEY_UP */
c = 16;
break;
case 'B': /* KEY_DOWN */
c = 14;
break;
case 'C': /* KEY_RIGHT */
c = 6;
break;
case 'D': /* KEY_LEFT */
c = 2;
break;
case 'F': /* End */
c = 5;
break;
case 'H': /* Home */
c = 1;
break;
case '1':
c2 = getkey ();
if (c2 == '~')
{
/* One of control keys (pos1,....). */
c = 1;
}
break;
case '3':
c2 = getkey ();
if (c2 == '~')
{
/* One of control keys (del,....). */
c = 4;
}
break;
case '4': /* Del */
c = 4;
break;
}
}
}
}
else
# endif /* SUPPORT_SERIAL */
{
switch (c)
{
case KEY_LEFT:
c = 2;
break;
case KEY_RIGHT:
c = 6;
break;
case KEY_UP:
c = 16;
break;
case KEY_DOWN:
c = 14;
break;
case KEY_HOME:
c = 1;
break;
case KEY_END:
c = 5;
break;
case KEY_DC:
c = 4;
break;
case KEY_BACKSPACE:
c = 8;
break;
} }
} }
return ASCII_CHAR (c); *p = 0;
if (! (current_term->flags & TERM_NO_ECHO))
grub_putchar ('\n');
return 0;
}
/* Complicated features are left to real_get_cmdline. */
return real_get_cmdline (prompt, cmdline, maxlen, echo_char, readline);
} }
#endif /* STAGE1_5 */ #endif /* STAGE1_5 */
@ -1029,7 +954,7 @@ grub_strncat (char *s1, const char *s2, int n)
a static library supporting minimal standard C functions and link a static library supporting minimal standard C functions and link
each image with the library. Complicated things should be left to each image with the library. Complicated things should be left to
computer, definitely. -okuji */ computer, definitely. -okuji */
#if ! defined(STAGE1_5) || defined(FSYS_VSTAFS) #if !defined(STAGE1_5) || defined(FSYS_VSTAFS)
int int
grub_strcmp (const char *s1, const char *s2) grub_strcmp (const char *s1, const char *s2)
{ {
@ -1052,55 +977,35 @@ grub_strcmp (const char *s1, const char *s2)
int int
getkey (void) getkey (void)
{ {
int c = -1; return current_term->getkey ();
if ((terminal & TERMINAL_CONSOLE)
#ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
#endif /* SUPPORT_HERCULES */
)
c = console_getkey ();
#ifdef SUPPORT_SERIAL
else if (terminal & TERMINAL_SERIAL)
c = serial_getkey ();
#endif /* SUPPORT_SERIAL */
return c;
} }
/* Check if a key code is available. */ /* Check if a key code is available. */
int int
checkkey (void) checkkey (void)
{ {
int c = -1; return current_term->checkkey ();
if ((terminal & TERMINAL_CONSOLE)
#ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
#endif /* SUPPORT_HERCULES */
)
c = console_checkkey ();
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
c = serial_checkkey ();
#endif /* SUPPORT_SERIAL */
return c;
} }
#endif /* ! STAGE1_5 */ #endif /* ! STAGE1_5 */
/* Display an ASCII character. */ /* Display an ASCII character. */
void void
grub_putchar (int c) grub_putchar (int c)
{ {
#ifndef STAGE1_5
static int col = 0;
#endif
if (c == '\n') if (c == '\n')
grub_putchar ('\r'); grub_putchar ('\r');
#ifndef STAGE1_5
else if (c == '\t' && current_term->getxy)
{
int n;
n = 8 - ((current_term->getxy () >> 8) & 3);
while (n--)
grub_putchar (' ');
return;
}
#endif /* ! STAGE1_5 */
#ifdef STAGE1_5 #ifdef STAGE1_5
@ -1109,27 +1014,10 @@ grub_putchar (int c)
#else /* ! STAGE1_5 */ #else /* ! STAGE1_5 */
/* Track the cursor by software here. */ if (c == '\n')
/* XXX: This doesn't handle horizontal or vertical tabs. */
if (c == '\r')
col = 0;
else if (c == '\b')
{
if (col > 0)
col--;
}
else if (c >= ' ' && c <= '~')
{
/* Fold a line only if AUTO_FILL is true. */
if (auto_fill && col >= 79)
grub_putchar ('\n');
col++;
}
else if (c == '\n')
{ {
/* Internal `more'-like feature. */ /* Internal `more'-like feature. */
if (count_lines != -1) if (count_lines >= 0)
{ {
count_lines++; count_lines++;
if (count_lines >= max_lines - 2) if (count_lines >= max_lines - 2)
@ -1140,13 +1028,20 @@ grub_putchar (int c)
the following grub_printf call will print newlines. */ the following grub_printf call will print newlines. */
count_lines = -1; count_lines = -1;
grub_printf ("\n\n[Hit return to continue]"); if (current_term->highlight)
current_term->highlight (1);
grub_printf ("\n[Hit return to continue]");
if (current_term->highlight)
current_term->highlight (0);
do do
{ {
tmp = ASCII_CHAR (getkey ()); tmp = ASCII_CHAR (getkey ());
} }
while (tmp != '\n' && tmp != '\r'); while (tmp != '\n' && tmp != '\r');
grub_printf ("\n\n"); grub_printf ("\r \r");
/* Restart to count lines. */ /* Restart to count lines. */
count_lines = 0; count_lines = 0;
@ -1155,18 +1050,7 @@ grub_putchar (int c)
} }
} }
if (terminal & TERMINAL_CONSOLE) current_term->putchar (c);
console_putchar (c);
# ifdef SUPPORT_HERCULES
if (terminal & TERMINAL_HERCULES)
herc_putchar (c);
# endif /* SUPPORT_HERCULES */
# ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
serial_putchar (c);
# endif /* SUPPORT_SERIAL */
#endif /* ! STAGE1_5 */ #endif /* ! STAGE1_5 */
} }
@ -1175,169 +1059,30 @@ grub_putchar (int c)
void void
gotoxy (int x, int y) gotoxy (int x, int y)
{ {
if (terminal & TERMINAL_CONSOLE) current_term->gotoxy (x, y);
console_gotoxy (x, y);
#ifdef SUPPORT_HERCULES
else if (terminal & TERMINAL_HERCULES)
herc_gotoxy (x, y);
#endif /* SUPPORT_HERCULES */
#ifdef SUPPORT_SERIAL
else if (terminal & TERMINAL_SERIAL)
serial_gotoxy (x, y);
#endif /* SUPPORT_SERIAL */
} }
#ifdef SUPPORT_SERIAL
/* The serial part of gotoxy. */
void
serial_gotoxy (int x, int y)
{
grub_printf ("\e[%d;%dH", y + 1, x + 1);
}
#endif /* SUPPORT_SERIAL */
int int
getxy (void) getxy (void)
{ {
int ret = 0; return current_term->getxy ();
if (terminal & TERMINAL_CONSOLE)
ret = console_getxy ();
#ifdef SUPPORT_HERCULES
else if (terminal & TERMINAL_HERCULES)
ret = herc_getxy ();
#endif /* SUPPORT_HERCULES */
#ifdef SUPPORT_SERIAL
else if (terminal & TERMINAL_SERIAL)
ret = serial_getxy ();
#endif /* SUPPORT_SERIAL */
return ret;
} }
#ifdef SUPPORT_SERIAL
/* The serial part of getxy. */
int
serial_getxy (void)
{
int x, y;
int start, now;
char buf[32]; /* XXX */
int i;
int c;
char *p;
/* Drain the input buffer. */
while (serial_checkkey () != -1)
serial_getkey ();
/* CPR. */
grub_printf ("\e[6n");
/* Get current time. */
while ((start = getrtsecs ()) == 0xFF)
;
again:
i = 0;
c = 0;
do
{
if (serial_checkkey () != -1)
{
c = serial_getkey ();
if (i == 1 && c != '[')
i = 0;
if (i == 0 && c != '\e')
continue;
if (i != 0 && c == '\e')
i = 0;
buf[i] = c;
i++;
}
else
{
/* Get current time. */
while ((now = getrtsecs ()) == 0xFF)
;
/* FIXME: Remove this magic number. */
if (now - start > 10)
{
/* Something is quite wrong. */
return 0;
}
}
}
while (c != 'R' && i < sizeof (buf));
if (c != 'R')
goto again;
p = buf + 2;
if (! safe_parse_maxint (&p, &y))
{
errnum = 0;
goto again;
}
if (*p != ';')
goto again;
p++;
if (! safe_parse_maxint (&p, &x))
{
errnum = 0;
goto again;
}
if (*p != 'R')
goto again;
return ((x - 1) << 8) | (y - 1);
}
#endif /* SUPPORT_SERIAL */
void void
cls (void) cls (void)
{
if (terminal & TERMINAL_CONSOLE)
console_cls ();
#ifdef SUPPORT_HERCULES
else if (terminal & TERMINAL_HERCULES)
herc_cls ();
#endif /* SUPPORT_HERCULES */
#ifdef SUPPORT_SERIAL
else if (terminal & TERMINAL_SERIAL)
serial_cls ();
#endif /* SUPPORT_SERIAL */
}
#ifdef SUPPORT_SERIAL
/* The serial part of cls. */
void
serial_cls (void)
{ {
/* If the terminal is dumb, there is no way to clean the terminal. */ /* If the terminal is dumb, there is no way to clean the terminal. */
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_putchar ('\n'); grub_putchar ('\n');
else else
grub_printf ("\e[H\e[J"); current_term->cls ();
} }
#endif /* SUPPORT_SERIAL */
void void
set_attrib (int attr) nocursor (void)
{ {
#ifdef SUPPORT_HERCULES if (current_term->nocursor)
if (terminal & TERMINAL_HERCULES) current_term->nocursor ();
herc_set_attrib (attr);
else
#endif /* SUPPORT_HERCULES */
console_set_attrib (attr);
} }
#endif /* ! STAGE1_5 */ #endif /* ! STAGE1_5 */

View file

@ -103,6 +103,7 @@ init_cmdline (void)
saved_partition = install_partition; saved_partition = install_partition;
current_drive = 0xFF; current_drive = 0xFF;
errnum = 0; errnum = 0;
count_lines = -1;
/* Restore memory probe state. */ /* Restore memory probe state. */
mbi.mem_upper = saved_mem_upper; mbi.mem_upper = saved_mem_upper;

View file

@ -63,6 +63,7 @@ char *err_list[] =
[ERR_BOOT_FAILURE] = "Unknown boot failure", [ERR_BOOT_FAILURE] = "Unknown boot failure",
[ERR_BOOT_FEATURES] = "Unsupported Multiboot features requested", [ERR_BOOT_FEATURES] = "Unsupported Multiboot features requested",
[ERR_DEV_FORMAT] = "Unrecognized device string", [ERR_DEV_FORMAT] = "Unrecognized device string",
[ERR_DEV_NEED_INIT] = "Device not initialized yet",
[ERR_DEV_VALUES] = "Invalid device requested", [ERR_DEV_VALUES] = "Invalid device requested",
[ERR_EXEC_FORMAT] = "Invalid or unsupported executable format", [ERR_EXEC_FORMAT] = "Invalid or unsupported executable format",
[ERR_FILELENGTH] = [ERR_FILELENGTH] =
@ -73,7 +74,6 @@ char *err_list[] =
[ERR_GEOM] = "Selected cylinder exceeds maximum supported by BIOS", [ERR_GEOM] = "Selected cylinder exceeds maximum supported by BIOS",
[ERR_NEED_LX_KERNEL] = "Linux kernel must be loaded before initrd", [ERR_NEED_LX_KERNEL] = "Linux kernel must be loaded before initrd",
[ERR_NEED_MB_KERNEL] = "Multiboot kernel must be loaded before modules", [ERR_NEED_MB_KERNEL] = "Multiboot kernel must be loaded before modules",
[ERR_NEED_SERIAL] = "Serial device not configured",
[ERR_NO_DISK] = "Selected disk does not exist", [ERR_NO_DISK] = "Selected disk does not exist",
[ERR_NO_DISK_SPACE] = "No spare sectors on the disk", [ERR_NO_DISK_SPACE] = "No spare sectors on the disk",
[ERR_NO_PART] = "No such partition", [ERR_NO_PART] = "No such partition",

View file

@ -1,7 +1,7 @@
/* hercules.c - hercules console interface */ /* hercules.c - hercules console interface */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2001 Free Software Foundation, Inc. * Copyright (C) 2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -22,9 +22,16 @@
#include <shared.h> #include <shared.h>
#include <hercules.h> #include <hercules.h>
#include <term.h>
/* The position of the cursor. */ /* The position of the cursor. */
static unsigned hercx, hercy; static int herc_x;
static int herc_y;
static int herc_normal_color = A_NORMAL;
static int herc_highlight_color = A_REVERSE;
static int herc_current_color = A_NORMAL;
static int herc_highlight_state = 0;
/* Write a byte to a port. */ /* Write a byte to a port. */
static inline void static inline void
@ -36,36 +43,47 @@ outb (unsigned short port, unsigned char value)
static void static void
herc_set_cursor (void) herc_set_cursor (void)
{ {
unsigned offset = hercy * HERCULES_WIDTH + hercx; unsigned offset = herc_y * HERCULES_WIDTH + herc_x;
outb (HERCULES_INDEX_REG, 0x0f); outb (HERCULES_INDEX_REG, 0x0f);
outb (0x80, 0x0f); outb (0x80, 0);
outb (HERCULES_DATA_REG, offset & 0xFF); outb (HERCULES_DATA_REG, offset & 0xFF);
outb (0x80, offset & 0xFF); outb (0x80, 0);
outb (HERCULES_INDEX_REG, 0x0e); outb (HERCULES_INDEX_REG, 0x0e);
outb (0x80, 0x0e); outb (0x80, 0);
outb (HERCULES_DATA_REG, offset >> 8); outb (HERCULES_DATA_REG, offset >> 8);
outb (0x80, offset >> 8); outb (0x80, 0);
}
static void
herc_turn_cursor (int state)
{
outb (HERCULES_INDEX_REG, 0x0a);
outb (0x80, 0);
outb (HERCULES_DATA_REG, state ? 0 : (1 << 5));
outb (0x80, 0);
} }
void void
herc_putchar (int c) hercules_putchar (int c)
{ {
switch (c) switch (c)
{ {
case '\b': case '\b':
if (hercx) if (herc_x > 0)
hercx--; herc_x--;
break; break;
case '\n': case '\n':
hercy++; herc_y++;
break; break;
case '\r': case '\r':
hercx = 0; herc_x = 0;
break;
case '\a':
break; break;
default: default:
@ -73,23 +91,24 @@ herc_putchar (int c)
volatile unsigned short *video volatile unsigned short *video
= (unsigned short *) HERCULES_VIDEO_ADDR; = (unsigned short *) HERCULES_VIDEO_ADDR;
video[hercy * HERCULES_WIDTH + hercx] = 0x0700 | c; video[herc_y * HERCULES_WIDTH + herc_x]
hercx++; = (herc_current_color << 8) | c;
if (hercx >= HERCULES_WIDTH) herc_x++;
if (herc_x >= HERCULES_WIDTH)
{ {
hercx = 0; herc_x = 0;
hercy++; herc_y++;
} }
} }
break; break;
} }
if (hercy >= HERCULES_HEIGHT) if (herc_y >= HERCULES_HEIGHT)
{ {
int i;
volatile unsigned long *video = (unsigned long *) HERCULES_VIDEO_ADDR; volatile unsigned long *video = (unsigned long *) HERCULES_VIDEO_ADDR;
int i;
hercy = HERCULES_HEIGHT - 1; herc_y = HERCULES_HEIGHT - 1;
grub_memmove ((char *) HERCULES_VIDEO_ADDR, grub_memmove ((char *) HERCULES_VIDEO_ADDR,
(char *) HERCULES_VIDEO_ADDR + HERCULES_WIDTH * 2, (char *) HERCULES_VIDEO_ADDR + HERCULES_WIDTH * 2,
HERCULES_WIDTH * (HERCULES_HEIGHT - 1) * 2); HERCULES_WIDTH * (HERCULES_HEIGHT - 1) * 2);
@ -101,7 +120,7 @@ herc_putchar (int c)
} }
void void
herc_cls (void) hercules_cls (void)
{ {
int i; int i;
volatile unsigned long *video = (unsigned long *) HERCULES_VIDEO_ADDR; volatile unsigned long *video = (unsigned long *) HERCULES_VIDEO_ADDR;
@ -109,35 +128,45 @@ herc_cls (void)
for (i = 0; i < HERCULES_WIDTH * HERCULES_HEIGHT / 2; i++) for (i = 0; i < HERCULES_WIDTH * HERCULES_HEIGHT / 2; i++)
video[i] = 0x07200720; video[i] = 0x07200720;
hercx = hercy = 0; herc_x = herc_y = 0;
herc_set_cursor (); herc_set_cursor ();
herc_turn_cursor (1);
} }
int int
herc_getxy (void) hercules_getxy (void)
{ {
return (hercx << 8) | hercy; return (herc_x << 8) | herc_y;
} }
void void
herc_gotoxy (int x, int y) hercules_gotoxy (int x, int y)
{ {
hercx = x; herc_x = x;
hercy = y; herc_y = y;
herc_set_cursor (); herc_set_cursor ();
} }
void void
herc_set_attrib (int attr) hercules_highlight (int state)
{ {
volatile unsigned char *video = (unsigned char *) HERCULES_VIDEO_ADDR; herc_current_color = state ? herc_highlight_color : herc_normal_color;
herc_highlight_state = state;
}
if (attr & 0xF0) void
attr = 0x70; hercules_setcolor (int normal_color, int highlight_color)
else {
attr = 0x07; herc_normal_color = normal_color;
herc_highlight_color = highlight_color;
video[((hercy * HERCULES_WIDTH + hercx) << 1) + 1] = attr; hercules_highlight (herc_highlight_state);
}
void
hercules_nocursor (void)
{
herc_turn_cursor (0);
} }
#endif /* SUPPORT_HERCULES */ #endif /* SUPPORT_HERCULES */

View file

@ -28,11 +28,4 @@
#define HERCULES_INDEX_REG 0x3b4 #define HERCULES_INDEX_REG 0x3b4
#define HERCULES_DATA_REG 0x3b5 #define HERCULES_DATA_REG 0x3b5
/* Functions. */
void herc_putchar (int c);
void herc_cls (void);
int herc_getxy (void);
void herc_gotoxy (int x, int y);
void herc_set_attrib (int attr);
#endif /* ! GRUB_HERCULES_HEADER */ #endif /* ! GRUB_HERCULES_HEADER */

View file

@ -1,7 +1,7 @@
/* serial.c - serial device interface */ /* serial.c - serial device interface */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -22,7 +22,21 @@
#include <shared.h> #include <shared.h>
#include <serial.h> #include <serial.h>
#include <term.h>
/* An input buffer. */
static char input_buf[8];
static int npending = 0;
static int serial_x;
static int serial_y;
static int keep_track = 1;
/* Hardware-dependent definitions. */
#ifndef GRUB_UTIL
/* The structure for speed vs. divisor. */ /* The structure for speed vs. divisor. */
struct divisor struct divisor
{ {
@ -31,11 +45,11 @@ struct divisor
}; };
/* Store the port number of a serial unit. */ /* Store the port number of a serial unit. */
static unsigned short serial_port = 0; static unsigned short serial_hw_port = 0;
/* The table which lists common configurations. */ /* The table which lists common configurations. */
static struct divisor divisor_tab[] = static struct divisor divisor_tab[] =
{ {
{ 2400, 0x0030 }, { 2400, 0x0030 },
{ 4800, 0x0018 }, { 4800, 0x0018 },
{ 9600, 0x000C }, { 9600, 0x000C },
@ -43,9 +57,8 @@ static struct divisor divisor_tab[] =
{ 38400, 0x0003 }, { 38400, 0x0003 },
{ 57600, 0x0002 }, { 57600, 0x0002 },
{ 115200, 0x0001 } { 115200, 0x0001 }
}; };
/* Read a byte from a port. */ /* Read a byte from a port. */
static inline unsigned char static inline unsigned char
inb (unsigned short port) inb (unsigned short port)
@ -63,55 +76,45 @@ outb (unsigned short port, unsigned char value)
asm volatile ("outb %b0, %w1" : : "a" (value), "Nd" (port)); asm volatile ("outb %b0, %w1" : : "a" (value), "Nd" (port));
} }
/* The serial version of getkey. */ /* Fetch a key. */
int int
serial_getkey (void) serial_hw_fetch (void)
{ {
/* Wait until data is ready. */ if (inb ((serial_hw_port + UART_LSR) & UART_DATA_READY) == 0)
while ((inb (serial_port + UART_LSR) & UART_DATA_READY) == 0) return inb (serial_hw_port + UART_RX);
;
/* Read and return the data. */ return -1;
return inb (serial_port + UART_RX);
} }
/* The serial version of checkkey. This doesn't return a character code, /* Put a chararacter. */
but that doesn't matter actually. */
int
serial_checkkey (void)
{
unsigned char status;
status = inb (serial_port + UART_LSR);
return status & UART_DATA_READY ? : -1;
}
/* The serial version of grub_putchar. */
void void
serial_putchar (int c) serial_hw_put (int c)
{ {
/* Perhaps a timeout is necessary. */
int timeout = 10000; int timeout = 10000;
/* Wait until the transmitter holding register is empty. */ /* Wait until the transmitter holding register is empty. */
while ((inb (serial_port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0) while ((inb (serial_hw_port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0)
{
if (--timeout == 0) if (--timeout == 0)
/* There is something wrong. But what can I do? */ /* There is something wrong. But what can I do? */
return; return;
outb (serial_port + UART_TX, c); /* Insert a delay. */
serial_hw_delay ();
}
outb (serial_hw_port + UART_TX, c);
} }
/* Check if a serial port is set up. */ void
int serial_hw_delay (void)
serial_exists (void)
{ {
return serial_port != 0; outb (0x80, 0);
} }
/* Return the port number for the UNITth serial device. */ /* Return the port number for the UNITth serial device. */
unsigned short unsigned short
serial_get_port (int unit) serial_hw_get_port (int unit)
{ {
/* The BIOS data area. */ /* The BIOS data area. */
const unsigned short *addr = (const unsigned short *) 0x0400; const unsigned short *addr = (const unsigned short *) 0x0400;
@ -127,7 +130,7 @@ serial_get_port (int unit)
WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as WORD_LEN, PARITY and STOP_BIT_LEN are defined in the header file as
macros. */ macros. */
int int
serial_init (unsigned short port, unsigned int speed, serial_hw_init (unsigned short port, unsigned int speed,
int word_len, int parity, int stop_bit_len) int word_len, int parity, int stop_bit_len)
{ {
int i; int i;
@ -165,13 +168,255 @@ serial_init (unsigned short port, unsigned int speed,
outb (port + UART_MCR, UART_ENABLE_MODEM); outb (port + UART_MCR, UART_ENABLE_MODEM);
/* Store the port number. */ /* Store the port number. */
serial_port = port; serial_hw_port = port;
/* Drain the input buffer. */ /* Drain the input buffer. */
while (serial_checkkey () != -1) while (serial_checkkey () != -1)
(void) serial_getkey (); (void) serial_getkey ();
/* Get rid of TERM_NEED_INIT from the serial terminal. */
for (i = 0; term_table[i].name; i++)
if (grub_strcmp (term_table[i].name, "serial") == 0)
{
term_table[i].flags &= ~TERM_NEED_INIT;
break;
}
/* FIXME: should check if the serial terminal was found. */
return 1; return 1;
} }
#endif /* ! GRUB_UTIL */
/* Generic definitions. */
static void
serial_translate_key_sequence (void)
{
const struct
{
char key;
char ascii;
}
three_code_table[] =
{
{'A', 16},
{'B', 14},
{'C', 6},
{'D', 2},
{'F', 5},
{'H', 1},
{'4', 4}
};
const struct
{
short key;
char ascii;
}
four_code_table[] =
{
{('1' | ('~' << 8)), 1},
{('3' | ('~' << 8)), 4}
};
/* The buffer must start with ``ESC [''. */
if (*((unsigned short *) input_buf) != ('\e' | ('[' << 8)))
return;
if (npending >= 3)
{
int i;
for (i = 0;
i < sizeof (three_code_table) / sizeof (three_code_table[0]);
i++)
if (three_code_table[i].key == input_buf[2])
{
input_buf[0] = three_code_table[i].ascii;
npending -= 2;
grub_memmove (input_buf + 1, input_buf + 3, npending - 1);
return;
}
}
if (npending >= 4)
{
int i;
short key = *((short *) (input_buf + 2));
for (i = 0;
i < sizeof (four_code_table) / sizeof (four_code_table[0]);
i++)
if (four_code_table[i].key == key)
{
input_buf[0] = four_code_table[i].ascii;
npending -= 3;
grub_memmove (input_buf + 1, input_buf + 4, npending - 1);
return;
}
}
}
static
int fill_input_buf (void)
{
int i;
for (i = 0; i < 1000 && npending < sizeof (input_buf); i++)
{
int c;
c = serial_hw_fetch ();
if (c >= 0)
input_buf[npending++] = c;
/* Insert a delay. */
serial_hw_delay ();
}
/* Translate some key sequences. */
serial_translate_key_sequence ();
return npending;
}
/* The serial version of getkey. */
int
serial_getkey (void)
{
int c;
while (! fill_input_buf ())
;
c = input_buf[0];
npending--;
grub_memmove (input_buf, input_buf + 1, npending);
return c;
}
/* The serial version of checkkey. */
int
serial_checkkey (void)
{
if (fill_input_buf ())
return input_buf[0];
return -1;
}
/* The serial version of grub_putchar. */
void
serial_putchar (int c)
{
/* Keep track of the cursor. */
if (keep_track)
{
/* The serial terminal doesn't have VGA fonts. */
switch (c)
{
case DISP_UL:
c = ACS_ULCORNER;
break;
case DISP_UR:
c = ACS_URCORNER;
break;
case DISP_LL:
c = ACS_LLCORNER;
break;
case DISP_LR:
c = ACS_LRCORNER;
break;
case DISP_HORIZ:
c = ACS_HLINE;
break;
case DISP_VERT:
c = ACS_VLINE;
break;
case DISP_LEFT:
c = ACS_LARROW;
break;
case DISP_RIGHT:
c = ACS_RARROW;
break;
case DISP_UP:
c = ACS_UARROW;
break;
case DISP_DOWN:
c = ACS_DARROW;
break;
default:
break;
}
switch (c)
{
case '\r':
serial_x = 0;
break;
case '\n':
serial_y++;
break;
case '\b':
if (serial_x > 0)
serial_x--;
break;
case '\a':
break;
default:
if (serial_x >= 79)
{
serial_putchar ('\r');
serial_putchar ('\n');
}
serial_x++;
break;
}
}
serial_hw_put (c);
}
int
serial_getxy (void)
{
return (serial_x << 8) | serial_y;
}
void
serial_gotoxy (int x, int y)
{
keep_track = 0;
grub_printf ("\e[%d;%dH", y + 1, x + 1);
keep_track = 1;
serial_x = x;
serial_y = y;
}
void
serial_cls (void)
{
keep_track = 0;
grub_printf ("\e[H\e[J");
keep_track = 1;
serial_x = serial_y = 0;
}
void
serial_highlight (int state)
{
keep_track = 0;
grub_printf ("\e[%cm", state ? '7' : '0');
keep_track = 1;
}
#endif /* SUPPORT_SERIAL */ #endif /* SUPPORT_SERIAL */

View file

@ -1,7 +1,7 @@
/* serial.h - serial device interface */ /* serial.h - serial device interface */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -68,38 +68,26 @@
/* Function prototypes. */ /* Function prototypes. */
/* The serial part of grub_putchar. */ /* Fetch a key. */
void serial_putchar (int c); int serial_hw_fetch (void);
/* The serial part of getkey. */ /* Put a character. */
int serial_getkey (void); void serial_hw_put (int c);
/* The serial part of checkkey. */ /* Insert a delay. */
int serial_checkkey (void); void serial_hw_delay (void);
/* The serial part of cls. */
void serial_cls (void);
/* The serial part of getxy. */
int serial_getxy (void);
/* The serial part of gotoxy. */
void serial_gotoxy (int x, int y);
/* Return the port number for the UNITth serial device. */ /* Return the port number for the UNITth serial device. */
unsigned short serial_get_port (int unit); unsigned short serial_hw_get_port (int unit);
/* Initialize a serial device. */ /* Initialize a serial device. */
int serial_init (unsigned short port, unsigned int speed, int serial_hw_init (unsigned short port, unsigned int speed,
int word_len, int parity, int stop_bit_len); int word_len, int parity, int stop_bit_len);
/* Check if a serial port is set up. */
int serial_exists (void);
#ifdef GRUB_UTIL #ifdef GRUB_UTIL
/* Set the file name of a serial device (or a pty device). This is a /* Set the file name of a serial device (or a pty device). This is a
function specific to the grub shell. */ function specific to the grub shell. */
void set_serial_device (const char *device); void serial_set_device (const char *device);
#endif /* GRUB_UTIL */ #endif /* GRUB_UTIL */
#endif /* ! GRUB_SERIAL_HEADER */ #endif /* ! GRUB_SERIAL_HEADER */

View file

@ -334,29 +334,16 @@ extern char *grub_scratch_mem;
#define ACS_DARROW 'v' #define ACS_DARROW 'v'
/* Special graphics characters for IBM displays. */ /* Special graphics characters for IBM displays. */
#ifdef GRUB_UTIL #define DISP_UL 218
# define DISP_UL ACS_ULCORNER #define DISP_UR 191
# define DISP_UR ACS_URCORNER #define DISP_LL 192
# define DISP_LL ACS_LLCORNER #define DISP_LR 217
# define DISP_LR ACS_LRCORNER #define DISP_HORIZ 196
# define DISP_HORIZ ACS_HLINE #define DISP_VERT 179
# define DISP_VERT ACS_VLINE #define DISP_LEFT 0x1b
# define DISP_LEFT ACS_LARROW #define DISP_RIGHT 0x1a
# define DISP_RIGHT ACS_RARROW #define DISP_UP 0x18
# define DISP_UP ACS_UARROW #define DISP_DOWN 0x19
# define DISP_DOWN ACS_DARROW
#else /* ! GRUB_UTIL */
# define DISP_UL 218
# define DISP_UR 191
# define DISP_LL 192
# define DISP_LR 217
# define DISP_HORIZ 196
# define DISP_VERT 179
# define DISP_LEFT 0x1b
# define DISP_RIGHT 0x1a
# define DISP_UP 0x18
# define DISP_DOWN 0x19
#endif /* ! GRUB_UTIL */
/* Remap some libc-API-compatible function names so that we prevent /* Remap some libc-API-compatible function names so that we prevent
circularararity. */ circularararity. */
@ -546,7 +533,7 @@ typedef enum
ERR_BAD_ARGUMENT, ERR_BAD_ARGUMENT,
ERR_UNALIGNED, ERR_UNALIGNED,
ERR_PRIVILEGED, ERR_PRIVILEGED,
ERR_NEED_SERIAL, ERR_DEV_NEED_INIT,
ERR_NO_DISK_SPACE, ERR_NO_DISK_SPACE,
ERR_NUMBER_OVERFLOW, ERR_NUMBER_OVERFLOW,
@ -628,8 +615,6 @@ extern void (*disk_read_func) (int, int, int);
#ifndef STAGE1_5 #ifndef STAGE1_5
/* The flag for debug mode. */ /* The flag for debug mode. */
extern int debug; extern int debug;
/* Color settings */
extern int normal_color, highlight_color;
#endif /* STAGE1_5 */ #endif /* STAGE1_5 */
extern unsigned long current_drive; extern unsigned long current_drive;
@ -781,56 +766,29 @@ int currticks (void);
/* Clear the screen. */ /* Clear the screen. */
void cls (void); void cls (void);
/* The console part of cls. */
void console_cls (void);
#ifndef GRUB_UTIL
/* Turn off cursor. */ /* Turn off cursor. */
void nocursor (void); void nocursor (void);
#endif
/* Get the current cursor position (where 0,0 is the top left hand /* Get the current cursor position (where 0,0 is the top left hand
corner of the screen). Returns packed values, (RET >> 8) is x, corner of the screen). Returns packed values, (RET >> 8) is x,
(RET & 0xff) is y. */ (RET & 0xff) is y. */
int getxy (void); int getxy (void);
/* The console part of getxy. */
int console_getxy (void);
/* Set the cursor position. */ /* Set the cursor position. */
void gotoxy (int x, int y); void gotoxy (int x, int y);
/* The console part of gotoxy. */
void console_gotoxy (int x, int y);
/* Displays an ASCII character. IBM displays will translate some /* Displays an ASCII character. IBM displays will translate some
characters to special graphical ones (see the DISP_* constants). */ characters to special graphical ones (see the DISP_* constants). */
void grub_putchar (int c); void grub_putchar (int c);
/* The console part of grub_putchar. */
void console_putchar (int c);
/* Wait for a keypress, and return its packed BIOS/ASCII key code. /* Wait for a keypress, and return its packed BIOS/ASCII key code.
Use ASCII_CHAR(ret) to extract the ASCII code. */ Use ASCII_CHAR(ret) to extract the ASCII code. */
int getkey (void); int getkey (void);
/* The console part of getkey. */
int console_getkey (void);
/* Like GETKEY, but doesn't block, and returns -1 if no keystroke is /* Like GETKEY, but doesn't block, and returns -1 if no keystroke is
available. */ available. */
int checkkey (void); int checkkey (void);
/* The console part of checkkey. */
int console_checkkey (void);
/* Sets text mode character attribute at the cursor position. See A_*
constants defined above. */
void set_attrib (int attr);
/* The console part of set_attrib. */
void console_set_attrib (int attr);
/* Low-level disk I/O */ /* Low-level disk I/O */
int get_diskinfo (int drive, struct geometry *geometry); int get_diskinfo (int drive, struct geometry *geometry);
int biosdisk (int subfunc, int drive, struct geometry *geometry, int biosdisk (int subfunc, int drive, struct geometry *geometry,
@ -883,18 +841,6 @@ extern kernel_t kernel_type;
extern int show_menu; extern int show_menu;
extern int grub_timeout; extern int grub_timeout;
/* Control the auto fill mode. */
extern int auto_fill;
/* This variable specifies which console should be used. */
extern int terminal;
#define TERMINAL_CONSOLE (1 << 0) /* keyboard and screen */
#define TERMINAL_SERIAL (1 << 1) /* serial console */
#define TERMINAL_HERCULES (1 << 2) /* hercules */
#define TERMINAL_DUMB (1 << 16) /* dumb terminal */
void init_builtins (void); void init_builtins (void);
void init_config (void); void init_config (void);
char *skip_to (int after_equal, char *cmdline); char *skip_to (int after_equal, char *cmdline);
@ -951,7 +897,6 @@ int nul_terminate (char *str);
int get_based_digit (int c, int base); int get_based_digit (int c, int base);
int safe_parse_maxint (char **str_ptr, int *myint_ptr); int safe_parse_maxint (char **str_ptr, int *myint_ptr);
int memcheck (int start, int len); int memcheck (int start, int len);
int translate_keycode (int c);
#ifndef NO_DECOMPRESSION #ifndef NO_DECOMPRESSION
/* Compression support. */ /* Compression support. */

View file

@ -1,6 +1,6 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. * Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -17,7 +17,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "shared.h" #include <shared.h>
#include <term.h>
grub_jmp_buf restart_env; grub_jmp_buf restart_env;
@ -75,7 +76,6 @@ close_preset_menu (void)
#endif /* ! PRESET_MENU_STRING && ! SUPPORT_DISKLESS */ #endif /* ! PRESET_MENU_STRING && ! SUPPORT_DISKLESS */
static char * static char *
get_entry (char *list, int num, int nested) get_entry (char *list, int num, int nested)
{ {
@ -93,63 +93,67 @@ get_entry (char *list, int num, int nested)
return list; return list;
} }
/* Print an entry in a line of the menu box. */
static void static void
print_entries (int y, int size, int first, char *menu_entries) print_entry (int y, int highlight, char *entry)
{
int x;
highlight = (highlight && current_term->highlight);
if (highlight)
current_term->highlight (1);
gotoxy (2, y);
grub_putchar (' ');
for (x = 3; x < 75; x++)
{
if (*entry && x < 71)
grub_putchar (*entry++);
else
grub_putchar (' ');
}
gotoxy (74, y);
if (highlight)
current_term->highlight (0);
}
/* Print entries in the menu box. */
static void
print_entries (int y, int size, int first, int entryno, char *menu_entries)
{ {
int i; int i;
int disp_up = DISP_UP;
int disp_down = DISP_DOWN;
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
{
disp_up = ACS_UARROW;
disp_down = ACS_DARROW;
}
#endif /* SUPPORT_SERIAL */
gotoxy (77, y + 1); gotoxy (77, y + 1);
if (first) if (first)
grub_putchar (disp_up); grub_putchar (DISP_UP);
else else
grub_putchar (' '); grub_putchar (' ');
menu_entries = get_entry (menu_entries, first, 0); menu_entries = get_entry (menu_entries, first, 0);
for (i = 1; i <= size; i++) for (i = 0; i < size; i++)
{ {
int j = 0; print_entry (y + i + 1, entryno == i, menu_entries);
gotoxy (3, y + i);
while (*menu_entries) while (*menu_entries)
{
if (j < 71)
{
grub_putchar (*menu_entries);
j++;
}
menu_entries++; menu_entries++;
}
if (*(menu_entries - 1)) if (*(menu_entries - 1))
menu_entries++; menu_entries++;
for (; j < 71; j++)
grub_putchar (' ');
} }
gotoxy (77, y + size); gotoxy (77, y + size);
if (*menu_entries) if (*menu_entries)
grub_putchar (disp_down); grub_putchar (DISP_DOWN);
else else
grub_putchar (' '); grub_putchar (' ');
}
gotoxy (74, y + entryno + 1);
}
static void static void
print_entries_raw (int size, int first, char *menu_entries) print_entries_raw (int size, int first, char *menu_entries)
@ -182,56 +186,15 @@ static void
print_border (int y, int size) print_border (int y, int size)
{ {
int i; int i;
int disp_ul = DISP_UL;
int disp_ur = DISP_UR;
int disp_ll = DISP_LL;
int disp_lr = DISP_LR;
int disp_horiz = DISP_HORIZ;
int disp_vert = DISP_VERT;
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
{
disp_ul = ACS_ULCORNER;
disp_ur = ACS_URCORNER;
disp_ll = ACS_LLCORNER;
disp_lr = ACS_LRCORNER;
disp_horiz = ACS_HLINE;
disp_vert = ACS_VLINE;
}
#endif /* SUPPORT_SERIAL */
#ifndef GRUB_UTIL
/* Color the menu. The menu is 75 * 14 characters. */
# ifdef SUPPORT_SERIAL
if ((terminal & TERMINAL_CONSOLE)
# ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
# endif
)
# endif
{
for (i = 0; i < 14; i++)
{
int j;
for (j = 0; j < 75; j++)
{
gotoxy (j + 1, i + y);
set_attrib (normal_color);
}
}
}
#endif
gotoxy (1, y); gotoxy (1, y);
grub_putchar (disp_ul); grub_putchar (DISP_UL);
for (i = 0; i < 73; i++) for (i = 0; i < 73; i++)
grub_putchar (disp_horiz); grub_putchar (DISP_HORIZ);
grub_putchar (disp_ur); grub_putchar (DISP_UR);
i = 1; i = 1;
while (1) while (1)
{ {
gotoxy (1, y + i); gotoxy (1, y + i);
@ -239,81 +202,17 @@ print_border (int y, int size)
if (i > size) if (i > size)
break; break;
grub_putchar (disp_vert); grub_putchar (DISP_VERT);
gotoxy (75, y + i); gotoxy (75, y + i);
grub_putchar (disp_vert); grub_putchar (DISP_VERT);
i++; i++;
} }
grub_putchar (disp_ll); grub_putchar (DISP_LL);
for (i = 0; i < 73; i++) for (i = 0; i < 73; i++)
grub_putchar (disp_horiz); grub_putchar (DISP_HORIZ);
grub_putchar (disp_lr); grub_putchar (DISP_LR);
}
static void
set_line (int y, int entryno, int attr, char *menu_entries)
{
int x;
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
{
menu_entries = get_entry (menu_entries, entryno, 0);
gotoxy (2, y);
grub_putchar (' ');
for (x = 3; x < 75; x++)
{
if (*menu_entries && x < 71)
grub_putchar (*menu_entries++);
else
grub_putchar (' ');
}
}
else
#endif /* SUPPORT_SERIAL */
{
for (x = 2; x < 75; x++)
{
gotoxy (x, y);
set_attrib (attr);
}
}
gotoxy (74, y);
}
/* Set the attribute of the line Y to normal state. */
static void
set_line_normal (int y, int entryno, char *menu_entries)
{
#ifdef GRUB_UTIL
set_line (y, entryno, A_NORMAL, menu_entries);
#else
set_line (y, entryno, normal_color, menu_entries);
#endif
}
/* Set the attribute of the line Y to highlight state. */
static void
set_line_highlight (int y, int entryno, char *menu_entries)
{
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
grub_printf ("\e[7m");
#endif /* SUPPORT_SERIAL */
#ifdef GRUB_UTIL
set_line (y, entryno, A_REVERSE, menu_entries);
#else
set_line (y, entryno, highlight_color, menu_entries);
#endif
#ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_SERIAL)
grub_printf ("\e[0m");
#endif /* SUPPORT_SERIAL */
} }
static void static void
@ -322,8 +221,6 @@ run_menu (char *menu_entries, char *config_entries, int num_entries,
{ {
int c, time1, time2 = -1, first_entry = 0; int c, time1, time2 = -1, first_entry = 0;
char *cur_entry = 0; char *cur_entry = 0;
int disp_up = DISP_UP;
int disp_down = DISP_DOWN;
/* /*
* Main loop for menu UI. * Main loop for menu UI.
@ -331,8 +228,8 @@ run_menu (char *menu_entries, char *config_entries, int num_entries,
restart: restart:
/* Dumb terminal always use all entries for display /* Dumb terminal always use all entries for display
invariant for TERMINAL_DUMB: first_entry == 0 */ invariant for TERM_DUMB: first_entry == 0 */
if (! (terminal & TERMINAL_DUMB)) if (! (current_term->flags & TERM_DUMB))
{ {
while (entryno > 11) while (entryno > 11)
{ {
@ -387,49 +284,17 @@ restart:
/* Only display the menu if the user wants to see it. */ /* Only display the menu if the user wants to see it. */
if (show_menu) if (show_menu)
{ {
/* Disable the auto fill mode. */
auto_fill = 0;
init_page (); init_page ();
#ifndef GRUB_UTIL
# ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_CONSOLE)
# endif /* SUPPORT_SERIAL */
nocursor (); nocursor ();
#endif /* ! GRUB_UTIL */
if (! (terminal & TERMINAL_DUMB)) if (! (current_term->flags & TERM_DUMB))
print_border (3, 12); print_border (3, 12);
#ifdef GRUB_UTIL
/* In the grub shell, always use ACS_*. */
disp_up = ACS_UARROW;
disp_down = ACS_DARROW;
#else /* ! GRUB_UTIL */
# ifdef SUPPORT_SERIAL
if ((terminal & TERMINAL_CONSOLE)
# ifdef SUPPORT_HERCULES
|| (terminal & TERMINAL_HERCULES)
# endif /* SUPPORT_HERCULES */
)
{
disp_up = DISP_UP;
disp_down = DISP_DOWN;
}
else else
{
disp_up = ACS_UARROW;
disp_down = ACS_DARROW;
}
# endif /* SUPPORT_SERIAL */
#endif /* ! GRUB_UTIL */
if (terminal & TERMINAL_DUMB)
print_entries_raw (num_entries, first_entry, menu_entries); print_entries_raw (num_entries, first_entry, menu_entries);
grub_printf ("\n\ grub_printf ("\n\
Use the %c and %c keys to select which entry is highlighted.\n", Use the %c and %c keys to select which entry is highlighted.\n",
disp_up, disp_down); DISP_UP, DISP_DOWN);
if (! auth && password) if (! auth && password)
{ {
@ -451,16 +316,10 @@ restart:
selected line, or escape to go back to the main menu."); selected line, or escape to go back to the main menu.");
} }
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_printf ("\n\nThe selected entry is %d ", entryno); grub_printf ("\n\nThe selected entry is %d ", entryno);
else else
{ print_entries (3, 12, first_entry, entryno, menu_entries);
print_entries (3, 12, first_entry, menu_entries);
/* highlight initial line */
set_line_highlight (4 + entryno, first_entry + entryno,
menu_entries);
}
} }
/* XX using RT clock now, need to initialize value */ /* XX using RT clock now, need to initialize value */
@ -482,13 +341,14 @@ restart:
/* else not booting yet! */ /* else not booting yet! */
time2 = time1; time2 = time1;
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_printf ("\r Entry %d will be booted automatically in %d seconds. ", grub_printf ("\r Entry %d will be booted automatically in %d seconds. ",
entryno, grub_timeout); entryno, grub_timeout);
else else
{ {
gotoxy (3, 22); gotoxy (3, 22);
printf ("The highlighted entry will be booted automatically in %d seconds. ", grub_timeout); grub_printf ("The highlighted entry will be booted automatically in %d seconds. ",
grub_timeout);
gotoxy (74, 4 + entryno); gotoxy (74, 4 + entryno);
} }
@ -500,26 +360,26 @@ restart:
pressed. pressed.
This avoids polling (relevant in the grub-shell and later on This avoids polling (relevant in the grub-shell and later on
in grub if interrupt driven I/O is done). */ in grub if interrupt driven I/O is done). */
if ((checkkey () != -1) || (grub_timeout == -1)) if (checkkey () >= 0 || grub_timeout < 0)
{ {
/* Key was pressed, show which entry is selected before GETKEY, /* Key was pressed, show which entry is selected before GETKEY,
since we're comming in here also on GRUB_TIMEOUT == -1 and since we're comming in here also on GRUB_TIMEOUT == -1 and
hang in GETKEY */ hang in GETKEY */
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_printf ("\r Highlighted entry is %d: ", entryno); grub_printf ("\r Highlighted entry is %d: ", entryno);
c = translate_keycode (getkey ()); c = ASCII_CHAR (getkey ());
if (grub_timeout >= 0) if (grub_timeout >= 0)
{ {
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_putchar ('\r'); grub_putchar ('\r');
else else
gotoxy (3, 22); gotoxy (3, 22);
printf (" "); printf (" ");
grub_timeout = -1; grub_timeout = -1;
fallback_entry = -1; fallback_entry = -1;
if (! (terminal & TERMINAL_DUMB)) if (! (current_term->flags & TERM_DUMB))
gotoxy (74, 4 + entryno); gotoxy (74, 4 + entryno);
} }
@ -527,7 +387,7 @@ restart:
'^' or 'v' so accept these keys. */ '^' or 'v' so accept these keys. */
if (c == 16 || c == '^') if (c == 16 || c == '^')
{ {
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
{ {
if (entryno > 0) if (entryno > 0)
entryno--; entryno--;
@ -536,39 +396,48 @@ restart:
{ {
if (entryno > 0) if (entryno > 0)
{ {
set_line_normal (4 + entryno, first_entry + entryno, print_entry (4 + entryno, 0,
menu_entries); get_entry (menu_entries,
first_entry + entryno,
0));
entryno--; entryno--;
set_line_highlight (4 + entryno, first_entry + entryno, print_entry (4 + entryno, 1,
menu_entries); get_entry (menu_entries,
first_entry + entryno,
0));
} }
else if (first_entry > 0) else if (first_entry > 0)
{ {
first_entry--; first_entry--;
print_entries (3, 12, first_entry, menu_entries); print_entries (3, 12, first_entry, entryno,
set_line_highlight (4, first_entry + entryno,
menu_entries); menu_entries);
} }
} }
} }
if ((c == 14 || c == 'v') && first_entry + entryno + 1 < num_entries) else if ((c == 14 || c == 'v')
&& first_entry + entryno + 1 < num_entries)
{ {
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
entryno++; entryno++;
else else
{
if (entryno < 11) if (entryno < 11)
{ {
set_line_normal (4 + entryno, first_entry + entryno, print_entry (4 + entryno, 0,
menu_entries); get_entry (menu_entries,
first_entry + entryno,
0));
entryno++; entryno++;
set_line_highlight (4 + entryno, first_entry + entryno, print_entry (4 + entryno, 1,
menu_entries); get_entry (menu_entries,
first_entry + entryno,
0));
} }
else if (num_entries > 12 + first_entry) else if (num_entries > 12 + first_entry)
{ {
first_entry++; first_entry++;
print_entries (3, 12, first_entry, menu_entries); print_entries (3, 12, first_entry, entryno, menu_entries);
set_line_highlight (15, first_entry + entryno, menu_entries); }
} }
} }
@ -581,16 +450,18 @@ restart:
{ {
if ((c == 'd') || (c == 'o') || (c == 'O')) if ((c == 'd') || (c == 'o') || (c == 'O'))
{ {
if (! (terminal & TERMINAL_DUMB)) if (! (current_term->flags & TERM_DUMB))
set_line_normal (4 + entryno, first_entry + entryno, print_entry (4 + entryno, 0,
menu_entries); get_entry (menu_entries,
first_entry + entryno,
0));
/* insert after is almost exactly like insert before */ /* insert after is almost exactly like insert before */
if (c == 'o') if (c == 'o')
{ {
/* But `o' differs from `O', since it may causes /* But `o' differs from `O', since it may causes
the menu screen to scroll up. */ the menu screen to scroll up. */
if (entryno < 11 || (terminal & TERMINAL_DUMB)) if (entryno < 11 || (current_term->flags & TERM_DUMB))
entryno++; entryno++;
else else
first_entry++; first_entry++;
@ -604,7 +475,7 @@ restart:
if (c == 'O') if (c == 'O')
{ {
memmove (cur_entry + 2, cur_entry, grub_memmove (cur_entry + 2, cur_entry,
((int) heap) - ((int) cur_entry)); ((int) heap) - ((int) cur_entry));
cur_entry[0] = ' '; cur_entry[0] = ' ';
@ -620,7 +491,8 @@ restart:
first_entry + entryno + 1, first_entry + entryno + 1,
0); 0);
memmove (cur_entry, ptr, ((int) heap) - ((int) ptr)); grub_memmove (cur_entry, ptr,
((int) heap) - ((int) ptr));
heap -= (((int) ptr) - ((int) cur_entry)); heap -= (((int) ptr) - ((int) cur_entry));
num_entries--; num_entries--;
@ -631,7 +503,7 @@ restart:
first_entry--; first_entry--;
} }
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
{ {
grub_printf ("\n\n"); grub_printf ("\n\n");
print_entries_raw (num_entries, first_entry, print_entries_raw (num_entries, first_entry,
@ -639,11 +511,7 @@ restart:
grub_printf ("\n"); grub_printf ("\n");
} }
else else
{ print_entries (3, 12, first_entry, entryno, menu_entries);
print_entries (3, 12, first_entry, menu_entries);
set_line_highlight (4 + entryno, first_entry + entryno,
menu_entries);
}
} }
cur_entry = menu_entries; cur_entry = menu_entries;
@ -661,13 +529,13 @@ restart:
char entered[32]; char entered[32];
char *pptr = password; char *pptr = password;
if (terminal & TERMINAL_DUMB) if (current_term->flags & TERM_DUMB)
grub_printf ("\r "); grub_printf ("\r ");
else else
gotoxy (1, 21); gotoxy (1, 21);
/* Wipe out the previously entered password */ /* Wipe out the previously entered password */
memset (entered, 0, sizeof (entered)); grub_memset (entered, 0, sizeof (entered));
get_cmdline (" Password: ", entered, 31, '*', 0); get_cmdline (" Password: ", entered, 31, '*', 0);
while (! isspace (*pptr) && *pptr) while (! isspace (*pptr) && *pptr)
@ -704,7 +572,7 @@ restart:
} }
else else
{ {
printf ("Failed!\n Press any key to continue..."); grub_printf ("Failed!\n Press any key to continue...");
getkey (); getkey ();
goto restart; goto restart;
} }
@ -774,11 +642,11 @@ restart:
} }
/* align rest of commands properly */ /* align rest of commands properly */
memmove (cur_entry + j, cur_entry + i, grub_memmove (cur_entry + j, cur_entry + i,
((int) heap) - (((int) cur_entry) + i)); (int) heap - ((int) cur_entry + i));
/* copy command to correct area */ /* copy command to correct area */
memmove (cur_entry, new_heap, j); grub_memmove (cur_entry, new_heap, j);
heap += (j - i); heap += (j - i);
} }
@ -805,8 +673,6 @@ restart:
/* Attempt to boot an entry. */ /* Attempt to boot an entry. */
boot_entry: boot_entry:
/* Enable the auto fill mode. */
auto_fill = 1;
cls (); cls ();
@ -916,7 +782,7 @@ cmain (void)
auto void reset (void); auto void reset (void);
void reset (void) void reset (void)
{ {
auto_fill = 1; count_lines = -1;
config_len = 0; config_len = 0;
menu_len = 0; menu_len = 0;
num_entries = 0; num_entries = 0;