joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.53k stars 371 forks source link

Fix reported size issues in builtin DIR command #4973

Closed maxpat78 closed 2 months ago

maxpat78 commented 2 months ago

(tested WIN32 version only, with an 8TB VHDX drive)

Closes #4004 Closes #4258

Torinde commented 2 months ago

Great! I can't test that immediately - I'll report back when I can.

Torinde commented 2 months ago

Partial testing:

Haven't tested yet:

Can't test:

maxpat78 commented 2 months ago

@Torinde The free size is limited in other ways, as you can see: image

Perhaps I have to remove all that code?

For the SMB share, I created a network share on the same 8 TB VHDX I've mounted for the other test.

maxpat78 commented 2 months ago

Further notes for possible code reorganization: dos_programs.cpp: 1170ss (MOUNT -freesize) The intent is to create a "fake" FAT disk geometry and translate the free space in terms of it (it is expressed in clusters): at this time, no information is known about the real emulated disk!

localDrive::localDrive constructor takes these fake params, passed as uint16_t and uint8_t. Max possible size is 65535 clusters and, we know, DOS knows very little about 4Kn sectors or big (>32K) clusters...

In drives.h, struct allocation (member of localDrive) should perhaps be enhanced to 64-bit, to track modern disk quantities. Appropriate members (AllocationInfo, AllocationInfo32) should translate those sizes as needed by "real" DOS apps.

maxpat78 commented 2 months ago

@Torinde I made a newer commit https://github.com/maxpat78/dosbox-x/tree/cmd_dir_patch with artifacts to allow -freesize X with X>2048. Can you test them, extensively and intensively? Since I changed some uint_t* types, I would be certain that no side effects are introduced.

Torinde commented 2 months ago

Thanks, @maxpat78, I'll test it (but not immediately) and report back.