FAT16 2G trivia (was: HH drives

From: Fred Cisin <cisin_at_xenosoft.com>
Date: Wed Apr 16 13:44:00 2003

> > If they're FAT16 (2.1Gb max recognition), maybe you can get hold of an

Would 65535 be considered to be 65.5K here?
How many bytes are in a K? M? G?

The maximum size for most FAT16 partitions is 2147483647, which is 2 to
the 31st power minus 1, or 2 HONEST Gigabytes (minus 1). The size limit
is due to the use in MS-DOS of a long int, which is a 32 bit signed
number. A long int has a range from -2147483648 to 2147483647. That was
an error; they should have used a UNSIGNED long int (0 to 4294967295)

The long int is also used for file size. Thus, for many versions of
MS-DOS, the range of file sizes is also -2147483648 to 2147483647. One
time, when the free space on one of my hard drives was getting sparse, I
took a floppy disk and stepped on one of the directory entries to give it
a reported file size of -2147483648. Then I tried to copy that negative 2
gig file to the hard drive. What effect should there be on free space if
you add a file with a negative size? It didn't work. What was even more
fun was trying to explain to the MICROS~1 "Beta team" management why
things like file size should be unsigned.


In NT (not sure if ALL versions), they switched from a long int to an
unsigned long int (which it should have been from the get go). Because of
that, a FAT16 partition in NT can be up to 2 to the 32nd power minus one,
4294967295, or FOUR HONEST/binary gigabytes (minus one byte). But those
partitions are only readable by NT, since MS-DOS (and WINDOZE9x) sees them
as having a negative size.

--
Grumpy Ol' Fred        cisin_at_xenosoft.com
Received on Wed Apr 16 2003 - 13:44:00 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:35:44 BST