Date: Sun, 09 Nov 2003 01:08:48 +0000
From: "Matt Hanson" <[EMAIL PROTECTED]>
Subject: Re: [LIB] How to calculate cylinder#s from sector#s?

Wow... Thanks of the rub down on this Lewin! I'll have to copy and paste this and archive it for a closr read when I can grok it a bit more thoroughly.

Matt


From: "Lewin A.R.W. Edwards" <[EMAIL PROTECTED]>

Matt Hanson wrote:

software. I've posed this question to a few people off-list, but have yet to find someone who knows how things get written to HDDs well enough to offer an explanation.

I've written MS-DOS compatible filesystemns from scratch, does that count? :)


If you have an absolute (physical) sector number, you can calculate the corresponding CHS address as follows:

Let SPC = (Heads per cylinder * sectors per track)

Note that some utilities will tell you the NUMBER of heads, and some utilities will tell you the MAXIMUM HEAD NUMBER, which is the number of heads minus one. Make sure you use the correct value.

For a given physical sector P, calculate:

Cyl = integer portion of (P / SPC)

Now let P' = P - (Cyl * SPC) (i.e. the remainder of sectors left over after subtracting the cylinder address)

Head = integer portion of (P' / sectors per track)

Now let P'' = P' - (Head * sectors per track) (i.e. the remainder of sectors left over after subtracting the cylinder and head addresses)

Sector = P'' + 1

(The reason for adding 1 to the sector address is that sectors are numbered starting at 1. Cylinders and heads are numbered starting at zero).

David has estimated that the Windows swap file covers about cylinders 1010 to 1040 for the 64MB RAM on the L1xx Libbys. So I’ve created a

Interesting. I have seen 1016 quoted as the most common starting cyl#. What is the geometry of your drive?


it, put the system into hibernation, booted again, and using WinHex, have found the starting and ending >sectors< of the hibernation area on the drive.

Whoa. These may be RELATIVE (logical) sector numbers. Those are quoted relative to the start of the partition, not the start of the hard drive.


--
-- Lewin A.R.W. Edwards (http://www.larwe.com/)
Learn how to develop high-end embedded systems on a budget!
http://www.amazon.com/exec/obidos/ASIN/0750676094/zws-20


_________________________________________________________________
Great deals on high-speed Internet access as low as $26.95. https://broadband.msn.com (Prices may vary by service area.)






**************************************************************
http://libretto.basiclink.com - Libretto mailing list
http://www.silverace.com/libretto/ - Archives

                -------TO UNSUBSCRIBE-------
Reply to any of the list messages. The reply mail should be
addressed to: [EMAIL PROTECTED] - Then replace any text
on the message's subject line: cmd:unsubscribe
             --------TO UNSUBSCRIBE DIGEST------
Do above but with this on subject line: cmd:unsubscribe digest
**************************************************************



Reply via email to