-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exploring hard disk size limits #239
Comments
Does this truncation happen even with |
No, it's in FDPP's disk init stage so only affects block devices. |
Although I don't know what would happen if I had a linux disks > 2TiB that dosemu would like to convert to fatfs. |
So I guess it is supposed to work, |
I suspect the drive is invalidated because of |
I am not actually sure. |
I agree if you are referring to dosemu's fatfs as that's only FAT16, but if you mean FAT in general then FAT32 can reach that size (just).
Disk containing one FAT32 partition of size (2TiB - 512B) is shared (either as dual boot with Windows or as removable drive moved between machines). On FDPP/FreeDOS that's seen as too big and geometry accessible is only 8GiB, but filesystem extends beyond that. I suppose that if DOS were to write a file that crossed the 8GiB boundary, it would only be able to write a portion of it. |
But 8Gb is CHS-mode limit. |
Yes I think it's a bug to switch from LBA to CHS just because the disk is too big. It probably came about because early LBA implementations were seen as buggy and if any geometry oddities were encountered it was thought safer to use the CHS. Remembering of course that when LBA came out there were no multi-terabyte disks, and such large values were preposterous. |
I don't know the technical pit-falls. |
Not sure how to use 64bit variables in FDPP, I get confused about what's 16bit code and what isn't. For instance I needed to change a printf('%d') for a ULONG parameter earlier and I expected to use '%ul' but the compiler showed me that ULONG is actually 'unsigned int'. In the ticket I linked earlier there was some discussion about needing 64bit math helpers for each compiler (Watcom / Gcc). Now I don't expect that's the case with FDPP as we don't use those 16bit compilers, but what is required to change a uint32_t to uint64_t? |
With MBR partitioning you only need "33-bit LBA" at most because your partition start / hidden sectors and partition / file system size are both limited to 32-bit each. There was a FreeDOS kernel patch by Tom Ehlert floating around that added GPT support however, in that case the lower-level (DOS drive to int 13h sectors layout) handling should support the full 64-bits. |
ULONG is a 32bit type. |
I hope at least the LBA subset of it, |
I'm playing with hard disk sizes on FDPP, as my interest was piqued because of issue FDOS/format#1. To test things I'm using a sparse image file, subsequently formatted using linux mkfs.fat as FAT32. I find that I can't quite get to 2 TiB filesystem size. I understand that we have to wrap the filesystem with an MBR/partition table, so the resultant disk size is slightly greater. As I increase the filesystem size towards the maximum theoretical size for FAT32 (2TiB - 512B) the error is less than graceful, boot fails as the disks partially get renumbered and ultimately command.com can't be found.
Results
(2TiB - 5*512B)
: boots fine, all space seems to be available(2TiB - 4*512B)
: fdpp falls back to CHS addressing, space limited to 8GiB, boot fails due to drive number confusion.The fall back to CHS addressing and geometry truncation to 8GiB seems to have been inherited from FreeDOS, which may have been fine when disks had physical geometry that could be relied upon, and now I'm wondering if there's a better way to handle this in Dosemu?
The text was updated successfully, but these errors were encountered: