diff --git a/ChangeLog b/ChangeLog index e6930328f..8b8647f40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +1999-07-14 OKUJI Yoshinori + + The function ungetch is simulated so that the user can use a + buggy curses. + + * grub/asmstub.c [HAVE_LIBCURSES] (save_char): New variable. + (getkey) [HAVE_LIBCURSES]: If SAVE_CHAR is not ERR, return + SAVE_CHAR and clear it. + (checkkey) [HAVE_LIBCURSES]: If SAVE_CHAR is not ERR, return + SAVE_CHAR. If C is not ERR, set SAVE_CHAR to C. + +1999-07-14 Pavel Roskin + + * stage2/char_io.c (get_cmdline) [GRUB_UTIL]: Recognize + backspace when ncurses fails to do this. + + * grub/asmstub.c (grub_stage2) [HAVE_LIBCURSES]: Call wtimeout + instead of nodelay. + (getkey) [HAVE_LIBCURSES]: Likewise. + 1999-07-14 OKUJI Yoshinori * stage1/stage1_lba.S (probe_values): New variable. This is not diff --git a/README b/README index 59c095896..1eca68a76 100644 --- a/README +++ b/README @@ -21,12 +21,6 @@ you use the following utilities: and 2.9.1.0.x, and we support only 2.9.1.0.x. It is available from ftp.XX.kernel.org (XX is the country code, such as `jp'). -* ncurses 4.0 and later (1.9.9 is too buggy, so don't use it.) - - Ncurses is used for /sbin/grub, so it may not be needed if you don't -use /sbin/grub. Ncurses 4.0 is available from many ftp sites. (Should we -use terminfo or termcap directly?) - These below are required when you develop GRUB or when you get it from the CVS: @@ -35,17 +29,17 @@ the CVS: Autoconf 2.13 has a bug that can't handle any macro with arguments, so you need to get the later version from the CVS. See -http://sourceware.cygnus.com/autoconf for more information. +http://sourceware.cygnus.com/autoconf/ for more information. * automake 19990620 and later The new feature, per-executable flags, is requred, so you need to get an unreleased version from the CVS. See -http://sourceware.cygnus.com/automake for more information. +http://sourceware.cygnus.com/automake/ for more information. * texinfo 3.12h and later - The latest snapshot of Texinfo is available from alpha.gnu.org. + The latest snapshot of Texinfo is available from ftp.texinfo.org. See the file INSTALL for instructions on how to build and install the diff --git a/docs/grub.texi b/docs/grub.texi index 7ecc8aef1..faced2184 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1081,7 +1081,7 @@ which are unknown. @item 10 : Unsupported Multiboot features requested This error is returned when the Multiboot features word in the Multiboot header requires a feature that is not recognized. The point of this is -that the kernel requires special handling which GRUB is likely usable to +that the kernel requires special handling which GRUB is likely unable to provide. @item 11 : Device string unrecognizable diff --git a/grub/asmstub.c b/grub/asmstub.c index bd126ae60..c616a72cf 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -220,7 +220,7 @@ grub_stage2 (void) nonl (); scrollok (stdscr, TRUE); keypad (stdscr, TRUE); - nodelay (stdscr, TRUE); + wtimeout (stdscr, 100); } #endif @@ -443,6 +443,13 @@ grub_putchar (int c) } +/* The store for ungetch simulation. This is necessary, because + ncurses-1.9.9g is still used in the world and its ungetch is + completely broken. */ +#ifdef HAVE_LIBCURSES +static int save_char = ERR; +#endif + /* returns packed BIOS/ASCII code */ int getkey (void) @@ -451,9 +458,18 @@ getkey (void) if (use_curses) { int c; - nodelay (stdscr, FALSE); + + /* If checkkey has already got a character, then return it. */ + if (save_char != ERR) + { + c = save_char; + save_char = ERR; + return c; + } + + wtimeout (stdscr, -1); c = getch (); - nodelay (stdscr, TRUE); + wtimeout (stdscr, 100); return c; } #endif @@ -470,10 +486,16 @@ checkkey (void) if (use_curses) { int c; + + /* Check for SAVE_CHAR. This should not be true, because this + means checkkey is called twice continuously. */ + if (save_char != ERR) + return save_char; + c = getch (); /* If C is not ERR, then put it back in the input queue. */ if (c != ERR) - ungetch (c); /* FIXME: ncurses-1.9.9g ungetch is buggy. */ + save_char = c; return c; } #endif diff --git a/stage2/char_io.c b/stage2/char_io.c index 7e8b19f9d..58727fe2b 100644 --- a/stage2/char_io.c +++ b/stage2/char_io.c @@ -326,6 +326,9 @@ get_cmdline (char *prompt, char *commands, char *cmdline, int maxlen, lpos ++; /* fallthrough is on purpose! */ case 8: /* C-h backspace */ +#ifdef GRUB_UTIL + case 127: /* also backspace */ +#endif if (lpos > 0) { int i;