don't define unusable commands, don't handle a dumb terminal if serial terminal support is disabled, enable serial terminal support by default.
This commit is contained in:
parent
c6c180757e
commit
11f52a0d70
6 changed files with 144 additions and 122 deletions
35
ChangeLog
35
ChangeLog
|
@ -1,3 +1,38 @@
|
||||||
|
2000-09-27 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* configure.in (--enable-serial): Changed to ...
|
||||||
|
(--disable-serial): ... this. Now the serial support is enabled
|
||||||
|
by default.
|
||||||
|
|
||||||
|
2000-09-27 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* stage2/char_io.c [!STAGE1_5] (get_cmdline) [!SUPPORT_SERIAL]:
|
||||||
|
Don't check if the terminal is dumb. If the terminal is console,
|
||||||
|
always use console functions.
|
||||||
|
* stage2/builtins.c [!SUPPORT_NETBOOT] (bootp_func): Undefined.
|
||||||
|
[!SUPPORT_NETBOOT] (builtin_bootp): Likewise.
|
||||||
|
[!GRUB_UTIL] (device_func): Likewise.
|
||||||
|
[!GRUB_UTIL] (builtin_device): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (dhcp_func): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (builtin_dhcp): Likewise.
|
||||||
|
[!GRUB_UTIL] (quit_func): Likewise.
|
||||||
|
[!GRUB_UTIL] (builtin_quit): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (rarp_func): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (builtin_rarp): Likewise.
|
||||||
|
[!SUPPORT_SERIAL] (serial_func): Likewise.
|
||||||
|
[!SUPPORT_SERIAL] (builtin_serial): Likewise.
|
||||||
|
[!SUPPORT_SERIAL] (terminal_func): Likewise.
|
||||||
|
[!SUPPORT_SERIAL] (builtin_terminal): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (tftpserver_func): Likewise.
|
||||||
|
[!SUPPORT_NETBOOT] (builtin_tftpserver): Likewise.
|
||||||
|
(builtin_table) [!SUPPORT_NETBOOT]: Removed the pointers to
|
||||||
|
BUILTIN_BOOTP, BUILTIN_DHCP, BUILTIN_RARP, and
|
||||||
|
BUILTIN_TFTPSERVER.
|
||||||
|
(builtin_table) [!SUPPORT_SERIAL]: Removed the pointers to
|
||||||
|
BUILTIN_SERIAL and BUILTIN_TERMINAL.
|
||||||
|
(builtin_table) [!GRUB_UTIL]: Removed the pointers to
|
||||||
|
BUILTIN_DEVICE and BUILTIN_QUIT.
|
||||||
|
|
||||||
2000-09-26 OKUJI Yoshinori <okuji@gnu.org>
|
2000-09-26 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
* util/grub-install.in (bootdir_device): New variable. If
|
* util/grub-install.in (bootdir_device): New variable. If
|
||||||
|
|
20
INSTALL
20
INSTALL
|
@ -43,11 +43,15 @@ configure script.
|
||||||
Texinfo release. See the webpage
|
Texinfo release. See the webpage
|
||||||
<http://www.gnu.org/software/texinfo/texinfo.html>.
|
<http://www.gnu.org/software/texinfo/texinfo.html>.
|
||||||
|
|
||||||
* GNU Automake 20000319 or later
|
* Our version of GNU Automake
|
||||||
|
|
||||||
The new feature "per-executable flags" is required, so you need to
|
We use the new feature "per-executable flags" in the CVS version, but
|
||||||
get an unreleased version from the CVS. See the webpage
|
it is too buggy for us, so a locally patched version is required at
|
||||||
<http://sourceware.cygnus.com/automake/>.
|
the moment. You can obtain this from
|
||||||
|
<ftp://duff.kuicr.kyoto-u.ac.jp/pub/grub/automake-1.4a-for-grub.tar.gz>.
|
||||||
|
|
||||||
|
NOTE: This is a temporary solution. We will use the official version
|
||||||
|
again, once they fix the critical bugs.
|
||||||
|
|
||||||
|
|
||||||
Configuring the GRUB
|
Configuring the GRUB
|
||||||
|
@ -216,6 +220,14 @@ operates.
|
||||||
`--without-curses'
|
`--without-curses'
|
||||||
Don't use the curses library.
|
Don't use the curses library.
|
||||||
|
|
||||||
|
`--disable-serial'
|
||||||
|
Omit the serial terminal support in Stage 2.
|
||||||
|
|
||||||
|
`--enable-serial-speed-simulation'
|
||||||
|
Simulate the slowness of a serial device in the grub shell. This
|
||||||
|
option is useful for GRUB developers, as you can test the
|
||||||
|
performance of a terminal emulation even on pseudo terminals.
|
||||||
|
|
||||||
|
|
||||||
`configure' also accepts several options for the network support. See
|
`configure' also accepts several options for the network support. See
|
||||||
the file `netboot/README.netboot', for more information.
|
the file `netboot/README.netboot', for more information.
|
||||||
|
|
6
configure
vendored
6
configure
vendored
|
@ -115,10 +115,10 @@ ac_help="$ac_help
|
||||||
ac_help="$ac_help
|
ac_help="$ac_help
|
||||||
--enable-diskless enable diskless support"
|
--enable-diskless enable diskless support"
|
||||||
ac_help="$ac_help
|
ac_help="$ac_help
|
||||||
--enable-serial enable serial terminal support"
|
--disable-serial diable serial terminal support"
|
||||||
ac_help="$ac_help
|
ac_help="$ac_help
|
||||||
--enable-serial-speed-simulation
|
--enable-serial-speed-simulation
|
||||||
simulate the slowness of a serial device"
|
simulate the slowness of a serial device"
|
||||||
|
|
||||||
# Initialize some variables set by options.
|
# Initialize some variables set by options.
|
||||||
# The variables have the same names as the options, with
|
# The variables have the same names as the options, with
|
||||||
|
@ -2847,7 +2847,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test "x$enable_serial" = xyes; then
|
if test "x$enable_serial" != xno; then
|
||||||
SERIAL_SUPPORT_TRUE=
|
SERIAL_SUPPORT_TRUE=
|
||||||
SERIAL_SUPPORT_FALSE='#'
|
SERIAL_SUPPORT_FALSE='#'
|
||||||
else
|
else
|
||||||
|
|
|
@ -495,13 +495,13 @@ AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
|
||||||
|
|
||||||
dnl Serial terminal
|
dnl Serial terminal
|
||||||
AC_ARG_ENABLE(serial,
|
AC_ARG_ENABLE(serial,
|
||||||
[ --enable-serial enable serial terminal support])
|
[ --disable-serial diable serial terminal support])
|
||||||
AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" = xyes)
|
AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" != xno)
|
||||||
|
|
||||||
dnl Simulation of the slowness of a serial device.
|
dnl Simulation of the slowness of a serial device.
|
||||||
AC_ARG_ENABLE(serial-speed-simulation,
|
AC_ARG_ENABLE(serial-speed-simulation,
|
||||||
[ --enable-serial-speed-simulation
|
[ --enable-serial-speed-simulation
|
||||||
simulate the slowness of a serial device])
|
simulate the slowness of a serial device])
|
||||||
AM_CONDITIONAL(SERIAL_SPEED_SIMULATION,
|
AM_CONDITIONAL(SERIAL_SPEED_SIMULATION,
|
||||||
test "x$enable_serial_speed_simulation" = xyes)
|
test "x$enable_serial_speed_simulation" = xyes)
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@ int terminal = TERMINAL_CONSOLE;
|
||||||
kernel_t kernel_type;
|
kernel_t kernel_type;
|
||||||
/* The boot device. */
|
/* The boot device. */
|
||||||
static int bootdev;
|
static int bootdev;
|
||||||
/* True when the debug mode is turned on, and false when it is turned off. */
|
/* True when the debug mode is turned on, and false
|
||||||
|
when it is turned off. */
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
/* The default entry. */
|
/* The default entry. */
|
||||||
int default_entry = 0;
|
int default_entry = 0;
|
||||||
|
@ -310,11 +311,11 @@ static struct builtin builtin_boot =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
/* bootp */
|
/* bootp */
|
||||||
static int
|
static int
|
||||||
bootp_func (char *arg, int flags)
|
bootp_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_NETBOOT
|
|
||||||
if (! bootp ())
|
if (! bootp ())
|
||||||
{
|
{
|
||||||
if (errnum == ERR_NONE)
|
if (errnum == ERR_NONE)
|
||||||
|
@ -326,10 +327,6 @@ bootp_func (char *arg, int flags)
|
||||||
/* Notify the configuration. */
|
/* Notify the configuration. */
|
||||||
print_network_configuration ();
|
print_network_configuration ();
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_bootp =
|
static struct builtin builtin_bootp =
|
||||||
|
@ -340,6 +337,7 @@ static struct builtin builtin_bootp =
|
||||||
"bootp",
|
"bootp",
|
||||||
"Initialize a network device via BOOTP."
|
"Initialize a network device via BOOTP."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
|
|
||||||
|
|
||||||
/* cat */
|
/* cat */
|
||||||
|
@ -742,11 +740,11 @@ static struct builtin builtin_default =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef GRUB_UTIL
|
||||||
/* device */
|
/* device */
|
||||||
static int
|
static int
|
||||||
device_func (char *arg, int flags)
|
device_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef GRUB_UTIL
|
|
||||||
char *drive = arg;
|
char *drive = arg;
|
||||||
char *device;
|
char *device;
|
||||||
|
|
||||||
|
@ -769,11 +767,6 @@ device_func (char *arg, int flags)
|
||||||
assign_device_name (current_drive, device);
|
assign_device_name (current_drive, device);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#else /* ! GRUB_UTIL */
|
|
||||||
/* In Stage 2, this command cannot be used. */
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif /* GRUB_UTIL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_device =
|
static struct builtin builtin_device =
|
||||||
|
@ -785,8 +778,10 @@ static struct builtin builtin_device =
|
||||||
"Specify DEVICE as the actual drive for a BIOS drive DRIVE. This command"
|
"Specify DEVICE as the actual drive for a BIOS drive DRIVE. This command"
|
||||||
" can be used only in the grub shell."
|
" can be used only in the grub shell."
|
||||||
};
|
};
|
||||||
|
#endif /* GRUB_UTIL */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
/* dhcp */
|
/* dhcp */
|
||||||
static int
|
static int
|
||||||
dhcp_func (char *arg, int flags)
|
dhcp_func (char *arg, int flags)
|
||||||
|
@ -803,6 +798,7 @@ static struct builtin builtin_dhcp =
|
||||||
"dhcp",
|
"dhcp",
|
||||||
"Initialize a network device via DHCP."
|
"Initialize a network device via DHCP."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
|
|
||||||
|
|
||||||
/* displaymem */
|
/* displaymem */
|
||||||
|
@ -2428,19 +2424,15 @@ static struct builtin builtin_pause =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef GRUB_UTIL
|
||||||
/* quit */
|
/* quit */
|
||||||
static int
|
static int
|
||||||
quit_func (char *arg, int flags)
|
quit_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef GRUB_UTIL
|
|
||||||
stop ();
|
stop ();
|
||||||
|
|
||||||
/* Never reach here. */
|
/* Never reach here. */
|
||||||
return 0;
|
return 0;
|
||||||
#else /* ! GRUB_UTIL */
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif /* ! GRUB_UTIL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_quit =
|
static struct builtin builtin_quit =
|
||||||
|
@ -2451,12 +2443,14 @@ static struct builtin builtin_quit =
|
||||||
"quit",
|
"quit",
|
||||||
"Exit from the GRUB shell."
|
"Exit from the GRUB shell."
|
||||||
};
|
};
|
||||||
|
#endif /* GRUB_UTIL */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
|
/* rarp */
|
||||||
static int
|
static int
|
||||||
rarp_func (char *arg, int flags)
|
rarp_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_NETBOOT
|
|
||||||
if (! rarp ())
|
if (! rarp ())
|
||||||
{
|
{
|
||||||
if (errnum == ERR_NONE)
|
if (errnum == ERR_NONE)
|
||||||
|
@ -2468,10 +2462,6 @@ rarp_func (char *arg, int flags)
|
||||||
/* Notify the configuration. */
|
/* Notify the configuration. */
|
||||||
print_network_configuration ();
|
print_network_configuration ();
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_rarp =
|
static struct builtin builtin_rarp =
|
||||||
|
@ -2482,6 +2472,7 @@ static struct builtin builtin_rarp =
|
||||||
"rarp",
|
"rarp",
|
||||||
"Initialize a network device via RARP."
|
"Initialize a network device via RARP."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -2724,11 +2715,11 @@ static struct builtin builtin_savedefault =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_SERIAL
|
||||||
/* serial */
|
/* serial */
|
||||||
static int
|
static int
|
||||||
serial_func (char *arg, int flags)
|
serial_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_SERIAL
|
|
||||||
unsigned short port = serial_get_port (0);
|
unsigned short port = serial_get_port (0);
|
||||||
unsigned int speed = 9600;
|
unsigned int speed = 9600;
|
||||||
int word_len = UART_8BITS_WORD;
|
int word_len = UART_8BITS_WORD;
|
||||||
|
@ -2858,11 +2849,6 @@ serial_func (char *arg, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#else /* ! SUPPORT_SERIAL */
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif /* ! SUPPORT_SERIAL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_serial =
|
static struct builtin builtin_serial =
|
||||||
|
@ -2879,6 +2865,7 @@ static struct builtin builtin_serial =
|
||||||
" in the grub shell, which specifies the file name of a tty device. The"
|
" in the grub shell, which specifies the file name of a tty device. The"
|
||||||
" default values are COM1, 9600, 8N1."
|
" default values are COM1, 9600, 8N1."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_SERIAL */
|
||||||
|
|
||||||
|
|
||||||
/* setkey */
|
/* setkey */
|
||||||
|
@ -3405,6 +3392,7 @@ static struct builtin builtin_setup =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_SERIAL
|
||||||
/* terminal */
|
/* terminal */
|
||||||
static int
|
static int
|
||||||
terminal_func (char *arg, int flags)
|
terminal_func (char *arg, int flags)
|
||||||
|
@ -3438,11 +3426,9 @@ terminal_func (char *arg, int flags)
|
||||||
if (terminal & TERMINAL_CONSOLE)
|
if (terminal & TERMINAL_CONSOLE)
|
||||||
grub_printf ("console%s\n",
|
grub_printf ("console%s\n",
|
||||||
terminal & TERMINAL_DUMB ? " (dumb)" : "");
|
terminal & TERMINAL_DUMB ? " (dumb)" : "");
|
||||||
#ifdef SUPPORT_SERIAL
|
|
||||||
else if (terminal & TERMINAL_SERIAL)
|
else if (terminal & TERMINAL_SERIAL)
|
||||||
grub_printf ("serial%s\n",
|
grub_printf ("serial%s\n",
|
||||||
terminal & TERMINAL_DUMB ? " (dumb)" : " (vt100)");
|
terminal & TERMINAL_DUMB ? " (dumb)" : " (vt100)");
|
||||||
#endif /* SUPPORT_SERIAL */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3457,14 +3443,12 @@ terminal_func (char *arg, int flags)
|
||||||
if (! default_terminal)
|
if (! default_terminal)
|
||||||
default_terminal = TERMINAL_CONSOLE;
|
default_terminal = TERMINAL_CONSOLE;
|
||||||
}
|
}
|
||||||
#ifdef SUPPORT_SERIAL
|
|
||||||
else if (grub_memcmp (arg, "serial", sizeof ("serial") - 1) == 0)
|
else if (grub_memcmp (arg, "serial", sizeof ("serial") - 1) == 0)
|
||||||
{
|
{
|
||||||
terminal |= TERMINAL_SERIAL;
|
terminal |= TERMINAL_SERIAL;
|
||||||
if (! default_terminal)
|
if (! default_terminal)
|
||||||
default_terminal = TERMINAL_SERIAL;
|
default_terminal = TERMINAL_SERIAL;
|
||||||
}
|
}
|
||||||
#endif /* SUPPORT_SERIAL */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
terminal = saved_terminal;
|
terminal = saved_terminal;
|
||||||
|
@ -3475,7 +3459,6 @@ terminal_func (char *arg, int flags)
|
||||||
arg = skip_to (0, arg);
|
arg = skip_to (0, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SUPPORT_SERIAL
|
|
||||||
/* If a seial console is turned on, wait until the user pushes any key. */
|
/* If a seial console is turned on, wait until the user pushes any key. */
|
||||||
if (terminal & TERMINAL_SERIAL)
|
if (terminal & TERMINAL_SERIAL)
|
||||||
{
|
{
|
||||||
|
@ -3520,7 +3503,6 @@ terminal_func (char *arg, int flags)
|
||||||
/* Expired. */
|
/* Expired. */
|
||||||
terminal &= (default_terminal | TERMINAL_DUMB);
|
terminal &= (default_terminal | TERMINAL_DUMB);
|
||||||
}
|
}
|
||||||
#endif /* SUPPORT_SERIAL */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3539,6 +3521,7 @@ static struct builtin builtin_terminal =
|
||||||
" 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."
|
" seconds."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_SERIAL */
|
||||||
|
|
||||||
|
|
||||||
/* testload */
|
/* testload */
|
||||||
|
@ -3629,11 +3612,11 @@ static struct builtin builtin_testload =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
/* tftpserver */
|
/* tftpserver */
|
||||||
static int
|
static int
|
||||||
tftpserver_func (char *arg, int flags)
|
tftpserver_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_NETBOOT
|
|
||||||
if (! *arg || ! arp_server_override (arg))
|
if (! *arg || ! arp_server_override (arg))
|
||||||
{
|
{
|
||||||
errnum = ERR_BAD_ARGUMENT;
|
errnum = ERR_BAD_ARGUMENT;
|
||||||
|
@ -3642,10 +3625,6 @@ tftpserver_func (char *arg, int flags)
|
||||||
|
|
||||||
print_network_configuration ();
|
print_network_configuration ();
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
|
||||||
errnum = ERR_UNRECOGNIZED;
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct builtin builtin_tftpserver =
|
static struct builtin builtin_tftpserver =
|
||||||
|
@ -3656,6 +3635,7 @@ static struct builtin builtin_tftpserver =
|
||||||
"tftpserver IPADDR",
|
"tftpserver IPADDR",
|
||||||
"Override the TFTP server address."
|
"Override the TFTP server address."
|
||||||
};
|
};
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
|
|
||||||
|
|
||||||
/* timeout */
|
/* timeout */
|
||||||
|
@ -3753,7 +3733,9 @@ struct builtin *builtin_table[] =
|
||||||
{
|
{
|
||||||
&builtin_blocklist,
|
&builtin_blocklist,
|
||||||
&builtin_boot,
|
&builtin_boot,
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
&builtin_bootp,
|
&builtin_bootp,
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
&builtin_cat,
|
&builtin_cat,
|
||||||
&builtin_chainloader,
|
&builtin_chainloader,
|
||||||
&builtin_cmp,
|
&builtin_cmp,
|
||||||
|
@ -3761,8 +3743,12 @@ struct builtin *builtin_table[] =
|
||||||
&builtin_configfile,
|
&builtin_configfile,
|
||||||
&builtin_debug,
|
&builtin_debug,
|
||||||
&builtin_default,
|
&builtin_default,
|
||||||
|
#ifdef GRUB_UTIL
|
||||||
&builtin_device,
|
&builtin_device,
|
||||||
|
#endif /* GRUB_UTIL */
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
&builtin_dhcp,
|
&builtin_dhcp,
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
&builtin_displaymem,
|
&builtin_displaymem,
|
||||||
&builtin_embed,
|
&builtin_embed,
|
||||||
&builtin_fallback,
|
&builtin_fallback,
|
||||||
|
@ -3785,19 +3771,29 @@ struct builtin *builtin_table[] =
|
||||||
&builtin_modulenounzip,
|
&builtin_modulenounzip,
|
||||||
&builtin_password,
|
&builtin_password,
|
||||||
&builtin_pause,
|
&builtin_pause,
|
||||||
|
#ifdef GRUB_UTIL
|
||||||
&builtin_quit,
|
&builtin_quit,
|
||||||
|
#endif /* GRUB_UTIL */
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
&builtin_rarp,
|
&builtin_rarp,
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
&builtin_read,
|
&builtin_read,
|
||||||
&builtin_reboot,
|
&builtin_reboot,
|
||||||
&builtin_root,
|
&builtin_root,
|
||||||
&builtin_rootnoverify,
|
&builtin_rootnoverify,
|
||||||
&builtin_savedefault,
|
&builtin_savedefault,
|
||||||
|
#ifdef SUPPORT_SERIAL
|
||||||
&builtin_serial,
|
&builtin_serial,
|
||||||
|
#endif /* SUPPORT_SERIAL */
|
||||||
&builtin_setkey,
|
&builtin_setkey,
|
||||||
&builtin_setup,
|
&builtin_setup,
|
||||||
|
#ifdef SUPPORT_SERIAL
|
||||||
&builtin_terminal,
|
&builtin_terminal,
|
||||||
|
#endif /* SUPPORT_SERIAL */
|
||||||
&builtin_testload,
|
&builtin_testload,
|
||||||
|
#ifdef SUPPORT_NETBOOT
|
||||||
&builtin_tftpserver,
|
&builtin_tftpserver,
|
||||||
|
#endif /* SUPPORT_NETBOOT */
|
||||||
&builtin_timeout,
|
&builtin_timeout,
|
||||||
&builtin_title,
|
&builtin_title,
|
||||||
&builtin_unhide,
|
&builtin_unhide,
|
||||||
|
|
125
stage2/char_io.c
125
stage2/char_io.c
|
@ -300,34 +300,27 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
cl_refresh (1, 0);
|
cl_refresh (1, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
xpos -= count;
|
xpos -= count;
|
||||||
|
|
||||||
if (! (terminal & TERMINAL_DUMB))
|
if (terminal & TERMINAL_CONSOLE)
|
||||||
{
|
{
|
||||||
if (terminal & TERMINAL_CONSOLE)
|
int y = getxy () & 0xFF;
|
||||||
{
|
|
||||||
int y = getxy () & 0xFF;
|
gotoxy (xpos, y);
|
||||||
|
|
||||||
gotoxy (xpos, y);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
# ifdef SUPPORT_SERIAL
|
|
||||||
else if (terminal & TERMINAL_SERIAL)
|
|
||||||
{
|
|
||||||
/* Ugly optimization. */
|
|
||||||
if (count > 4)
|
|
||||||
{
|
|
||||||
grub_printf ("\e[%dD", count);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# endif /* SUPPORT_SERIAL */
|
|
||||||
}
|
}
|
||||||
|
# ifdef SUPPORT_SERIAL
|
||||||
for (i = 0; i < count; i++)
|
else if (! (terminal & TERMINAL_DUMB) && (count > 4))
|
||||||
grub_putchar ('\b');
|
{
|
||||||
|
grub_printf ("\e[%dD", count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < count; i++)
|
||||||
|
grub_putchar ('\b');
|
||||||
|
}
|
||||||
|
# endif /* SUPPORT_SERIAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,39 +334,32 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
cl_refresh (1, 0);
|
cl_refresh (1, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
xpos += count;
|
xpos += count;
|
||||||
|
|
||||||
if (! (terminal & TERMINAL_DUMB))
|
if (terminal & TERMINAL_CONSOLE)
|
||||||
{
|
{
|
||||||
if (terminal & TERMINAL_CONSOLE)
|
int y = getxy () & 0xFF;
|
||||||
{
|
|
||||||
int y = getxy () & 0xFF;
|
gotoxy (xpos, y);
|
||||||
|
}
|
||||||
gotoxy (xpos, y);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
# ifdef SUPPORT_SERIAL
|
# ifdef SUPPORT_SERIAL
|
||||||
else if (terminal & TERMINAL_SERIAL)
|
else if (! (terminal & TERMINAL_DUMB) && (count > 4))
|
||||||
{
|
|
||||||
/* Ugly optimization. */
|
|
||||||
if (count > 4)
|
|
||||||
{
|
|
||||||
grub_printf ("\e[%dC", count);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# endif /* SUPPORT_SERIAL */
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = lpos - count; i < lpos; i++)
|
|
||||||
{
|
{
|
||||||
if (! echo_char)
|
grub_printf ("\e[%dC", count);
|
||||||
grub_putchar (buf[i]);
|
|
||||||
else
|
|
||||||
grub_putchar (echo_char);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = lpos - count; i < lpos; i++)
|
||||||
|
{
|
||||||
|
if (! echo_char)
|
||||||
|
grub_putchar (buf[i]);
|
||||||
|
else
|
||||||
|
grub_putchar (echo_char);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif /* SUPPORT_SERIAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,30 +458,23 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Back to XPOS. */
|
/* Back to XPOS. */
|
||||||
if (! (terminal & TERMINAL_DUMB))
|
if (terminal & TERMINAL_CONSOLE)
|
||||||
{
|
{
|
||||||
if (terminal & TERMINAL_CONSOLE)
|
int y = getxy () & 0xFF;
|
||||||
{
|
|
||||||
int y = getxy () & 0xFF;
|
gotoxy (xpos, y);
|
||||||
|
|
||||||
gotoxy (xpos, y);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
# ifdef SUPPORT_SERIAL
|
|
||||||
else if (terminal & TERMINAL_SERIAL)
|
|
||||||
{
|
|
||||||
/* Ugly optimization. */
|
|
||||||
if (pos - xpos > 4)
|
|
||||||
{
|
|
||||||
grub_printf ("\e[%dD", pos - xpos);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# endif /* SUPPORT_SERIAL */
|
|
||||||
}
|
}
|
||||||
|
# ifdef SUPPORT_SERIAL
|
||||||
for (i = 0; i < pos - xpos; i++)
|
else if (! (terminal & TERMINAL_SERIAL) && (pos - xpos > 4))
|
||||||
grub_putchar ('\b');
|
{
|
||||||
|
grub_printf ("\e[%dD", pos - xpos);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < pos - xpos; i++)
|
||||||
|
grub_putchar ('\b');
|
||||||
|
}
|
||||||
|
# endif /* SUPPORT_SERIAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the command-line. */
|
/* Initialize the command-line. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue