9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] WD hard disk not available in partdisk
@ 2002-07-05 15:20 jmk
  2002-07-05 19:57 ` John DeGood
  0 siblings, 1 reply; 4+ messages in thread
From: jmk @ 2002-07-05 15:20 UTC (permalink / raw)
  To: 9fans

A dumb bug, I fear, introduced between the 2nd and 3rd Edition, but I'd like
confirmation from another party. I believe the code around line 590 of sdata.c
has the 'current' and 'logical' sectors swapped and should be

		if(drive->info[Ivalid] & 0x0001){
			drive->c = drive->info[Iccyl];
			drive->h = drive->info[Ichead];
			drive->s = drive->info[Icsec];
		}
		else{
			drive->c = drive->info[Ilcyl];
			drive->h = drive->info[Ilhead];
			drive->s = drive->info[Ilsec];
		}

Your old drive does not have LBA mode so this assignment becomes important.
What puzzles me is that this hasn't caused problems before, as it can lead to
division by zero later on. This applies to both the kernel and 9load.

In the later ATA/ATAPI 'standards' all this was finessed away by stating that
all drives will support LBA mode.

I've tested this on a WD AC2120 (125MB, my disc is smaller than your disc).

--jim


On Thu Jul  4 16:46:16 EDT 2002, nu3e@arrl.net wrote:
> I tried to install 4th Edition on an old Western Digital AC2340 340 MB hard
> drive.  The hard drive is recognized by the BIOS and works with DOS and
> Win95, but it does not appear in "partdisk" during the Plan 9 install.  I
> also tried an old Seagate ST3243A 214 MB hard drive and "partdisk"
> recognizes it fine.  I tried all master/slave combinations of the AC2340 and
> ST3243A, and in every case only the ST3243A is available in "partdisk".
> 
> Here are snippets of what I get with the ST3243A as primary master and the
> AC2340 as primary slave.  In every case the AC2340 appears to be recognized
> early in the boot process, but it is never available in "partdisk":
> ----
>   dev A0 port 1F0 config 045A capabilities 0000 mwdma 0000 dma 00000000 rwm
> 8
>   dev B0 port 1F0 config 427A capabilities 0100 mwdma 0000 dma 00000000 rwm
> 16
>   dev A0 port 170 config 8580 capabilities 0B00 mwdma 0003 dma 00000000 rwm
> 0
> ----
>   The following disk devices were found.
> 
>   sdC0 - ST3243A
>   * p1     0     1023  (1023 cylinders, 203.80 MB) FATHUGE
>    empty  1023  1024  (1 cylinders, 204.00 KB)
> 
>   sdD0 - NEC CD-ROM DRIVE: 2523.18
> ----
> This system has an old Intel Plato (aka Premier/PCI II) motherboard (Pentium
> 90 w/ 430NX chipset).
> 
> I also tried a 3rd Edition 9disk.9fd and had the same problem.
> 
> Am I doing something dumb or is this a bug/feature? :-)
> 
> John


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] WD hard disk not available in partdisk
  2002-07-05 15:20 [9fans] WD hard disk not available in partdisk jmk
@ 2002-07-05 19:57 ` John DeGood
  0 siblings, 0 replies; 4+ messages in thread
From: John DeGood @ 2002-07-05 19:57 UTC (permalink / raw)
  To: 9fans

Based on reading the ATA-1 and ATA-2 specs
(http://www.t13.org/project/d0791r4c.pdf and
http://www.t13.org/project/d0948r4c.pdf) I agree that the if statement clauses
in sdata.c appear to be reversed.

FWIW, the ATA-6 draft (http://www.t13.org/project/d1410r3a.pdf) declares:
----
   8.15.26 Word 53: Field validity

   Bit 0 of word 53 is obsolete.
...
   8.15.27 Word (58:54): Obsolete
----
Does this suggest that this code in sdata.c may cause problems in the future if
it continues to always assume that the content of bit 0 of word 53 is valid?

> I've tested this on a WD AC2120 (125MB, my disc is smaller than your disc).

I'd try my ST225 (21.4 MB), but I don't think its controller is supported. :-)

John

--- jmk@plan9.bell-labs.com wrote:
> A dumb bug, I fear, introduced between the 2nd and 3rd Edition, but I'd like
> confirmation from another party. I believe the code around line 590 of
> sdata.c
> has the 'current' and 'logical' sectors swapped and should be
> 
> 		if(drive->info[Ivalid] & 0x0001){
> 			drive->c = drive->info[Iccyl];
> 			drive->h = drive->info[Ichead];
> 			drive->s = drive->info[Icsec];
> 		}
> 		else{
> 			drive->c = drive->info[Ilcyl];
> 			drive->h = drive->info[Ilhead];
> 			drive->s = drive->info[Ilsec];
> 		}
> 
> Your old drive does not have LBA mode so this assignment becomes important.
> What puzzles me is that this hasn't caused problems before, as it can lead to
> division by zero later on. This applies to both the kernel and 9load.
> 
> In the later ATA/ATAPI 'standards' all this was finessed away by stating that
> all drives will support LBA mode.
> 
> I've tested this on a WD AC2120 (125MB, my disc is smaller than your disc).
> 
> --jim
> 
> 
> On Thu Jul  4 16:46:16 EDT 2002, nu3e@arrl.net wrote:
> > I tried to install 4th Edition on an old Western Digital AC2340 340 MB hard
> > drive.  The hard drive is recognized by the BIOS and works with DOS and
> > Win95, but it does not appear in "partdisk" during the Plan 9 install.  I
> > also tried an old Seagate ST3243A 214 MB hard drive and "partdisk"
> > recognizes it fine.  I tried all master/slave combinations of the AC2340
> and
> > ST3243A, and in every case only the ST3243A is available in "partdisk".
> > 
> > Here are snippets of what I get with the ST3243A as primary master and the
> > AC2340 as primary slave.  In every case the AC2340 appears to be recognized
> > early in the boot process, but it is never available in "partdisk":
> > ----
> >   dev A0 port 1F0 config 045A capabilities 0000 mwdma 0000 dma 00000000 rwm
> > 8
> >   dev B0 port 1F0 config 427A capabilities 0100 mwdma 0000 dma 00000000 rwm
> > 16
> >   dev A0 port 170 config 8580 capabilities 0B00 mwdma 0003 dma 00000000 rwm
> > 0
> > ----
> >   The following disk devices were found.
> > 
> >   sdC0 - ST3243A
> >   * p1     0     1023  (1023 cylinders, 203.80 MB) FATHUGE
> >    empty  1023  1024  (1 cylinders, 204.00 KB)
> > 
> >   sdD0 - NEC CD-ROM DRIVE: 2523.18
> > ----
> > This system has an old Intel Plato (aka Premier/PCI II) motherboard
> (Pentium
> > 90 w/ 430NX chipset).
> > 
> > I also tried a 3rd Edition 9disk.9fd and had the same problem.
> > 
> > Am I doing something dumb or is this a bug/feature? :-)
> > 
> > John
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] WD hard disk not available in partdisk
@ 2002-07-05 21:33 jmk
  0 siblings, 0 replies; 4+ messages in thread
From: jmk @ 2002-07-05 21:33 UTC (permalink / raw)
  To: 9fans

John DeGood <nu3e@yahoo.com>:
	Based on reading the ATA-1 and ATA-2 specs
	(http://www.t13.org/project/d0791r4c.pdf and
	http://www.t13.org/project/d0948r4c.pdf) I agree that the if statement clauses
	in sdata.c appear to be reversed.

	FWIW, the ATA-6 draft (http://www.t13.org/project/d1410r3a.pdf) declares:
	----
	   8.15.26 Word 53: Field validity

	   Bit 0 of word 53 is obsolete.
	...
	   8.15.27 Word (58:54): Obsolete
	----
	Does this suggest that this code in sdata.c may cause problems in the future if
	it continues to always assume that the content of bit 0 of word 53 is valid?

Most likely this will eventually be a problem.

	> I've tested this on a WD AC2120 (125MB, my disc is smaller than your disc).

	I'd try my ST225 (21.4 MB), but I don't think its controller is supported. :-)

	John


My 40MB Conner CP3000 seems to work with the changes too.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [9fans] WD hard disk not available in partdisk
  2002-07-04 19:41 ` FJ Ballesteros
@ 2002-07-04 20:52   ` John DeGood
  0 siblings, 0 replies; 4+ messages in thread
From: John DeGood @ 2002-07-04 20:52 UTC (permalink / raw)
  To: 9fans

I tried to install 4th Edition on an old Western Digital AC2340 340 MB hard
drive.  The hard drive is recognized by the BIOS and works with DOS and
Win95, but it does not appear in "partdisk" during the Plan 9 install.  I
also tried an old Seagate ST3243A 214 MB hard drive and "partdisk"
recognizes it fine.  I tried all master/slave combinations of the AC2340 and
ST3243A, and in every case only the ST3243A is available in "partdisk".

Here are snippets of what I get with the ST3243A as primary master and the
AC2340 as primary slave.  In every case the AC2340 appears to be recognized
early in the boot process, but it is never available in "partdisk":
----
  dev A0 port 1F0 config 045A capabilities 0000 mwdma 0000 dma 00000000 rwm
8
  dev B0 port 1F0 config 427A capabilities 0100 mwdma 0000 dma 00000000 rwm
16
  dev A0 port 170 config 8580 capabilities 0B00 mwdma 0003 dma 00000000 rwm
0
----
  The following disk devices were found.

  sdC0 - ST3243A
  * p1     0     1023  (1023 cylinders, 203.80 MB) FATHUGE
   empty  1023  1024  (1 cylinders, 204.00 KB)

  sdD0 - NEC CD-ROM DRIVE: 2523.18
----
This system has an old Intel Plato (aka Premier/PCI II) motherboard (Pentium
90 w/ 430NX chipset).

I also tried a 3rd Edition 9disk.9fd and had the same problem.

Am I doing something dumb or is this a bug/feature? :-)

John



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-05 21:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-05 15:20 [9fans] WD hard disk not available in partdisk jmk
2002-07-05 19:57 ` John DeGood
  -- strict thread matches above, loose matches on Subject: below --
2002-07-05 21:33 jmk
2002-07-04 17:43 [9fans] rtl8139 troubles and 2 questions forsyth
2002-07-04 19:41 ` FJ Ballesteros
2002-07-04 20:52   ` [9fans] WD hard disk not available in partdisk John DeGood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).