Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 2002 21:46:22 +0900 (JST)
From:      Takahashi Yoshihiro <nyan@jp.FreeBSD.org>
To:        sos@FreeBSD.org
Cc:        current@FreeBSD.org
Subject:   ata driver
Message-ID:  <20021217.214622.74695206.nyan@jp.FreeBSD.org>

next in thread | raw e-mail | index | archive | help
The current ata driver on pc98 has a problem.  I think that the
following patch solves the problem.  Please review it.  This change
must be in RELENG_5_0 branch.


Index: sys/dev/ata/ata-disk.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-disk.c,v
retrieving revision 1.137
diff -u -r1.137 ata-disk.c
--- sys/dev/ata/ata-disk.c	3 Dec 2002 20:19:37 -0000	1.137
+++ sys/dev/ata/ata-disk.c	8 Dec 2002 08:50:01 -0000
@@ -123,6 +123,14 @@
     adp->heads = atadev->param->heads;
     adp->sectors = atadev->param->sectors;
     adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors;	
+#ifdef PC98
+    if (adp->total_secs < 17 * 8 * 65536) {
+	/* convert PC98 geometry */
+	adp->sectors = 17;
+	adp->heads = 8;
+	atadev->param->cylinders = adp->total_secs / (17 * 8);
+    }
+#endif
     adp->max_iosize = 256 * DEV_BSIZE;
     bioq_init(&adp->queue);
 
Index: sys/geom/geom_pc98.c
===================================================================
RCS file: /home/ncvs/src/sys/geom/geom_pc98.c,v
retrieving revision 1.20
diff -u -r1.20 geom_pc98.c
--- sys/geom/geom_pc98.c	3 Dec 2002 20:18:35 -0000	1.20
+++ sys/geom/geom_pc98.c	8 Dec 2002 04:47:43 -0000
@@ -190,10 +190,6 @@
 		sectorsize = cp->provider->sectorsize;
 		if (sectorsize < 512)
 			break;
-		if (cp->provider->mediasize / sectorsize < 17 * 8 * 65536) {
-			fwsectors = 17;
-			fwheads = 8;
-		}
 		gsp->frontstuff = sectorsize * fwsectors;
 		spercyl = (off_t)fwsectors * fwheads * sectorsize;
 		buf = g_read_data(cp, 0,


---
TAKAHASHI Yoshihiro <nyan@FreeBSD.org>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021217.214622.74695206.nyan>