Sector starts counting at 1

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
DLBuunk
Member
Member
Posts: 39
Joined: Sun May 18, 2008 9:36 am
Location: The Netherlands

Sector starts counting at 1

Post by DLBuunk »

Does anyone know why in CHS-format sector-count starts at 1 instead of 0. Is there any (historical) reason for this?
If you don't know what to say, please shut up.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Sector starts counting at 1

Post by bewing »

The reason is that it was a horrible mistake that Western Digital made, 40+ years ago.
There is certainly no good reason for it.
User avatar
Telgin
Member
Member
Posts: 72
Joined: Thu Dec 20, 2007 1:45 pm

Re: Sector starts counting at 1

Post by Telgin »

bewing wrote:The reason is that it was a horrible mistake that Western Digital made, 40+ years ago.
There is certainly no good reason for it.
Heh, I can't think of a good reason, but cylinder and header indexes start at zero right? Surely WD wouldn't just arbitrarily decide that sectors start at 1 without some reason. Maybe not a good one, but there's got to be a reason.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Sector starts counting at 1

Post by bewing »

Most likely, they were using sector 0 of one or more tracks for a soft-sector timing pulse -- so it was not available for data.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Sector starts counting at 1

Post by Troy Martin »

bewing wrote:Most likely, they were using sector 0 of one or more tracks for a soft-sector timing pulse -- so it was not available for data.
Oooh, good one. I think it was some half-drunken programmer who forgot computers start counting at 0.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
DT170x
Posts: 19
Joined: Mon Aug 25, 2008 6:12 pm

Re: Sector starts counting at 1

Post by DT170x »

Remember the SHIP command.

The ship command (if you got a very old MS-DOS disk) put the sector to 0 because if you move the computer around they think that you will damage the hard drive.
DT Model 1540 OS 1% <Kernel>
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Sector starts counting at 1

Post by AJ »

I certainly remember "parker", on our old Apricot (a 286, IIRC). You were advised to run this program before each time you turned the computer off to "park the drive heads" - perhaps that did the same as ship.

Cheers,
Adam
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Sector starts counting at 1

Post by bewing »

Yes, but those programs set the head CYLINDER number, not the sector number. Usually, they moved the heads to the very inside cylinder (near the hub) which was called the "landing zone" -- a term you can sometimes still see in BIOSes today. That cylinder was never formatted.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Sector starts counting at 1

Post by Brendan »

Hi,
bewing wrote:Yes, but those programs set the head CYLINDER number, not the sector number. Usually, they moved the heads to the very inside cylinder (near the hub) which was called the "landing zone" -- a term you can sometimes still see in BIOSes today. That cylinder was never formatted.
I remember that too - the idea was to put the disk heads somewhere safe, so that if the computer is bumped the heads don't scratch part of the disk where your data is stored. Not sure if modern hard drives still do this or not...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Sector starts counting at 1

Post by JAAman »

yes, iirc, modern HDDs do still do this, just a little different...

(most if not all) IDE drives never need to be 'park'ed, instead, the arm is built so that if the drive looses power, it will automatically swing to a safe zone

this must be done, since a drives head is gliding on a layer of air just barely above the surface of the disk, the air cushion is created by the force of the spinning disk, if that disk slows its spin while the head is over the disk surface, it will drop onto the still spinning disk, and create a gouge that will destroy any data under the arm... (and at the same time make that part of the disk unusable thereafter)

modern drives are built so that the arm will automatically swing safely to the side as soon as the drive looses power (so even if the drive were to be cut off suddenly from power, it will still happen)

with newer drives, i dont think its even possible to send the heads to the landing zone... and there is no point to doing so anyway, only older (pre-IDE) drives need this done manually
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Sector starts counting at 1

Post by AJ »

Thanks for that interesting insight and nice to know I didn't type "parker" for all those years for no reason!

Cheers,
Adam
Post Reply