[comp.sys.atari.st] READING HD HYSICAL SECTORS

cs325ec@ux1.cso.uiuc.edu (03/02/90)

	Someone from the Netherlands responded to my post about
	reading physical sectors from a Hard Disk.  His code was
	accurate and worked... Setting bit 3 in the rwflag enabled
	physical sectors to be read... but...  Secno however,
	is an int and can not be higher than 32767 or 65535 if 
	Rwabs can handle unsigned, so how do I read sectors
	higher than those?

	Thanks in advance.

	-Greg

apratt@atari.UUCP (Allan Pratt) (03/03/90)

cs325ec@ux1.cso.uiuc.edu writes:
> but...  Secno however,
> is an int and can not be higher than 32767 or 65535 if 
> Rwabs can handle unsigned, so how do I read sectors
> higher than those?

With the old hard disk driver, you can't.  With the new one, you can: I
believe you use a secno of -1 as a signal, and add an extra argument at
the end: the LONG sector number you want. I could be wrong.  By "new"
and "old" I mean 3.x is "new" and 2.x, 1.x or no version number at all
is "old."  Get the developer's documentation for the AHDI 3.00 Release
Notes: it has the straight scoop on this and much more.

I hope you are not assuming that a logical sector is 512 bytes; that's
no longer always the case, and people will not be able to use your tool
if you make that assumption.  Physical sectors, though, *are* always
512 bytes (as far as I know), which adds a level of complication when
you do physical-sector reads and writes.  In other words, get the docs
on this or you will probably get it wrong.

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt

hcj@lzsc.ATT.COM (HC Johnson) (03/03/90)

In article <16000016@ux1.cso.uiuc.edu>, cs325ec@ux1.cso.uiuc.edu writes:
> 
> 
> 	Someone from the Netherlands responded to my post about
> 	reading physical sectors from a Hard Disk.  His code was
> 	accurate and worked... Setting bit 3 in the rwflag enabled
> 	physical sectors to be read... but...  Secno however,
> 	is an int and can not be higher than 32767 or 65535 if 
> 	Rwabs can handle unsigned, so how do I read sectors
> 	higher than those?

The real answer is you dont.  And this is why.
The use of bit 3 is/was really to get to sector 0 and maybe 1 and 2.
(1 and 2 might contain a list of bad blocks).  After this, very limited
area, it is expected that partitions will cover the physical disk.

TOS partitions can then be accessed by drive and offset.

What about Spectre and Minix partitions?  Then you need your OWN driver
that will access sectors as a long absolute value.  Thats what Spectre
and Minix do.

Howard C. Johnson
ATT Bell Labs
att!lzsc!hcj
hcj@lzsc.att.com