From owner-FreeBSD-users-jp@jp.freebsd.org  Mon Sep 20 23:30:12 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id XAA45048;
	Mon, 20 Sep 1999 23:30:12 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from shrike.dti.ad.jp (shrike.dti.ad.jp [202.216.224.144])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id XAA45043
	for <FreeBSD-users-jp@jp.freebsd.org>; Mon, 20 Sep 1999 23:30:11 +0900 (JST)
	(envelope-from take-i@ceres.dti.ne.jp)
Received: from klein2 (PPP192.tama-ap5.dti.ne.jp [210.170.193.8]) by shrike.dti.ad.jp (8.9.3/3.7W) with ESMTP id XAA14986 for <FreeBSD-users-jp@jp.freebsd.org>; Mon, 20 Sep 1999 23:30:03 +0900 (JST)
Received: by klein2 (8.9.3/3.7W98101921) id XAA31511; Mon, 20 Sep 1999 23:29:57 +0900 (JST)
Date: Mon, 20 Sep 1999 23:29:54 +0900
Message-ID: <14310.17634.635415.21947T@cerse.dti.ne.jp>
From: IMAI Takeshi <take-i@ceres.dti.ne.jp>
To: FreeBSD-users-jp@jp.freebsd.org
In-Reply-To: In your message of "Mon, 20 Sep 1999 11:40:54 +0900"
	<199909201140.IIJ46911.SBNHBB@maizuru-ct.ac.jp>
References: <19990919002409J.ueta@pixy.issp.u-tokyo.ac.jp>
	<71793.937793970@ideon.st.ryukoku.ac.jp>
	<199909201140.IIJ46911.SBNHBB@maizuru-ct.ac.jp>
User-Agent: Wanderlust/2.2.1 (Wild World) WEMI/1.13.6 (=?ISO-8859-1?Q?Roku?=
 =?ISO-8859-1?Q?g=F2?=) FLIM/1.13.2 (Kasanui) MULE XEmacs/21.2 (beta19)
 (Shinjuku) (i686-pc-freebsd)
MIME-Version: 1.0 (generated by WEMI 1.13.6 -
 =?ISO-8859-1?Q?=22Rokug=F2=22?=)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Sep_20_23:29:54_1999-1"
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: FreeBSD-users-jp 45804
Subject: [FreeBSD-users-jp 45804] Patch for problem of unload/load kernel
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: take-i@ceres.dti.ne.jp

--Multipart_Mon_Sep_20_23:29:54_1999-1
Content-Type: text/plain; charset=ISO-2022-JP

$B:#0f$G$9!#(B

/boot/loader $B$G(B unload $B8e$K%+!<%M%k$,(B load $B$G$-$J$$LdBj$r=$@5$9$k%Q%C(B
$B%A$G$9!#(B

$B%Q%C%A$N;H$$J}$O!"(B

1.$BE:IU$N%Q%C%A$r(B /tmp/biosdisk.c.diff $B$G%;!<%V$9$k(B
2.$B%Q%C%A$NE,MQ(B
  # cd /sys/boot/pc98/libpc98
  # patch < /tmp/biosdisk.c.diff
3./boot/loader $B$N:F:n@.(B
  # cd /sys/boot
  # make obj depend && make && make install

$B$G$9!#(B


--Multipart_Mon_Sep_20_23:29:54_1999-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="biosdisk.c.diff"
Content-Transfer-Encoding: 7bit

--- biosdisk.c.dist	Mon Aug 30 21:42:18 1999
+++ biosdisk.c	Mon Aug 30 21:41:44 1999
@@ -764,7 +764,7 @@ bd_read(struct open_disk *od, daddr_t db
 
     /* Decide whether we have to bounce */
 #ifdef PC98
-    if (((od->od_unit & 0xf0) == 0x90 || (od->od_unit & 0xf0) == 0x30) && 
+    if (
 #else
     if ((od->od_unit < 0x80) && 
 #endif
@@ -776,7 +776,11 @@ bd_read(struct open_disk *od, daddr_t db
 	 * need to.  Use the bottom half unless there is a break there, in which case we
 	 * use the top half.
 	 */
+#ifdef PC98
+	x = min(od->od_sec, blks);
+#else
 	x = min(FLOPPY_BOUNCEBUF, blks);
+#endif
 	bbuf = malloc(x * 2 * BIOSDISK_SECSIZE);
 	if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(dest + x * BIOSDISK_SECSIZE) & 0xffff0000)) {
 	    breg = bbuf;
@@ -817,18 +821,21 @@ bd_read(struct open_disk *od, daddr_t db
 	    /* if retrying, reset the drive */
 	    if (retry > 0) {
 #ifdef PC98
+		v86.ctl = V86_FLAGS;
+		v86.addr = 0x1b;
+		v86.eax = 0x0300 | od->od_unit;
 #else
 		v86.ctl = V86_FLAGS;
 		v86.addr = 0x13;
 		v86.eax = 0;
 		v86.edx = od->od_unit;
-		v86int();
 #endif
+		v86int();
 	    }
 	    
 	    /* build request  XXX support EDD requests too */
+	    v86.ctl = V86_FLAGS;
 #ifdef PC98
-	    v86.ctl = 0;
 	    v86.addr = 0x1b;
 	    if (od->od_flags & BD_FLOPPY) {
 	        v86.eax = 0xd600 | od->od_unit;
@@ -842,17 +849,15 @@ bd_read(struct open_disk *od, daddr_t db
 	    v86.ebx = x * BIOSDISK_SECSIZE;
 	    v86.es = VTOPSEG(xp);
 	    v86.ebp = VTOPOFF(xp);
-	    v86int();
 #else
-	    v86.ctl = V86_FLAGS;
 	    v86.addr = 0x13;
 	    v86.eax = 0x200 | x;
 	    v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec;
 	    v86.edx = (hd << 8) | od->od_unit;
 	    v86.es = VTOPSEG(xp);
 	    v86.ebx = VTOPOFF(xp);
-	    v86int();
 #endif
+	    v86int();
 	    result = (v86.efl & 0x1);
 	    if (result == 0)
 		break;
@@ -900,7 +905,7 @@ bd_getgeom(struct open_disk *od)
 	od->od_sec = (od->od_unit & 0xf0) == 0x30 ? 18 : 15;
     }
     else {
-        v86.ctl = 0;
+        v86.ctl = V86_FLAGS;
 	v86.addr = 0x1b;
 	v86.eax = 0x8400 | od->od_unit;
 	v86int();
@@ -908,6 +913,8 @@ bd_getgeom(struct open_disk *od)
 	od->od_cyl = v86.ecx;
 	od->od_hds = (v86.edx >> 8) & 0xff;
 	od->od_sec = v86.edx & 0xff;
+	if (v86.efl & 0x1)
+	    return(1);
     }
 #else
     v86.ctl = V86_FLAGS;

--Multipart_Mon_Sep_20_23:29:54_1999-1
Content-Type: text/plain; charset=US-ASCII

-- 
IMAI Takeshi  take-i@ceres.dti.ne.jp

--Multipart_Mon_Sep_20_23:29:54_1999-1--
