Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 1999 17:47:08 +0100
From:      Wilko Bulte <wilko@yedi.iaf.nl>
To:        Mike Smith <msmith@freebsd.org>
Cc:        FreeBSD-alpha mailing list <freebsd-alpha@freebsd.org>
Subject:   Re: diskless boot on Alpha
Message-ID:  <19991224174708.A63398@yedi.iaf.nl>
In-Reply-To: <199912240210.SAA06908@mass.cdrom.com>; from msmith@freebsd.org on Thu, Dec 23, 1999 at 06:10:56PM -0800
References:  <19991223220432.A11438@yedi.iaf.nl> <199912240210.SAA06908@mass.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 23, 1999 at 06:10:56PM -0800, Mike Smith wrote:

Hello Mike,

I appreciate your help in this. Be warned: long mail follows..

> > I'm probably overlooking something too obvious. As can be seen
> > below the Alpha (DEC3000/400 Sandpiper) tries to mount its root
> > device using ufs. Does not work too well with an nfs root. 
> > 
> > Previously there was a 'root on <bla> clause in the kernel config file.
> > But this is depreciated (right?).
> > 
> > Question remains: how do I convince the kernel to use the nfs root?
> 
> Are you booting the loader, or the kernel directly?

I'm doing:

>>> boot ez0
INIT-S-CPU...
AUDIT_BOOT_STARTS ... 
AUDIT_BOOT_REQ 
Host server IP address is 192.168.200.22
AUDIT_BSERVER_FOUND
AUDIT_LOAD_BEGINS

AUDIT_LOAD_DONE
Console: SRM firmware console
VMS PAL rev: 0x100010538
OSF PAL rev: 0x2012d
Switch to OSF PAL code succeeded.

FreeBSD/alpha SRM net boot, Revision 0.1
(root@miata.iaf.nl, Tue Dec 21 18:31:30 CET 1999)
Memory: 98304 k
boot: ethernet address: 08:00:2b:3c:61:45
net_open: server addr: 192.168.200.22
net_open: server path: /usr/sandpiper

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [kernel]...               
/kernel data=0x189908+0x1b168 syms=[0x8+0x237c0+0x8+0x1a681]
Entering kernel at 0xfffffc000031f760...

> Try booting with '-a' and specify nfs:...
> I'd be guessing that the code in the alpha autoconf isn't correctly 
> picking up that / is meant to be nfs-mounted. 8(

The relevant code (I think) is:

 * Do legacy root filesystem discovery.  This isn't really
 * needed on the Alpha, which has always used the loader.
 */
void
cpu_rootconf()
{
        int     order = 0;

printf(">>## in cpu_rootconf\n");

/* #if defined(NFS) && defined(NFS_ROOT)
#if !defined(BOOTP_NFSROOT)
        if (nfs_diskless_valid)
#endif
*/
                rootdevnames[order++] = "nfs:";
                printf (">>## nfsroot before ufs\n");
/* #endif */

#if defined(FFS) && defined(FFS_ROOT)
        rootdevnames[order++] = "ufs:da0a";
#endif
}
SYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, cpu_rootconf, NULL)

from autoconf.c (the printfs etc are mine)

First interesting observation is that 'options NFS' and 'options NFS_ROOT'
in the kernel config file do not result in the nfs bit being compiled in:

(using original autoconf.c):

miata#make
cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual
-fformat-extensions -ansi  -nostdinc -I- -I. -I../.. -I../../../include
-DKERNEL -include opt_global.h -D_KERNEL   -mno-fp-regs -Wa,-mev56
../../alpha/alpha/autoconf.c
../../alpha/alpha/autoconf.c: In function `cpu_rootconf':
../../alpha/alpha/autoconf.c:214: warning: unused variable `order'

In other words, the compiler only sees the declaration of 'order' and
no code that uses it. 

I admit not to understand why this is the case. My theory right now is
that the compile of autoconf.c should include opt_nfs.h in addition to
opt_nfsroot.h. The latter is already present.

I base this on:

miata#grep NFS *
config.c:___options     NFS             #Network Filesystem\n\
config.c:___options     NFS_ROOT        #NFS usable as root device\n\
Binary file kernel matches
kernfs.h:#define NKERNFS 0
Binary file nfs_bio.o matches
Binary file nfs_node.o matches
Binary file nfs_nqlease.o matches
Binary file nfs_socket.o matches
Binary file nfs_srvcache.o matches
Binary file nfs_subs.o matches
Binary file nfs_syscalls.o matches
Binary file nfs_vfsops.o matches
Binary file nfs_vnops.o matches
opt_nfs.h:#define NFS 1
opt_nfsroot.h:#define NFS_ROOT 1
Binary file ufs_vnops.o matches
miata#pwd
/sys/compile/SAND
miata# 

When I add opt_nfs.h to the include files in autoconf.c thing compile like
expected. Can somebody please verify this for me?

When I boot a kernel built with the above patch I get:

>>## nfsroot before ufs
Mounting root from ufs:192.168.200.22:/usr/sandpiper
Can't allocate root mount for filesystem 'ufs': 19
Root mount failed: 19

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
  ?                  List valid disk boot devices
  <empty line>       Abort manual input

Which I don't understand because vfs_mountroot() should try nfs before
ufs because that is the order in which cpu_rootconf sets up the
rootdevnames ? And in my case the kernel is compiled without 
FFS and FFS_ROOT so it should only do NFS.

I'm puzzled..

NB as the code tells me to use 'loader', how do I set
that up on Alpha? I still need to bootp netboot right?
 
Wilko Bulte 		Arnhem, The Netherlands	  - The FreeBSD Project 
    			WWW : http://www.tcja.nl  http://www.freebsd.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991224174708.A63398>