diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-08-06 18:49:15 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-08-06 18:49:15 +0000 |
commit | a0c4141d2cb0713173d5cc01dbfce27155973413 (patch) | |
tree | 478a130a7870c91db395e964294f6381e7a76cd2 /sys/arch/i386/stand/libsa | |
parent | 815943042513d5a1556193c708240308f711e32c (diff) |
fix hd major basing on disklabel d_type info
Diffstat (limited to 'sys/arch/i386/stand/libsa')
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 0f7d5ad8971..154466a05f7 100644 --- a/sys/arch/i386/stand/libsa/biosdev.c +++ b/sys/arch/i386/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.20 1997/08/04 21:53:34 mickey Exp $ */ +/* $OpenBSD: biosdev.c,v 1.21 1997/08/06 18:49:14 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -121,8 +121,6 @@ biosopen(struct open_file *f, ...) bd = alloc(sizeof(*bd)); bzero(bd, sizeof(bd)); - /* XXX for exec stuff */ - bootdev = bd->bsddev = MAKEBOOTDEV(maj, 0, 0, unit, part); switch (maj) { case 0: /* wd */ @@ -153,6 +151,8 @@ biosopen(struct open_file *f, ...) bd->edd_flags = EDDcheck((dev_t)bd->biosdev); bootdev_geometry = bd->dinfo = biosdinfo((dev_t)bd->biosdev); + /* maj is fixed later w/ disklabel read */ + bootdev = bd->bsddev = MAKEBOOTDEV(maj, 0, 0, unit, part); #ifdef BIOS_DEBUG if (debug) { @@ -229,6 +229,16 @@ biosopen(struct open_file *f, ...) return EUNLAB; } + if (maj == 17) { /* figure out what it's exactly */ + switch (bd->disklabel.d_type) { + case DTYPE_SCSI: maj = 4; break; + default: maj = 0; break; + } + } + + /* and again w/ fixed maj */ + bootdev = bd->bsddev = MAKEBOOTDEV(maj, 0, 0, unit, part); + f->f_devdata = bd; return 0; |