summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-04-10 07:44:31 +0000
committerphk <phk@FreeBSD.org>1995-04-10 07:44:31 +0000
commit6c71a242b3a17d73ae714dfe2a5bcb55df057b13 (patch)
treec061732fdf8d098fafb146905b15d9623aefef10 /sys/amd64
parent37c4de562683232c6883396328e76716832a8d78 (diff)
downloadFreeBSD-src-6c71a242b3a17d73ae714dfe2a5bcb55df057b13.zip
FreeBSD-src-6c71a242b3a17d73ae714dfe2a5bcb55df057b13.tar.gz
Changes to make FreeBSD use a CDROM as rootdev, for installation purposes.
If "BOOTCDROM" is defined, you get this pretty special case stuff.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/autoconf.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c
index 8d3dba3..ee4094d 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.20 1995/02/18 18:04:30 wpaul Exp $
+ * $Id: autoconf.c,v 1.21 1995/03/16 18:11:24 bde Exp $
*/
/*
@@ -74,6 +74,9 @@ int ffs_mountroot __P((void));
#ifdef NFS
int nfs_mountroot __P((void));
#endif
+#ifdef CD9660
+int cd9660_mountroot __P((void));
+#endif
#include "isa.h"
#if NISA > 0
@@ -85,6 +88,36 @@ int nfs_mountroot __P((void));
#include <pci/pcivar.h>
#endif
+#ifdef BOOTCDROM
+/* We need to try out all our potential CDROM drives, so we need a table. */
+static struct {
+ char *name;
+ int major;
+} try_cdrom[] = {
+ { "cd", 6 },
+ { "mcd", 7 },
+ { "scd", 16 },
+ { "matcd", 17 },
+ { 0, 0}
+};
+
+int
+find_cdrom_root()
+{
+ int i,j,k;
+
+ for (j = 0 ; j < 2; j++)
+ for (k = 0 ; try_cdrom[k].name ; k++) {
+ rootdev = makedev(try_cdrom[k].major,j*8);
+ printf("trying rootdev=%x (%s%d)\n",
+ rootdev, try_cdrom[k].name,j);
+ i = (*cd9660_mountroot)();
+ if (!i) return i;
+ }
+ return EINVAL;
+}
+#endif
+
/*
* Determine i/o configuration for a machine.
*/
@@ -100,8 +133,15 @@ configure()
pci_configure();
#endif
+#ifdef CD9660
+#ifdef BOOTCDROM
+ if (!mountroot) {
+ mountroot = find_cdrom_root;
+ }
+#endif
+#endif
#ifdef NFS
- if (nfs_diskless_valid)
+ if (!mountroot && nfs_diskless_valid)
mountroot = nfs_mountroot;
#endif /* NFS */
#ifdef FFS
OpenPOWER on IntegriCloud