diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-28 23:32:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-28 23:32:09 +0000 |
commit | 6b5d80b68850588ee41fa1f786ef6c43a4f1c6b5 (patch) | |
tree | b04cec5de2c2e83a6ada65755b95c983e58bbb3d /sys | |
parent | 477eedcd42bd0217f95f0dd858b7090e9fd63966 (diff) |
attempt to number the bsd_dev units of each drive uniquely for scsi and ide.
hence ide 0, 1, 2, 3... scsi 0, 1, 2, 3... this makes the initial bsd_dev
values closer to the correct value they will have inside the kernel after
dkcsum has corrected them.
XXX if a drive has no label, it becomes known as an IDE drive, and scsi
drives after it get renumbered incorretcly. sorry.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/stand/libsa/diskprobe.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 2387a235bd8..093cf7d99d0 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.9 1997/10/26 23:19:54 mickey Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.10 1997/10/28 23:32:08 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -58,6 +58,7 @@ diskprobe() register u_int i; register bios_diskinfo_t *pdi; u_int type; + u_int scsi = 0, ide = 0, bsdunit; printf("Probing disks:"); pdi = bios_diskinfo; @@ -95,30 +96,34 @@ diskprobe() /* Try to find the label, to figure out device type */ if((bios_getdisklabel(i | 0x80, &label)) ) { printf("*"); + bsdunit = ide++; type = 0; /* XXX let it be IDE */ } else { /* Best guess */ switch (label.d_type) { case DTYPE_SCSI: type = 4; + bsdunit = scsi++; pdi->flags |= BDI_GOODLABEL; break; case DTYPE_ESDI: case DTYPE_ST506: type = 0; + bsdunit = ide++; pdi->flags |= BDI_GOODLABEL; break; default: pdi->flags |= BDI_BADLABEL; type = 0; /* XXX Suggest IDE */ + bsdunit = ide++; } } pdi->checksum = 0; /* just in case */ /* Fill out best we can */ - pdi->bsd_dev = MAKEBOOTDEV(type, 0, 0, i, RAW_PART); + pdi->bsd_dev = MAKEBOOTDEV(type, 0, 0, bsdunit, RAW_PART); } /* End of list */ |