Hello!

Short description of the attached files:

menu.diff

More meaningful example for using "pause"
Example on how to boot FreeBSD from BSD subpartitions
Using (hd0,0) instead of (0x80,0) to avoid confusion. One could ask -
why do Unices use hd0 whereas the OS'es from Redmond use 0x80 ?
Removed specific versions of FreeBSD and Windows NT
Added an example (commented out) how to boot DOS if NT is installed

stage2.diff

Erasing the "entered" string before get_cmdline() (not after it) fixes
the bug with non-empty password on startup (gcc-2.95.1, Linux)
Disabled printing help on Tab while asking for password
get_cmdline() has been modified to redraw the command line after Tab even
if there is no help, because "/n" is printed unconditionally anyway.

nounzip.diff

To my great surprise, it takes so little to make decompression optional

ChangeLog is anybody cares:

        * docs/menu.lst: More meaningful examples. Not using (0x80,0)
        notation anymore
        * stage2/stage2.c (run_menu): Erase the entered password before
        get_cmdline(). Help on Tab disabled when entering the password
        * stage2/char_io.c (get_cmdline): restore command-line even if
        there is no help string
        * configure.in: --disable-gunzip disables decompression in stage2
        * stage2/gunzip.c: disable all code if decompression is disabled

Pavel Roskin
--- docs/menu.lst       Thu Sep  2 22:00:50 1999
+++ docs/menu.lst       Thu Sep  2 23:32:35 1999
@@ -21,13 +21,13 @@
 # For booting Mach (getting kernel from floppy)
 title  Utah Mach4 multiboot
 root   (hd0,2)
-pause  My test!!
+pause  Insert the diskette now!!
 kernel (fd0)/boot/kernel root=hd0s3
 module (fd0)/boot/bootstrap
 
 # For booting FreeBSD (getting kernel from floppy)
-title  FreeBSD 2.2-SNAP
-root   (hd0,2)
+title  FreeBSD
+root   (hd0,2,a)
 kernel (fd0)/kernel
 
 # For booting OS/2
@@ -39,11 +39,13 @@
 # This is similar to "chainload", but loads a specific file
 #chainloader /boot/chain.os2
 
-# For booting Windows NT 3.5 or Windows95
-title Windows NT 3.5/Windows 95 boot menu
-root        (0x80,0)
+# For booting Windows NT or Windows 95
+title Windows NT / Windows 95 boot menu
+root        (hd0,0)
 makeactive
 chainloader +1
+# For loading DOS if Windows NT is installed
+#chainloader bootsect.dos
 
 # For installing GRUB into the hard disk
 title Install GRUB into the hard disk
--- stage2/stage2.c     Mon Aug  9 18:02:35 1999
+++ stage2/stage2.c     Fri Sep  3 00:58:25 1999
@@ -362,7 +362,9 @@
                  char *pptr = password;
 
                  gotoxy(1, 21);
-                 get_cmdline (" Password: ", commands, entered, 31, '*');
+                 /* Wipe out the previously entered password */
+                 memset (entered, 0, sizeof (entered));
+                 get_cmdline (" Password: ", NULL, entered, 31, '*');
 
                  while (! isspace (*pptr) && *pptr)
                    pptr ++;
@@ -373,7 +375,6 @@
                  if (! strcmp (password, entered))
                    {
                      char *new_file = config_file;
-                     memset (entered, 0, sizeof (entered));
                      while (isspace (*pptr))
                        pptr ++;
                      while ((*(new_file ++) = *(pptr ++)) != 0);
@@ -381,7 +382,6 @@
                    }
                  else
                    {
-                     memset (entered, 0, sizeof (entered));
                      printf("Failed!\n      Press any key to continue...");
                      getkey ();
                      goto restart;
--- stage2/char_io.c    Thu Sep  2 22:00:50 1999
+++ stage2/char_io.c    Fri Sep  3 01:27:16 1999
@@ -292,8 +292,6 @@
              }
            else if (commands)
              printf (commands);
-           else
-             break;
 
            /* restore command-line */
            cmdline[lpos] = c;
--- configure.in        Fri Aug 27 11:54:42 1999
+++ configure.in        Fri Sep  3 01:54:38 1999
@@ -148,6 +148,14 @@
   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_MINIX=1"
 fi
 
+# Decompression support
+AC_ARG_ENABLE(gunzip,
+  [  --disable-gunzip        disable decompression in Stage 2])
+
+if test x"$enable_gunzip" = xno; then
+  FSYS_CFLAGS="$FSYS_CFLAGS -DNO_DECOMPRESSION=1"
+fi
+
 AC_SUBST(FSYS_CFLAGS)
 
 
--- stage2/gunzip.c     Thu Jun 24 04:03:21 1999
+++ stage2/gunzip.c     Fri Sep  3 01:57:02 1999
@@ -125,6 +125,8 @@
  */
 
 
+#ifndef NO_DECOMPRESSION
+
 #include "shared.h"
 
 #include "filesys.h"
@@ -1219,3 +1221,5 @@
 
   return ret;
 }
+
+#endif /* NO_DECOMPRESSION */

Reply via email to