Date: Sun, 26 Oct 2003 8:58:52 +0000 From: <[EMAIL PROTECTED]> Subject: Re: RE: [LIB] How to calculate cylinder#s from sector#s?
> From: "Matt Hanson" <[EMAIL PROTECTED]> <snippage> > Guess I'll cross-post to the list in case it's of any use to someone else > down the line. Reply from the list message if you can. > > [EMAIL PROTECTED] > > ^ ?? Que pasa aqui? 2 'i's? Fiinger trouble :) Nailed_barnacle... > > Barnacle wrote: > >>Hanson wrote: > >> > >>I'm having a hard time getting a definition for a 'cylinder'. > > > >So you have - um - imagine an onion. Slice it through the equator. Lots of > >circles, right? Each ring of the onion is a track; slice the onion and you > >have platters. But the platters, in their unsliced state :) are the > >cylinders... > > > >So you have the same number of cylinders as you have tracks, but the amount > > >of data depends on number of platters (and therefore tracks) there are. > > Okay... that's what I'd come up with. If the width of the wall of an empty > can was the width of a track, the can, without top or bottom, is a bit like > a cylinder on a HDD, except that the cylinder on a HDD is sliced into > platters. Yes, that's fine. Cylinders stack vertically and concentrically; tracks stack horizontally and concentrically. > > >Which means you can address every sector individually by > > >cylinder+head+sector (CHS addressing). Snag is, the original bios runs > >out of space for this at 504MB - 63 sectors, 1024 cylinders, 16 heads. 16 > >heads because that's all the technology at the time could handle... but > >there were enough bits in the system to handle 255 heads. And that would > >give 8.4GB... > > "..enough bits in the system.."? By 'the system', are you referring to the > OS? I'm a bit fuzzy on just what the system is, and how it's capable of > handling 255 heads. Do you mean the 'system' of physical parts inside a > HDD? The interface to the disc drive - as bytes passed to the control electronics - could only understand 16 heads; the *BIOS* (INT 0x13) stuffed the cylinder, track, and head information into a 32-bit structure (internally) and that had space for 255 heads. I found a little more info on this - there were originally limitations in both the disc interface and the bios interface - The bios could refer to: 63 sectors; 255 heads; 1024 cylinder; total 8.4GB The disc interface can refer to: 255 sectors; 16 heads; 65536 cylinders; total 170GB Problem is that when you put them together, they can only use the smallest set of each parameter: 63 sectors, 16 heads, 1024 cylinders: 508MB :( > > >So, they invented LBA addressing - logical block addressing. Each sector > >has its own address, as above, and it's still related to its position on > >the disc(s) but now there's a logical translation built into the system. > >The bios assumes that the disk has the full 255 heads, because that's what > >the disc tells it at boot time. > > So since a single platter can hold far more data that it could 5-10 years > ago, LBA is probably dividing the platter into areas, and calling them head > 1, head 2, head 3... etc.. Yes? Yes, no, and maybe. It doesn't matter; the disc has a *huge* number of sequential sectors and you don't care where they are... internally it will be two or four heads and illions of tracks, but logically, you just ask for the sector you want, and the disc delivers. <snippage> >kay... so now we're talking about LBA here, and its being limited to being > able to deal with a 8.4GB HDD. Yes? No. LBA will deliver 170GB. But it doesn't matter what the disc can do; the *bios* can't ask for it unless it was written to do so. Recall that you don't have to use the bios. Linux doesn't; W2k and friends don't. Once they're working... But there's still a bit of the bios which has to read the first sector of the first track to start the bootstrap code that gets the whole thing going. However the bios does that, it *must* present the standard INT 0x13 interface because *it doesn't know* anything about the OS that is going to be loaded. You *must* use the bios to get your OS loader into the system; after that you can do anything. Now there's no reason why you can't modify the bios to read past the limitations, to use LBA addressing - most have. But the Libretto bios didn't, and at this stage, is unlikely to be unless someone *really* feels enthusiastic :) And the bios knows that it has LBA addressing through its own routines up to 8.4GB... and if it gets an overheat or hibernation event, it cannot rely on the OS to handle it, so it has to use its own resources. > So 1st there was a limitation of 16 heads to begin with for the original CHS > system, then a limitation of 1023 cylinders. Yes, see above. The 16 heads was a limitation from the disc; the 1023 cylinders from the bios. > > What then is the current mode of recognizing the architecture of current > > 8.4MB HDDs referred to as? LBA <snippage> > But I'm still wondering whether or not it would be possible to calculate > exactly which cylinder a specific sector resides on. > > You said above that for the LBA system, "Each sector has its own address, as > above, and it's still related to its position on the disc(s)" If so, it > would seem that if the number of the sector is known, then the cylinder > number and head number where that sector exists should be able to be > determined. Of course it is - to the disc. But the whole point is that it doesn't matter to you - because you don't know how the sectors are internally arranged and numbered. Cylinder number and sector number are irrelevant; *Either* you are asking for data using CHS values or by LBA sector number. Almost certainly there will be a linear relationship between the LBA you get and the CHS you get (LBA 0 = C0,H0,S0) but you don't know whether LBA 1 is sector 1 of C0/H0; or sector 0 of C1/H0; or sector 0 of C0/H1. Neil ----------------------------------------- Email provided by http://www.ntlhome.com/ ************************************************************** 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 **************************************************************
