NetBSD-Bugs archive

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

port-macppc/53727: boot floppy doesn't work for openfirmware version 1 machines?



>Number:         53727
>Category:       port-macppc
>Synopsis:       boot floppy doesn't work for openfirmware version 1 machines?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 12 19:20:00 +0000 2018
>Originator:     scole_mail
>Release:        current
>Organization:
none
>Environment:
NetBSD dstar 8.0_STABLE NetBSD 8.0_STABLE (GENERIC) #0: Mon Oct 22 14:40:16 PDT 2018  scole@dstar:/home/scole/nbsd/cvs/8_0/obj/sys/arch/i386/compile/GENERIC i386
>Description:
I have some changes I've been working on (that aren't checked in yet) to get the install media working for ppc601 machines.  The install boot floppy (e.g. boot1.fs) doesn't work for versions later than 1.22 of src/sys/arch/macppc/stand/ofwboot/ofdev.c 

It seems like there is some issue with a 'partition zero' bootloader and ofdev.c:search_mac_label() not working with the boot floppy, and that the netbsd kernel can't be found on the filesystem.  Using search_dos_label() works though.

Here is some output with some debugging turning on.

0 > boot fd:0 -
OF_open bootpath=fd
read stage 2 blocks: 01234567. done!
starting stage 2...

>> NetBSD/macppc OpenFirmware Boot, Revision 1.12 (Sat Nov 10 17:50:12 UTC 2018)
parsefilepath: path = /netbsd
parsefilepath: Checking /netbsd: dhandle = -1
parsefilepath: filename = /netbsd
parsefilepath: path = /netbsd
parsefilepath: Checking /netbsd: dhandle = -1
parsefilepath: filename = /netbsd
devopen: devname =  fd, filename = /netbsd
devopen: opened_name =  fd/netbsd
ofdev devname fd
open /netbsd: Device not configured
parsefilepath: path = /netbsd.gz
parsefilepath: Checking /netbsd.gz: dhandle = -1
parsefilepath: filename = /netbsd.gz
parsefilepath: path = /netbsd.gz
parsefilepath: Checking /netbsd.gz: dhandle = -1
parsefilepath: filename = /netbsd.gz
devopen: devname =  fd, filename = /netbsd.gz
devopen: opened_name =  fd/netbsd.gz
ofdev devname fd
open /netbsd.gz: Device not configured
parsefilepath: path = /netbsd.macppc
parsefilepath: Checking /netbsd.macppc: dhandle = -1
parsefilepath: filename = /netbsd.macppc
parsefilepath: path = /netbsd.macppc
parsefilepath: Checking /netbsd.macppc: dhandle = -1
parsefilepath: filename = /netbsd.macppc
devopen: devname =  fd, filename = /netbsd.macppc
devopen: opened_name =  fd/netbsd.macppc
ofdev devname fd
open /netbsd.macppc: Device not configured

>How-To-Repeat:
Try booting boot1.fs on an OF1 machine.  (Maybe OF2 and OF3 also?)
>Fix:
Here is a patch that forces search_dos_label() to be used instead of search_mac_label() when a floppy and OF1 machines are used.  If it is looks okay, I can check it in.  

Unfortunately, I don't have other machines to test this on.  The current boot floppy probably should be checked to see if this issue affects OF2 and OF3 machines as well.

===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/stand/ofwboot/ofdev.c,v
retrieving revision 1.26
diff -b -u -r1.26 ofdev.c
--- ofdev.c	19 Feb 2012 12:02:55 -0000	1.26
+++ ofdev.c	12 Nov 2018 19:11:20 -0000
@@ -444,7 +444,15 @@
 			/* Else try APM or MBR partitions */
 			struct drvr_map *map = (struct drvr_map *)buf;
 
-			if (map->sbSig == DRIVER_MAP_MAGIC)
+			/*
+			 * XXX using search_mac_label(), my powermac 7200
+			 * fails booting with the boot floppy. Other machines
+			 * and openfirmware versions may need this check also
+			 */
+			if (ofw_version == 1 && strncmp(devname,"fd",2) == 0)
+				error = search_dos_label(&ofdev, 0, buf,
+				    &label, 0);
+			else if (map->sbSig == DRIVER_MAP_MAGIC)
 				error = search_mac_label(&ofdev, buf, &label);
 			else
 				error = search_dos_label(&ofdev, 0, buf,



Home | Main Index | Thread Index | Old Index