VOGONS


First post, by douglar

User metadata
Rank Oldbie
Rank
Oldbie

I was filling out some more junk in the Wiki--
https://www.vogonswiki.com/index.php/Storage# … age_Limitations

I see that MS DOS was limitted to 255 heads (8 bits)
I see that INT 13h was limitted to 1024 (10 bits ) for a long time.
https://web.archive.org/web/20160914062704/ht … ize-limits.html
http://web.inter.nl.net/hcc/J.Steunebrink/bioslim.htm

Why were sectors per track limitted to 63? If it was just INT 13h , why wasn't it ever expanded?

Reply 1 of 10, by Matth79

User metadata
Rank Oldbie
Rank
Oldbie

I'm guessing it was designed in the same vein as "640kB will be enough for anyone" to allow some wiggle room when MFM used 17 sectors and RLL used 26 (maybe a few more on some).
On the other hand, 255 heads seems overly generous, that would be a 128 platter stack

Reply 2 of 10, by douglar

User metadata
Rank Oldbie
Rank
Oldbie

Looking at Ralf Brown's list for the first time in 20 years, I think I see the answer--

http://www.delorie.com/djgpp/doc/rbinter/id/13/6.html

INT 13 - DISK - READ SECTOR(S) INTO MEMORY
AH = 02h
AL = number of sectors to read (must be nonzero)
CH = low eight bits of cylinder number
CL = sector number 1-63 (bits 0-5)
high two bits of cylinder (bits 6-7, hard disk only)
DH = head number

They origionally jammed CHS into 16 bits.

When they expanded it:

  • they only needed to expand 1 field
  • They didn't increase heads because there was a bug in DOS that made it unpracticable
  • Made more sense to expand cylinders because it was already split over two bytes
  • Look a while to get all the os/s to support the cylinder change

Reply 3 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t

The most important data structure using the 10-bit cylinder / 6-bit sector split is the classic MBR partitioning scheme (which is modelled after the BIOS interface). The CHS entries in the partition table can't represent geometries with more than 63 sectors per track, so if you want compatibility with legacy operating systems, the geometry may not exceed 63 sectors per track. If you don't care about legacy compatibility, you don't use CHS geometries at all, but you just use LBA adressing, and thus you don't care about sectors per track anymore.

Reply 4 of 10, by douglar

User metadata
Rank Oldbie
Rank
Oldbie
mkarcher wrote on 2021-12-09, 19:45:

The CHS entries in the partition table can't represent geometries with more than 63 sectors per track

Thanks! It sure seemed that this one, like heads, was more complicated than just int 13h.

How big could the number of cylinders be in the partition table of Fat16?

Reply 5 of 10, by debs3759

User metadata
Rank Oldbie
Rank
Oldbie

FAT16 doesn't define the number of cylinders. It can map a maximum of 65526 clusters, with a maximum cluster size of 32KB.

See my graphics card database at www.gpuzoo.com
Constantly being worked on. Feel free to message me with any corrections or details of cards you would like me to research and add.

Reply 6 of 10, by douglar

User metadata
Rank Oldbie
Rank
Oldbie
debs3759 wrote on 2021-12-10, 01:53:

FAT16 doesn't define the number of cylinders. It can map a maximum of 65526 clusters, with a maximum cluster size of 32KB.

OK, I was mixing up partition tables with partition formatting. MBR exists outside of the partitions, fat16 is inside a partition.

So I did some more research. According to Wikipedia, I see that there are a lot of different MBRs , but they all use similar partition entires that have 24 bits for starting CHS and 24 bits for the ending CHS. The 24 bit notation is going to limit drives to 1024 Cylinders, 255 heads, 63 sectors (1024 because cylinders start at 1, while heads and sectors start at 0)

But at some point in the late 1990's, bios started allowing values over 1024 for cylinders and later cylinder values over 65535.

Did those large Cylinder values fit into the partition table entires as CHS or was it all LBA at that point?

Reply 7 of 10, by Jo22

User metadata
Rank l33t++
Rank
l33t++

http://donaldkenney.x10.mx/GLOSSARY/EXTENDED.HTM

Browsing a harddisk under DOS without using BIOS routines (INT13H)

Edit: Old, traditional CHS / Cylinders 0-1023 (1024 total), Heads 0-15 (16 total), Sectors 1-63 (63 total).

Actual interpretation for input depends on BIOS/Setup Utility, afaik.
Some may oddly expect human values entered as written on the HDD label ("16" for 16 heads total vs "15"), but use the technical values internally ("15").

LBA handles Sectors as 0-62 (63 total), Heads and 0-255 (256 total). Cylinders can be greater than 1024 total (0-65535; 65536 total).

Extended CHS aka Large might be a crossover or in-between of CHS and LBA. Have to check.

Heads are sometimes capped by certain BIOSes for compatibility reasons (DOS/Win95): 0-254 (255 Heads total; not 256)

The reverse might also be true. Some BIOSes pass higher values through traditional int13h. interface.
MS Virtual PC 2007, uses such a weird BIOS, for example.
It allows more than 1024 Cylinders, afaik.

"Track 0" on HDDs/Floppies is a special case, also.
It contains boot code and isn't normally visible.
DOS utilities like S0kill can clear it, though.

"Cylinders" is Fixed Disk (HDD) terminology.
"Tracks" is floppy disk terminology.
Software-wise, both refer to the same thing often, however.
http://209.68.14.80/ref/hdd/geom/tracksDifference-c.html

Also note, that the actual limit in practice comes from the combined limits of both PC BIOS and IDE specs.

https://www.win.tue.nl/~aeb/linux/Large-Disk-4.html

I'm speaking under correction, of course.
Please double check the information.
I just mentioned it here, because I hope it could help to prevent confusion (if there is any).

Good luck. 🙂

Attachments

  • limits.gif
    Filename
    limits.gif
    File size
    17.36 KiB
    Views
    1007 views
    File comment
    drawn by myself
    File license
    Public domain

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 8 of 10, by zyzzle

User metadata
Rank Member
Rank
Member
debs3759 wrote on 2021-12-10, 01:53:

FAT16 doesn't define the number of cylinders. It can map a maximum of 65526 clusters, with a maximum cluster size of 32KB.

I know for sure that it's possible to use 64KB cluster size with FAT16. This allows about 4093M with the 65526 cluster limit as the max partition size limit.

Reply 9 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t
zyzzle wrote on 2021-12-10, 23:49:
debs3759 wrote on 2021-12-10, 01:53:

FAT16 doesn't define the number of cylinders. It can map a maximum of 65526 clusters, with a maximum cluster size of 32KB.

I know for sure that it's possible to use 64KB cluster size with FAT16. This allows about 4093M with the 65526 cluster limit as the max partition size limit.

It depends on your operating system. DOS and Windows 95/98/ME allows up to 32KB cluster size, whereas Windows NT/2000/XP (and possibly newer offsprings of that family) support 64KB cluster size.

Reply 10 of 10, by mkarcher

User metadata
Rank l33t
Rank
l33t
Jo22 wrote on 2021-12-10, 21:43:

http://donaldkenney.x10.mx/GLOSSARY/EXTENDED.HTM

Browsing a harddisk under DOS without using BIOS routines (INT13H)

Edit: Old, traditional CHS / Cylinders 0-1023 (1024 total), Heads 0-15 (16 total), Sectors 1-63 (63 total).

This limit (504MiB) is (as you describe in the bottom of your post) the result of the combination of the BIOS limits and the IDE limits. There is no single specification limiting both cylinders to 1023, heads to 15 and sectors to 63 at the same time. But if you pass sector, cylinder and hard numbers from the BIOS interface 1:1 to the IDE interface, the you are limited to 1024 cylinders and 63 sectors due toe the BIOS interface, and to 16 heads due to the IDE interface.

Jo22 wrote on 2021-12-10, 21:43:

Actual interpretation for input depends on BIOS/Setup Utility, afaik.
Some may oddly expect human values entered as written on the HDD label ("16" for 16 heads total vs "15"), but use the technical values internally ("15").

I've yet to see a BIOS that requires you to enter the "maximum head number" (15 in your example) instead of the head count (16 in your example), but I wouldn't be surprised if a setup utility like that exists.

To circumvent the 504MiB limit, there are two approaches, both requiring some kind of translation of the parameters given to the BIOS to different values given to the hard drive. Modern IDE BIOSes allow three kinds of handling the BIOS parameters:

  • NORMAL: No translation. Just pass the parameters as-is. You are still limited to 504MB
  • LARGE: Shift some bits from the head number (the BIOS allows for 255 heads) to the cylinder number. For drives between 500MB and 1GB, one bit is shifted (you get 32 heads (still at 1024 cylinders) on the BIOS interface, and up to 2048 cylinders (still at 16 heads) on the IDE interface); For drives between 1GB and 2GB, two bits are shifted (you get 64 heads (still at 1024 cylinders) on the BIOS interface and 4096 cylinders (still at 16 heads) on the IDE interface). For drives between 2GB and 4GB (if supported by the BIOS), three bits are shifted (you get 128 heads on the BIOS interface, and 8192 cylinders on the IDE interface). The classic LARGE mode shifts whole bits, so the next level would be translating 256 heads to 16 heads by shifting 4 bits, and as already discussed, we can't use 256 heads because a lot of software assumes that the head count fits into 8 bits, so LARGE essentially limits you to 4GB.
  • LBA: The bios does not communicate to the IDE drive using cylinders, heads and sectors at all. Instead, new IDE commands are used where the registers that were traditionally used to specify sector number (8 bits), cylinder number (16 bits) and head number (4 bits) are combined to a single 28-bit register and is interpreted as the number of sector on the drive, starting at 0, and then just counting no matter where track and head switches occur. This plain sector number is called "logical block address", and this also is how SCSI hard drives were addressed on the SCSI protocol level since SCSI 1. The BIOS calculates the logical block address from the parameters given to it (using the "fake geometry" it told the operating system), and then passes the block address to the hard drive. This mode is only works on hard drives supporting the new READ LBA and WRITE LBA commands. As this mode completely does away with the traditional IDE limits, it is only limited by the BIOS interface (8GB).

To circumevent the 8GB limit, you need a much more invasive change. The three modes discussed above work with DOS without DOS noticing, because the BIOS interface stays the same. But the BIOS interface is maxed out at 8GB, so a new interface had to be specified. The new interface that caught on is the Phoenix Enhanced Disk Drive specification, which is supported by Windows 95 in later OEM service releases and all versions Windows 98. This interface does away with C/H/S values on the interface between BIOS and DOS, and instead hands a 64-bit LBA value to the BIOS. As far as I know, this interface only works with hard drives supporting the LBA command set (which is mostly every IDE drive above 400 megabytes). Windows 9x only use the enhanced LBA calls to access data in partitions with "LBA-enabled" partition types. The partition type is only about how Windows talks to the hard drive, and even for non-LBA partitions, the BIOS might talk to the drive using logical block numbers, if the setup is set to "LBA".

Jo22 wrote on 2021-12-10, 21:43:

"Track 0" on HDDs/Floppies is a special case, also.
It contains boot code and isn't normally visible.
DOS utilities like S0kill can clear it, though.

No. For floppies, this is generally untrue. The first sector indeed contains the boot code, but already the second sector on the first track (cylinder 0, head 0) contains the first FAT sector on all classic DOS floppy formats. Yet, "Track 0" is special in the way that DOS format refuses to format a floppy if track 0 is bad. This is due to the fact that the boot sector, the FAT and the root directory are not relocatable on FAT12 floppies, so if one of the sectors that is supposed to contain these data structures is bad, DOS can't cope with the medium.

On hard drives, the situation is slightly different. Hard drives are partitioned. DOS does not access the hard drive as whole, but instead it accesses all (supported) partitions. Any space on the hard drive that is not part of a partition is not reachable using DOS interfaces - you need to resort to BIOS interfaces to access sectors that are not part of a partition. Partitions always start on "sector 1" on a track (by convention). The first sector of the hard drive contains the partition table, and describes where the partitions on the hard drive are located. The partition table can't be part of any partition itself. That's why cylinder 0, head 0, sector 1 (the first sector, LBA 0) can't be part of any partition. And as a partition needs to start at sector 1 of any track, the first partition can't start before cylinder 0, head 1, sector 1. The other sectors on cylinder 0, head 0 are indeed "invisible" to DOS.

Jo22 wrote on 2021-12-10, 21:43:

"Cylinders" is Fixed Disk (HDD) terminology.
"Tracks" is floppy disk terminology.
Software-wise, both refer to the same thing often, however.

Indeed. Often the terms are used interchangably. There is a clear definition that distinguishes these terms, though. This definition is unrelated to the medium being a floppy disk or a hard disk, though. A medium with more than one side (accessed using more than one head), is called to have a "track" on each side. Cylinder 0, head 0 is a different "track" than Cylinder 0, head 1. All of these "tracks" make up one "cylinder". The number of heads thus is the number of tracks per cylinder. A double-sided HD floppy thus has 160 "tracks". A track is identified by the cylinder number and the head number. The first track is the track at cylinder 0 you can accessed using head 0 (i.e. on the first side), whereas the last track is the track at cylinder 79 accessed using the last head (on floppies: head 1, second side). If you only consider a single surface / side, you only see a single track from each cylinder. So if you look at side 0 of this HD formatted floppy, you look at 80 tracks. If you look at side 1, you also look at 80 tracks. So you have two side of 80 tracks each. It thus also makes to talk about "track 79 on side 1" to mean the last track of the floppy, even if it is the 160th track. In short: If you talk about addressing, convetion is that you always explicitly specify the head, and count the tracks acessible through that head. So actually you are specifying cylinder numbers, even if you call it track numbers. Usually, you specify the number of tracks to specify what addresses are valid, so that's why you also say a floppy has "80 tracks", as the addresses range from cylinder number 0 to cylinder number 79. The one point where the track / cylinder distinction is important is when you talk about "sectors per track" versus "sectors per cylinder". A 3,5" HD floppy disk has 18 sectors per track. That is 18 sectors on head 0 and 18 sectors on head 1 of each cylinder, so 36 sectors per cylinder.