Port-sgimips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Flag day for bootloader + kernel?



he%NetBSD.org@localhost wrote:

> it appears that there has crept in a "flag day" on the sgimips
> port.  The thing is this:
> 
>  o A -current kernel requires a newer bootloader than the one
>    which came with 4.0
>  o The new bootloader from -current cannot boot a 4.0 kernel (but
>    a -current kernel is fine)
> 
> When I tried to boot a 4.0 kernel with the new bootloader (trying
> to be "careful" when upgrading), what I got was what is shown
> below.

It's a known problem.

Could you please try the attached patch with each combinations?

With this patch:
- the newer bootloader (Rev 1.5) can load both newer -current kernels
  and 4.0 kernels
- 4.0 bootloader can load newer -current kernels
  (without kernel symbol support)
- old -current bootloader (Rev 1.4) can still load newer -current kernels
  (without kernel symbol support)
- newer -current kernels can still be loaded via netboot with
  proper root device 
- but -current kernels between ~4.99.50 and ~4.99.69 won't work with
  the newer bootloader
  (they could be loaded properly but root partition won't be recognized
   properly, and there is something wrong around cngetc() on com(4) at mace
   that causes reboot on "root device:" prompt)
- loading kernels on IP12 (which doesn't have ARCBIOS) is not tested at all
  (I wonder if argv[0] passed from BIOS is vaild or not on IP12)

Anyway, I should bump BOOTINFO_MAGIC on replacing bootinfo stuff.
My apologies for inconvinience.
---
Izumi Tsutsui


Index: include/bootinfo.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/include/bootinfo.h,v
retrieving revision 1.5
diff -u -r1.5 bootinfo.h
--- include/bootinfo.h  26 Jan 2008 14:35:24 -0000      1.5
+++ include/bootinfo.h  22 Jul 2008 14:56:09 -0000
@@ -29,7 +29,7 @@
 #ifndef _SGIMIPS_BOOTINFO_H_
 #define _SGIMIPS_BOOTINFO_H_
 
-#define        BOOTINFO_MAGIC          0x20011121
+#define        BOOTINFO_MAGIC          0x20080126
 #define        BOOTINFO_SIZE           1024
 
 struct btinfo_common {
Index: sgimips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/sgimips/machdep.c,v
retrieving revision 1.120
diff -u -r1.120 machdep.c
--- sgimips/machdep.c   2 Jul 2008 17:28:56 -0000       1.120
+++ sgimips/machdep.c   22 Jul 2008 14:56:10 -0000
@@ -361,11 +361,25 @@
                makebootdev(bootpath);
        else {
                /*
+                * The old bootloader prior to 5.0 doesn't pass bootinfo.
+                * If argv[0] is the bootloader, then argv[1] might be
+                * the kernel that was loaded.
+                * If argv[1] isn't an environment string, try to use it
+                * to set the boot device.
+                */
+               if (argc > 1 && strchr(argv[1], '=') != 0)
+                       makebootdev(argv[1]);
+
+               /*
                 * If we are loaded directly by ARCBIOS,
-                * argv[0] is the path of the loaded kernel.
+                * argv[0] is the path of the loaded kernel,
+                * but booted_partition could be SGIVOLHDR in such case,
+                * so assume root is partition a.
                 */
-               if (argc > 0 && argv[0] != NULL)
+               if (argc > 0 && argv[0] != NULL) {
                        makebootdev(argv[0]);
+                       booted_partition = 0;
+               }
        }
 
        /*
Index: stand/boot/version
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/stand/boot/version,v
retrieving revision 1.5
diff -u -r1.5 version
--- stand/boot/version  28 Mar 2008 16:40:25 -0000      1.5
+++ stand/boot/version  22 Jul 2008 14:56:10 -0000
@@ -9,3 +9,4 @@
 1.2:   When parsing boot device for type, skip pci(n) -- needed for IP32
 1.3:   Rework bootinfo support
 1.4:   Pass boot device path with a kernel name via BTINFO_BOOTPATH
+1.5:   Bump BOOTINFO_MAGIC to avoid crash on loading old kernels


Home | Main Index | Thread Index | Old Index