From 66cc72d13d1c4005aaec7aa0f9caebf464aed42f Mon Sep 17 00:00:00 2001 From: KATO Takenori Date: Sun, 12 Apr 1998 04:48:11 +0000 Subject: [PATCH] Fix the problem when SCSI ID is not contiguous. Submitted by: URATA Shuichiro --- sys/pc98/boot/biosboot/boot.c | 16 ++++++++++++++-- sys/pc98/boot/biosboot/sys.c | 18 ++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/pc98/boot/biosboot/boot.c b/sys/pc98/boot/biosboot/boot.c index c1adea08960f..2f47a433f673 100644 --- a/sys/pc98/boot/biosboot/boot.c +++ b/sys/pc98/boot/biosboot/boot.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, [92/04/03 16:51:14 rvb] - * $Id: boot.c,v 1.15 1997/09/01 10:38:30 kato Exp $ + * $Id: boot.c,v 1.16 1998/02/02 07:56:14 kato Exp $ */ @@ -86,6 +86,10 @@ void boot(int drive) { int ret; +#ifdef PC98 + int i; + unsigned char disk_equips; +#endif /* Pick up the story from the Bios on geometry of disks */ @@ -118,7 +122,15 @@ boot(int drive) dosdev = drive; #ifdef PC98 maj = (drive&0x70) >> 3; /* a good first bet */ - unit = drive & 0x0f; + if (maj == 4) { /* sd */ + disk_equips = *(unsigned char *)V(0xA1482); + unit = 0; + for (i=0; i<(drive&0x0f); i++) { + unit += (disk_equips >> i) & 1; + } + } else { + unit = drive & 0x0f; + } #else /* IBM-PC */ maj = 2; unit = drive & 0x7f; diff --git a/sys/pc98/boot/biosboot/sys.c b/sys/pc98/boot/biosboot/sys.c index afdc5472f9ed..9ec77671f3d5 100644 --- a/sys/pc98/boot/biosboot/sys.c +++ b/sys/pc98/boot/biosboot/sys.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:34 rpd - * $Id: sys.c,v 1.12 1997/05/28 09:23:00 kato Exp $ + * $Id: sys.c,v 1.13 1997/06/09 13:44:04 kato Exp $ */ /* @@ -204,11 +204,6 @@ openrd(void) char **devp, *name0 = name, *cp = name0; int biosdrive, dosdev_copy, ret; -#ifdef PC98 - int i; - unsigned char disk_equips; - int sdunit = 0; -#endif /*******************************************************\ * If bracket given look for preceding device name * \*******************************************************/ @@ -266,7 +261,11 @@ openrd(void) } biosdrive = biosdrivedigit - '0'; if (biosdrivedigit == '\0') { +#ifdef PC98 + biosdrive = dosdev & 0x0f; +#else biosdrive = unit; +#endif #if BOOT_HD_BIAS > 0 /* XXX */ if (maj == 4) @@ -277,12 +276,7 @@ openrd(void) { #ifdef PC98 case 4: /* sd */ - dosdev_copy = unit | 0xa0; - disk_equips = *(unsigned char *)V(0xA1482); - sdunit = unit; - unit = 0; - for (i = 0; i < sdunit; i++) - unit += ((disk_equips >> i) & 0x01); + dosdev_copy = biosdrive | 0xa0; #else /* IBM-PC */ case 0: case 4: