From owner-man-jp-reviewer@jp.freebsd.org  Tue Mar  2 00:54:16 1999
Received: (from daemon@localhost)
	by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) id AAA20473;
	Tue, 2 Mar 1999 00:54:16 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from mail.yk.rim.or.jp (root@mail.yk.rim.or.jp [202.247.130.37])
	by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) with ESMTP id AAA20467
	for <man-jp-reviewer@jp.freebsd.org>; Tue, 2 Mar 1999 00:54:14 +0900 (JST)
	(envelope-from k-horik@yk.rim.or.jp)
Received: from localhost (ppp461.yk.rim.or.jp [202.247.165.161])
	by mail.yk.rim.or.jp (8.8.8/3.6W-RIMNET-98-06-09) with ESMTP id AAA07324
	for <man-jp-reviewer@jp.freebsd.org>; Tue, 2 Mar 1999 00:54:11 +0900 (JST)
To: man-jp-reviewer@jp.freebsd.org
In-Reply-To: Your message of "Mon, 01 Mar 1999 20:41:50 +0900"
	<19990301204150L.mzaki@e-mail.ne.jp>
References: <19990301204150L.mzaki@e-mail.ne.jp>
X-Mailer: Mew version 1.93 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <19990302005326G.k-horik@yk.rim.or.jp>
Date: Tue, 02 Mar 1999 00:53:26 +0900
From: Kazuo Horikawa <k-horik@yk.rim.or.jp>
X-Dispatcher: imput version 980905(IM100)
Lines: 91
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+981115
X-Sequence: man-jp-reviewer 1092
Subject: [man-jp-reviewer 1092] Re: wd.4
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: k-horik@yk.rim.or.jp

 $BKY@n$G$9!#(B

 a.o. $B$OJ,$+$i$J$$$N$G!"D4$Y$F$_$^$9!#(B

$B>>:j$5$s!'(B
> .Sh $B2r@b(B
> $B$3$N%I%i%$%P$G!"%&%'%9%?%s%G%8%?%k(B WD100x $B%7%j!<%:$r%(%_%e%l!<%H$9$k(B
                  Western Digital
 $B8GM-L>;l$O86J8$N$^$^$,0BA4$@$H;W$&$G$9!#(B
> $B%3%s%H%m!<%i$K@\B3$5$l$?%G%#%9%/$K%"%/%;%9$G$-$k$h$&$K$J$j$^$9!#(B


> 16 bit $B@0?t$N%U%i%0$,%I%i%$%VKh$K$"$j!"(B
> $B$=$l$>$l$K(B4($BLuCm(B:6)$B$D$N%S%C%H%U%#!<%k%I$,$"$j$^$9(B:
> .\" By mzaki@e-mail.ne.jp (Mar 1 1999)
 $B$3$3$O!"!V(B($BLuCm(B: $B<B:]$K$O(B 6)$B!W$J$I$H$7$F!"86J88m$j$r;XE&$9$k(B send-pr 
$B$r$9$Y$-$H$3$m$G$9$M!#$*4j$$$G$-$^$9$G$7$g$&$+!#(B


> .It 0x4000
> $B%I%i%$%V$,%9%j!<%W%b!<%I$+$iC&$7$F$$$k$h$&$G$"$l$P!"(B
 $B8=:_?J9T7A$J$N$G!"(B
                                        $B$H$3$m$G$"$k$h$&$J$i$P!"(B
$B$G$7$g$&$+!#(B
> $B:.Mp$7$F$$$k$H$_$J$7$F:F=i4|2=$7$^$9!#(B
> If drive looks like it's coming out of sleep mode, assume it's 
> confused and reinitialize it.
 $B0UL#$H$7$F$O!"$3$N$^$^$G@5$7$$$H;W$$$^$9!#(B


> .It 0x00ff
> $B%I%i%$%V$N%^%k%A%;%/%?E>Aw%b!<%I$,;H$($l$P;H$$$^$9!#(B
> $B:GBg$G(B (flags & 0x00ff) $B%;%/%?!<$NE>Aw$r;n$_$^$9!#(B
                          $B%;%/%?$NE>Aw$r;n$_$^$9!#(B


> 		/* OK, so the APM bios has put the disk into SLEEP mode,
> 		 * how can we tell ?  Uhm, we can't.  There is no 
> 		 * standardized way of finding out, and the only way to
> 		 * wake it up is to reset it.  Bummer.
	SLEEP $B>uBV$N%A%'%C%/J}K!$OL5$$$+$i!"%j%;%C%H$9$k$7$+$J$$!#(B

> 		 * All the many and varied versions of the IDE/ATA standard
> 		 * explicitly tells us not to look at these registers if
> 		 * the disk is in SLEEP mode.  Well, too bad really, we
> 		 * have to find out if it's in sleep mode before we can 
> 		 * avoid reading the registers.
	SLEEP $B>uBV$N%G%#%9%/$N%l%8%9%?$rFI$s$G$O$J$i$J$$!#(B

> 		 * I have reason to belive that most disks will return
> 		 * either 0xff or 0x00 in all but the status register 
> 		 * when in SLEEP mode, but I have yet to see one return 
> 		 * 0x00, so we don't check for that yet.
	$B$[$H$s$I$N%G%#%9%/$G$O!"(BSLEEP $B>uBV$G$O!"(BSTATUS $B0J30$N%l%8%9%?(B
	$B$O(B 0x00 $B$+(B 0xFF $B$,FI$a$k$H;W$&!#(B

 but I have yet to see one return 0x00, so we don't check for that
yet.  $B$O<+?.$J$$$G$9$,!"(Bone $B$O%l%8%9%?$G$7$g$&$+!#(B

	$B$"$k%l%8%9%?$O(B 0x00 $B$rJV$9$b$N$r8+$?$3$H$,$"$k$N$G!"$3$l$O%A%'%C(B
	$B%/$7$J$$!#(B

 $B%=!<%9BP1~2U=j$O(B
                if(inb(wdc + wd_precomp) + inb(wdc + wd_cyl_lo) +
                    inb(wdc + wd_cyl_hi) + inb(wdc + wd_sdh) +
                    inb(wdc + wd_sector) + inb(wdc + wd_seccnt) == 6 * 0xff) {
                        if (bootverbose)
                                printf("wd(%d,%d): disk aSLEEP\n",
                                        du->dk_ctrlr, du->dk_unit);
                        wdunwedge(du);
$B$G$7$g$&!#(B
 $B$H$9$k$H!"(B
	$B$[$H$s$I$N%G%#%9%/$G$O!"(BSLEEP $B>uBV$G$O!"(BSTATUS $B0J30$N%l%8%9%?(B
	$B$O(B 0xFF $B$,FI$a$k$H;W$&!#(B
$B$@$H;W$&$1$I!#(B

> 		 * The check for WDCS_BUSY is for the case where the
> 		 * bios spins up the disk for us, but doesn't initialize
> 		 * it correctly					/phk
> 		 */
	BIOS $B$,%9%T%s%"%C%W$7$F$b@5$7$/=i4|2=$7$F$$$J$$>l9g$N$?$a$K(B 
	WDCS_BUSY $B$r%A%'%C%/$9$k!#(B
 $B%=!<%9BP1~2U=j$O(B
                } else if(inb(wdc + wd_status) == WDCS_BUSY) {
                        if (bootverbose)
                                printf("wd(%d,%d): disk is BUSY\n",
                                        du->dk_ctrlr, du->dk_unit);
                        wdunwedge(du);
$B$G$7$g$&!#(B
--
$BKY@nOBM:(B
