mtd/patches grub-2002-07-29-doc.patch,1.1,1.2

ilatypov at infradead.org ilatypov at infradead.org
Fri Aug 2 16:42:56 EDT 2002


Update of /home/cvs/mtd/patches
In directory phoenix.infradead.org:/tmp/cvs-serv4803

Modified Files:
	grub-2002-07-29-doc.patch 
Log Message:
a) Read chip ID into the stage2 RAM area.
b) Restore the accidentally dropped builtins.c changes

Index: grub-2002-07-29-doc.patch
===================================================================
RCS file: /home/cvs/mtd/patches/grub-2002-07-29-doc.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- grub-2002-07-29-doc.patch	30 Jul 2002 03:58:11 -0000	1.1
+++ grub-2002-07-29-doc.patch	2 Aug 2002 20:42:53 -0000	1.2
@@ -1,6 +1,6 @@
 diff -urN ../../grub.orig/grub/AUTHORS ./AUTHORS
 --- ../../grub.orig/grub/AUTHORS	Wed Nov 28 13:43:56 2001
-+++ ./AUTHORS	Mon Jul 29 22:31:30 2002
++++ ./AUTHORS	Fri Aug  2 16:26:16 2002
 @@ -42,3 +42,8 @@
  
  Jason Thomas added Linux DAC960 support and support for hiding/unhiding
@@ -12,7 +12,7 @@
 +
 diff -urN ../../grub.orig/grub/ChangeLog ./ChangeLog
 --- ../../grub.orig/grub/ChangeLog	Fri Jul 12 05:55:54 2002
-+++ ./ChangeLog	Mon Jul 29 22:32:11 2002
++++ ./ChangeLog	Fri Aug  2 16:28:05 2002
 @@ -1,3 +1,68 @@
 +2002-07-29  Ilguiz Latypov <ilatypov at superbt.com>
 +
@@ -84,7 +84,7 @@
  	* stage2/boot.c (load_image): Rewrite the Linux booting support
 diff -urN ../../grub.orig/grub/Makefile.am ./Makefile.am
 --- ../../grub.orig/grub/Makefile.am	Mon Jul  1 10:28:53 2002
-+++ ./Makefile.am	Mon Jul 29 22:43:46 2002
++++ ./Makefile.am	Fri Aug  2 16:34:07 2002
 @@ -1,4 +1,4 @@
  # Do not change this order if you don't know what you are doing.
 -AUTOMAKE_OPTIONS = 1.5
@@ -93,7 +93,7 @@
  EXTRA_DIST = BUGS MAINTENANCE
 diff -urN ../../grub.orig/grub/README_DiskOnChip ./README_DiskOnChip
 --- ../../grub.orig/grub/README_DiskOnChip	Wed Dec 31 19:00:00 1969
-+++ ./README_DiskOnChip	Mon Jul 29 22:31:30 2002
++++ ./README_DiskOnChip	Fri Aug  2 16:26:16 2002
 @@ -0,0 +1,116 @@
 +	$Id$
 +
@@ -213,7 +213,7 @@
 +
 diff -urN ../../grub.orig/grub/configure.in ./configure.in
 --- ../../grub.orig/grub/configure.in	Wed May 22 13:12:45 2002
-+++ ./configure.in	Mon Jul 29 22:31:30 2002
++++ ./configure.in	Fri Aug  2 16:26:16 2002
 @@ -53,9 +53,13 @@
  # We need this for older versions of Autoconf.
  _AM_DEPENDENCIES(CC)
@@ -308,7 +308,7 @@
  AC_OUTPUT([Makefile stage1/Makefile stage2/Makefile docs/Makefile \
 diff -urN ../../grub.orig/grub/stage1/Makefile.am ./stage1/Makefile.am
 --- ../../grub.orig/grub/stage1/Makefile.am	Wed Jul  4 03:33:48 2001
-+++ ./stage1/Makefile.am	Mon Jul 29 22:31:30 2002
++++ ./stage1/Makefile.am	Fri Aug  2 16:26:16 2002
 @@ -1,7 +1,48 @@
  pkgdatadir = $(datadir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
 -nodist_pkgdata_DATA = stage1
@@ -368,8 +368,8 @@
 +
 diff -urN ../../grub.orig/grub/stage1/doc_stage1.S ./stage1/doc_stage1.S
 --- ../../grub.orig/grub/stage1/doc_stage1.S	Wed Dec 31 19:00:00 1969
-+++ ./stage1/doc_stage1.S	Mon Jul 29 22:31:30 2002
-@@ -0,0 +1,471 @@
++++ ./stage1/doc_stage1.S	Fri Aug  2 16:26:16 2002
+@@ -0,0 +1,464 @@
 +/* -*-Asm-*- */
 +/*
 + *  GRUB  --  GRand Unified Bootloader
@@ -564,13 +564,13 @@
 +       /* Use existing block read routine to get Manufacturer &
 +       ** Chip ID.  Overkill, but saves code space.  */  
 +
-+       movw    $1, %cx         /* read just one page */
-+       movw    $GRUBSTART, %ax
++       movw    $1, %cx		/* read just one block */
++       movw    $GRUBSTART >> 4, %ax
 +       movw    %ax, %es
 +       movw    $0, %di
 +       call    read_block
 +
-+       movw    %es:0,%ax               /* id/mfr in first 2 bytes */
++       movw    %es:0, %ax	/* id/mfr in first 2 bytes */
 +
 +#ifdef SHOW_INFO
 +
@@ -612,21 +612,14 @@
 +       movw    %ax, %es
 +       movw    $GRUBLOADOFS, %di
 +
-+       /* Stage2 proper starts at offset 0x300 on the flash. We
++       /* Stage2 proper starts at offset 0x300 of the DoC 2000 
++	  flash and offset 0x400 of the DoC Millennium flash. We
 +	  have defined the load address GRUBLOADSEG so that
 +	  we're loading this to 0x8000:0000 or 0x8000:0200, 
 +	  depending on whether this is old or GNU Grub, 
 +	  respectively.
 +       */
 +
-+#ifdef DOC_MIL_KEEP_IPL
-+       cmpw    $DoC_2k_CDSN_IO, %si
-+       je      mil_spec_end3
-+       /* Keep Millennium's original IPL in the first 1K of flash */
-+       addw    $0x400, %di
-+       mil_spec_end3:
-+#endif
-+
 +       call    copy_grub
 +
 +good:  
@@ -843,7 +836,7 @@
 +
 diff -urN ../../grub.orig/grub/stage1/doc_stage1.h ./stage1/doc_stage1.h
 --- ../../grub.orig/grub/stage1/doc_stage1.h	Wed Dec 31 19:00:00 1969
-+++ ./stage1/doc_stage1.h	Mon Jul 29 22:31:30 2002
++++ ./stage1/doc_stage1.h	Fri Aug  2 16:26:16 2002
 @@ -0,0 +1,142 @@
 +/* -*-Asm-*- */
 +/*
@@ -989,7 +982,7 @@
 +
 diff -urN ../../grub.orig/grub/stage1/makecsum.c ./stage1/makecsum.c
 --- ../../grub.orig/grub/stage1/makecsum.c	Wed Dec 31 19:00:00 1969
-+++ ./stage1/makecsum.c	Mon Jul 29 22:31:30 2002
++++ ./stage1/makecsum.c	Fri Aug  2 16:26:16 2002
 @@ -0,0 +1,226 @@
 +#include <stdio.h>
 +#include <sys/types.h>
@@ -1219,7 +1212,7 @@
 +}
 diff -urN ../../grub.orig/grub/stage2/Makefile.am ./stage2/Makefile.am
 --- ../../grub.orig/grub/stage2/Makefile.am	Tue Jun 11 12:36:54 2002
-+++ ./stage2/Makefile.am	Mon Jul 29 22:31:30 2002
++++ ./stage2/Makefile.am	Fri Aug  2 16:26:16 2002
 @@ -83,12 +83,12 @@
  
  # For stage2 target.
@@ -1345,7 +1338,7 @@
  # XXX: See the comment for start_exec-start.o.
 diff -urN ../../grub.orig/grub/stage2/asm.S ./stage2/asm.S
 --- ../../grub.orig/grub/stage2/asm.S	Fri Jul 12 05:55:55 2002
-+++ ./stage2/asm.S	Mon Jul 29 22:31:30 2002
++++ ./stage2/asm.S	Fri Aug  2 16:26:16 2002
 @@ -133,7 +133,7 @@
  
  	sti		/* we're safe again */
@@ -1369,7 +1362,7 @@
  #endif
 diff -urN ../../grub.orig/grub/stage2/bdev_diskonchip.c ./stage2/bdev_diskonchip.c
 --- ../../grub.orig/grub/stage2/bdev_diskonchip.c	Wed Dec 31 19:00:00 1969
-+++ ./stage2/bdev_diskonchip.c	Mon Jul 29 22:31:30 2002
++++ ./stage2/bdev_diskonchip.c	Fri Aug  2 16:26:16 2002
 @@ -0,0 +1,1068 @@
 +/*
 + *  GRUB  --  GRand Unified Bootloader
@@ -2441,7 +2434,7 @@
 +
 diff -urN ../../grub.orig/grub/stage2/bios.c ./stage2/bios.c
 --- ../../grub.orig/grub/stage2/bios.c	Sun Dec 30 02:33:23 2001
-+++ ./stage2/bios.c	Mon Jul 29 22:31:30 2002
++++ ./stage2/bios.c	Fri Aug  2 16:26:16 2002
 @@ -129,6 +129,22 @@
    /* Clear the flags.  */
    geometry->flags = 0;
@@ -2481,7 +2474,7 @@
      {
 diff -urN ../../grub.orig/grub/stage2/boot.c ./stage2/boot.c
 --- ../../grub.orig/grub/stage2/boot.c	Fri Jul 12 05:55:55 2002
-+++ ./stage2/boot.c	Mon Jul 29 22:31:30 2002
++++ ./stage2/boot.c	Fri Aug  2 16:26:16 2002
 @@ -61,6 +61,8 @@
       buffer by default */
    pu.aout = (struct exec *) buffer;
@@ -2491,9 +2484,141 @@
    if (!grub_open (kernel))
      return KERNEL_TYPE_NONE;
  
+diff -urN ../../grub.orig/grub/stage2/builtins.c ./stage2/builtins.c
+--- ../../grub.orig/grub/stage2/builtins.c	Fri Jul  5 18:15:57 2002
++++ ./stage2/builtins.c	Fri Aug  2 16:26:16 2002
+@@ -1319,56 +1319,68 @@
+       return 1;
+     }
+ 
+-  /* Attempt to read the first sector, because some BIOSes turns out not
+-     to support LBA even though they set the bit 0 in the support
+-     bitmap, only after reading something actually.  */
+-  if (biosdisk (BIOSDISK_READ, current_drive, &geom, 0, 1, SCRATCHSEG))
++  if ((current_drive & 0xfffffff0) == DISK_ON_CHIP)
+     {
+-      errnum = ERR_READ;
+-      return 1;
++      msg = "Disk On Chip";
+     }
+-
+-#ifdef GRUB_UTIL
+-  ptr = skip_to (0, device);
+-  if (*ptr)
++  else if (current_drive == NETWORK_DRIVE)
+     {
+-      char *cylinder, *head, *sector, *total_sector;
+-      int num_cylinder, num_head, num_sector, num_total_sector;
+-
+-      cylinder = ptr;
+-      head = skip_to (0, cylinder);
+-      sector = skip_to (0, head);
+-      total_sector = skip_to (0, sector);
+-      if (! safe_parse_maxint (&cylinder, &num_cylinder)
+-	  || ! safe_parse_maxint (&head, &num_head)
+-	  || ! safe_parse_maxint (&sector, &num_sector))
+-	return 1;
+-
+-      disks[current_drive].cylinders = num_cylinder;
+-      disks[current_drive].heads = num_head;
+-      disks[current_drive].sectors = num_sector;
+-
+-      if (safe_parse_maxint (&total_sector, &num_total_sector))
+-	disks[current_drive].total_sectors = num_total_sector;
+-      else
+-	disks[current_drive].total_sectors
+-	  = num_cylinder * num_head * num_sector;
+-      errnum = 0;
+-
+-      geom = disks[current_drive];
+-      buf_drive = -1;
++      msg = "Network Drive";
+     }
++  else
++    {
++      /* Attempt to read the first sector, because some BIOSes turns out not
++         to support LBA even though they set the bit 0 in the support
++         bitmap, only after reading something actually.  */
++      if (biosdisk (BIOSDISK_READ, current_drive, &geom, 0, 1, SCRATCHSEG))
++        {
++          errnum = ERR_READ;
++          return 1;
++        }
++
++#ifdef GRUB_UTIL
++      ptr = skip_to (0, device);
++      if (*ptr)
++        {
++          char *cylinder, *head, *sector, *total_sector;
++          int num_cylinder, num_head, num_sector, num_total_sector;
++
++          cylinder = ptr;
++          head = skip_to (0, cylinder);
++          sector = skip_to (0, head);
++          total_sector = skip_to (0, sector);
++          if (! safe_parse_maxint (&cylinder, &num_cylinder)
++              || ! safe_parse_maxint (&head, &num_head)
++              || ! safe_parse_maxint (&sector, &num_sector))
++            return 1;
++
++          disks[current_drive].cylinders = num_cylinder;
++          disks[current_drive].heads = num_head;
++          disks[current_drive].sectors = num_sector;
++
++          if (safe_parse_maxint (&total_sector, &num_total_sector))
++            disks[current_drive].total_sectors = num_total_sector;
++          else
++            disks[current_drive].total_sectors
++              = num_cylinder * num_head * num_sector;
++          errnum = 0;
++
++          geom = disks[current_drive];
++          buf_drive = -1;
++        }
+ #endif /* GRUB_UTIL */
+ 
+ #ifdef GRUB_UTIL
+-  msg = device_map[current_drive];
++      msg = device_map[current_drive];
+ #else
+-  if (geom.flags & BIOSDISK_FLAG_LBA_EXTENSION)
+-    msg = "LBA";
+-  else
+-    msg = "CHS";
++      if (geom.flags & BIOSDISK_FLAG_LBA_EXTENSION)
++        msg = "LBA";
++      else
++        msg = "CHS";
+ #endif
+ 
++    }  /* current_drive is not DiskOnChip and not a network drive */
++
+   grub_printf ("drive 0x%x: C/H/S = %d/%d/%d, "
+ 	       "The number of sectors = %d, %s\n",
+ 	       current_drive,
+@@ -3040,6 +3052,19 @@
+     {
+       /* Network drive.  */
+       grub_printf (" (nd):");
++    }
++  else if ((saved_drive & 0xfffffff0) == DISK_ON_CHIP)
++    {
++      /* DiskOnChip 2000 */
++      grub_printf (" (dc%d", saved_drive & 0x0F);
++
++      if ((saved_partition & 0xFF0000) != 0xFF0000)
++	grub_printf (",%d", saved_partition >> 16);
++
++      if ((saved_partition & 0x00FF00) != 0x00FF00)
++	grub_printf (",%c", ((saved_partition >> 8) & 0xFF) + 'a');
++
++      grub_printf ("):");
+     }
+   else if (saved_drive & 0x80)
+     {
 diff -urN ../../grub.orig/grub/stage2/char_io.c ./stage2/char_io.c
 --- ../../grub.orig/grub/stage2/char_io.c	Tue Jun 11 12:36:54 2002
-+++ ./stage2/char_io.c	Mon Jul 29 22:31:30 2002
++++ ./stage2/char_io.c	Fri Aug  2 16:26:16 2002
 @@ -1157,6 +1157,7 @@
  int
  memcheck (int addr, int len)
@@ -2556,7 +2681,7 @@
  
 diff -urN ../../grub.orig/grub/stage2/disk_io.c ./stage2/disk_io.c
 --- ../../grub.orig/grub/stage2/disk_io.c	Fri Jul  5 18:15:57 2002
-+++ ./stage2/disk_io.c	Mon Jul 29 22:31:30 2002
++++ ./stage2/disk_io.c	Fri Aug  2 16:26:16 2002
 @@ -126,9 +126,24 @@
  {
    int slen = (byte_offset + byte_len + SECTOR_SIZE - 1) >> SECTOR_BITS;
@@ -2782,7 +2907,7 @@
  #else /* NO_DECOMPRESSION */
 diff -urN ../../grub.orig/grub/stage2/shared.h ./stage2/shared.h
 --- ../../grub.orig/grub/stage2/shared.h	Fri Jul 12 05:55:55 2002
-+++ ./stage2/shared.h	Mon Jul 29 22:31:32 2002
++++ ./stage2/shared.h	Fri Aug  2 16:26:17 2002
 @@ -27,6 +27,14 @@
  
  #include <config.h>
@@ -2824,7 +2949,7 @@
  
 diff -urN ../../grub.orig/grub/stage2/stage2.c ./stage2/stage2.c
 --- ../../grub.orig/grub/stage2/stage2.c	Tue Jun 11 12:36:54 2002
-+++ ./stage2/stage2.c	Mon Jul 29 22:31:32 2002
++++ ./stage2/stage2.c	Fri Aug  2 16:26:17 2002
 @@ -770,6 +770,46 @@
    return pos;
  }
@@ -2928,4 +3053,3 @@
  		  struct builtin *builtin;
  		  
  		  /* Get the pointer to the builtin structure.  */
-





More information about the linux-mtd-cvs mailing list