From 624e500bacd06e51cc11262a5c872685983d6c36 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 12 Nov 1994 01:47:43 +0000 Subject: Make a kernel sans FFS possible. --- sys/amd64/amd64/autoconf.c | 31 ++++++++++++++++++------------- sys/i386/i386/autoconf.c | 31 ++++++++++++++++++------------- sys/kern/vfs_conf.c | 13 ++----------- sys/kern/vfs_mount.c | 13 ++----------- 4 files changed, 40 insertions(+), 48 deletions(-) (limited to 'sys') diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index d1b52fd..a32f564 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.14 1994/08/31 23:36:56 se Exp $ + * $Id: autoconf.c,v 1.15 1994/10/22 17:51:45 phk Exp $ */ /* @@ -67,6 +67,14 @@ static void setroot(void); int dkn; /* number of iostat dk numbers assigned so far */ extern int cold; /* cold start flag initialized in locore.s */ +extern int (*mountroot) __P((void)); +#ifdef FFS +int ffs_mountroot __P((void)); +#endif +#ifdef NFS +int nfs_mountroot __P((void)); +#endif + /* * Determine i/o configuration for a machine. */ @@ -84,26 +92,23 @@ configure() pci_configure(); #endif -#if GENERICxxx - if ((boothowto & RB_ASKNAME) == 0) - setroot(); - setconf(); -#else -# ifdef NFS +#ifdef NFS { extern int nfs_diskless_valid; - extern int (*mountroot) __P((void)); - extern int nfs_mountroot(void); if (nfs_diskless_valid) mountroot = nfs_mountroot; - else + } +#endif /* NFS */ +#ifdef FFS + if (!mountroot) { + mountroot = ffs_mountroot; setroot(); } -# else /* !NFS */ - setroot(); -# endif /* NFS */ #endif + if (!mountroot) { + panic("Nobody wants to mount my root for me"); + } /* * Configure swap area and related system * parameter based on device(s) used. diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index d1b52fd..a32f564 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.14 1994/08/31 23:36:56 se Exp $ + * $Id: autoconf.c,v 1.15 1994/10/22 17:51:45 phk Exp $ */ /* @@ -67,6 +67,14 @@ static void setroot(void); int dkn; /* number of iostat dk numbers assigned so far */ extern int cold; /* cold start flag initialized in locore.s */ +extern int (*mountroot) __P((void)); +#ifdef FFS +int ffs_mountroot __P((void)); +#endif +#ifdef NFS +int nfs_mountroot __P((void)); +#endif + /* * Determine i/o configuration for a machine. */ @@ -84,26 +92,23 @@ configure() pci_configure(); #endif -#if GENERICxxx - if ((boothowto & RB_ASKNAME) == 0) - setroot(); - setconf(); -#else -# ifdef NFS +#ifdef NFS { extern int nfs_diskless_valid; - extern int (*mountroot) __P((void)); - extern int nfs_mountroot(void); if (nfs_diskless_valid) mountroot = nfs_mountroot; - else + } +#endif /* NFS */ +#ifdef FFS + if (!mountroot) { + mountroot = ffs_mountroot; setroot(); } -# else /* !NFS */ - setroot(); -# endif /* NFS */ #endif + if (!mountroot) { + panic("Nobody wants to mount my root for me"); + } /* * Configure swap area and related system * parameter based on device(s) used. diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 6e1eb1d..251d704 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -31,22 +31,13 @@ * SUCH DAMAGE. * * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 - * $Id: vfs_conf.c,v 1.4 1994/09/19 15:41:13 dfr Exp $ + * $Id: vfs_conf.c,v 1.5 1994/09/21 03:46:47 wollman Exp $ */ #include #include #include -#ifdef FFS -#include - -/* - * This specifies the filesystem used to mount the root. - * This specification should be done by /etc/config. - */ -int (*mountroot)() = ffs_mountroot; -#endif - +int (*mountroot) __P((void)); struct vnode *rootvnode; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 6e1eb1d..251d704 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -31,22 +31,13 @@ * SUCH DAMAGE. * * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 - * $Id: vfs_conf.c,v 1.4 1994/09/19 15:41:13 dfr Exp $ + * $Id: vfs_conf.c,v 1.5 1994/09/21 03:46:47 wollman Exp $ */ #include #include #include -#ifdef FFS -#include - -/* - * This specifies the filesystem used to mount the root. - * This specification should be done by /etc/config. - */ -int (*mountroot)() = ffs_mountroot; -#endif - +int (*mountroot) __P((void)); struct vnode *rootvnode; -- cgit v1.1