how to get some values for LBA <-> CHS conversion?

  • Follow


Hello

I am trying to apply this formula (found @
http://encyclopedia.thefreedictionary.com/CHS%20conversion):

[quote]
>From CHS to LBA
The equation to convert from CHS to LBA follows:


 LBA = ( ( CYL * HPC + HEAD ) * SPT ) + SECT - 1

Where:

 LBA: linear base address of the block
 CYL: value of the cylinder CHS coordinate
 HPC: number of heads per cylinder for the disk
 HEAD: value of the head CHS coordinate
 SPT: number of sectors per track for the disk
 SECT: value of the sector CHS coordinate
[/quote]

I have read the partition table and got these values: CYL, HEAD, SECT; how
can I get the other missing variables (SPT & HPC) ?

--
Elias


0
Reply lallous (276) 5/26/2004 5:59:27 PM

["Followup-To:" header set to comp.lang.asm.x86.]
On Wed, 26 May 2004 17:59:27 +0000 (UTC), lallous 
  <lallous@lgwm.org> wrote:
> Hello
>
> I am trying to apply this formula (found @
> http://encyclopedia.thefreedictionary.com/CHS%20conversion):
>
> [quote]
>>From CHS to LBA
> The equation to convert from CHS to LBA follows:
>
>
>  LBA = ( ( CYL * HPC + HEAD ) * SPT ) + SECT - 1
>
> Where:
>
>  LBA: linear base address of the block
>  CYL: value of the cylinder CHS coordinate
>  HPC: number of heads per cylinder for the disk
>  HEAD: value of the head CHS coordinate
>  SPT: number of sectors per track for the disk
>  SECT: value of the sector CHS coordinate
> [/quote]
>
> I have read the partition table and got these values: CYL, HEAD, SECT; how
> can I get the other missing variables (SPT & HPC) ?
>
There's a BIOS call to get them, or you can just assume the standard
fictitious values of 16 heads and 63 sectors, unless you are actually
using an ancient MFM or RLL drive.  On modern drives, the actual
physical location of a sector on the disk is known only to the drive's
circuitry.


-- 
Somewhere, just out of sight, the unicorns are gathering.

0
Reply Bill 5/31/2004 6:01:08 PM


1 Replies
1254 Views

(page loaded in 0.038 seconds)

Similiar Articles:













7/22/2012 7:56:39 AM


Reply: