summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1999-08-05 03:19:37 +0000
committerkato <kato@FreeBSD.org>1999-08-05 03:19:37 +0000
commit775a45e1a25f3655c69943d0a2931a8bdf4bca0b (patch)
tree034a35e1122d1ac990a726e2cb63b1c4782506e7
parent0a6997ccc925da4677f11e04afcf3a029b807dca (diff)
downloadFreeBSD-src-775a45e1a25f3655c69943d0a2931a8bdf4bca0b.zip
FreeBSD-src-775a45e1a25f3655c69943d0a2931a8bdf4bca0b.tar.gz
- Don't assume that SCSI ID numbers of HDD units are contiguous. That
is, don't assume that SCSI ID corresponds to a unit number of da device. Unit number of da device is provided by 2nd stage loader and 3rd stage loader now use it. - Fix drive letter to display. Submitted by: IMAI Takeshi <take-i@ceres.dti.ne.jp>
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
index 4ab0fee..169452f 100644
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ b/sys/boot/pc98/libpc98/biosdisk.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: biosdisk.c,v 1.3 1999/03/04 16:38:12 kato Exp $
+ * $Id: biosdisk.c,v 1.4 1999/08/05 03:12:20 kato Exp $
*/
/*
@@ -94,7 +94,7 @@ static struct bdinfo
int bd_flags;
int bd_type; /* BIOS 'drive type' (floppy only) */
#ifdef PC98
- int bd_drive;
+ int bd_da_unit; /* kernel unit number for da */
#endif
} bdinfo [MAXBDDEV];
static int nbdinfo = 0;
@@ -165,7 +165,7 @@ bd_init(void)
int base, unit;
#ifdef PC98
- int hd_drive=0, n=-0x10;
+ int da_drive=0, n=-0x10;
/* sequence 0x90, 0x80, 0xa0 */
for (base = 0x90; base <= 0xa0; base += n, n += 0x30) {
for (unit = base; (nbdinfo < MAXBDDEV) || ((unit & 0x0f) < 4); unit++) {
@@ -182,7 +182,6 @@ bd_init(void)
}
if (bdinfo[nbdinfo].bd_flags & BD_FLOPPY){
- bdinfo[nbdinfo].bd_drive = 'A' + (unit & 0xf);
/* available 1.44MB access? */
if (*(u_char *)PTOV(0xA15AE) & (1<<(unit & 0xf))){
/* boot media 1.2MB FD? */
@@ -190,11 +189,13 @@ bd_init(void)
bdinfo[nbdinfo].bd_unit = 0x30 + (unit & 0xf);
}
}
- else
- bdinfo[nbdinfo].bd_drive = 'C' + hd_drive++;
+ else {
+ if ((unit & 0xa0) == 0xa0)
+ bdinfo[nbdinfo].bd_da_unit = da_drive++;
+ }
/* XXX we need "disk aliases" to make this simpler */
printf("BIOS drive %c: is disk%d\n",
- bdinfo[nbdinfo].bd_drive, nbdinfo);
+ 'A' + nbdinfo, nbdinfo);
nbdinfo++;
}
}
@@ -273,8 +274,7 @@ bd_print(int verbose)
for (i = 0; i < nbdinfo; i++) {
#ifdef PC98
- sprintf(line, " disk%d: BIOS drive %c:\n", i,
- bdinfo[i].bd_drive);
+ sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i);
#else
sprintf(line, " disk%d: BIOS drive %c:\n", i,
(bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit) : ('C' + bdinfo[i].bd_unit - 0x80));
@@ -992,7 +992,10 @@ bd_getdev(struct i386_devdesc *dev)
unit = i;
} else {
#ifdef PC98
- unit = biosdev & 0xf; /* allow for #wd compenstation in da case */
+ if ((biosdev & 0xf0) == 0xa0)
+ unit = bdinfo[dev->d_kind.biosdisk.unit].bd_da_unit;
+ else
+ unit = biosdev & 0xf;
#else
unit = (biosdev & 0x7f) - unitofs; /* allow for #wd compenstation in da case */
#endif
OpenPOWER on IntegriCloud