Skip to content
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

Fix reported size issues in builtin DIR command #4973

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

maxpat78
Copy link
Contributor

@maxpat78 maxpat78 commented Apr 19, 2024

  • when a SMB share is mounted to a drive letter, the correct free space is shown
  • -freesize switch is honored
  • also, it purges the 1919 MB freesize cap limit

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

Closes #4004
Closes #4258

- mounted a SMB share to a drive letter, the correct free space is shown
- purges the 1919 MB freesize cap limit
- -freesize switch is honored
(tested WIN32 version only)
Fix lowend build issues
Revert back unnecessary changes in AllocationInfo
@Torinde
Copy link
Contributor

Torinde commented Apr 19, 2024

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

@Torinde
Copy link
Contributor

Torinde commented Apr 20, 2024

Partial testing:

  • Reporting SMB free space - works (tested with below 1TB), but that worked also before, since Update drive_local.cpp #4255. Did you change something now?
  • mount ... -freesize ...
    image
    -- good: it goes beyond 1919MB/2GB
    -- wrong: there is a limit of 2047MB when a higher cap is specified
    -- strange: without cap it goes to almost the VHDX maximum, but File explorer shows bigger free space

Haven't tested yet:

  • convertdrivefat=true and convert fat free space (and booting MS-DOS 7.10)

Can't test:

  • SMB share with more than 2TB free

@maxpat78
Copy link
Contributor Author

@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.

@joncampbell123 joncampbell123 merged commit 70106c1 into joncampbell123:master Apr 22, 2024
20 checks passed
@maxpat78
Copy link
Contributor Author

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
Copy link
Contributor Author

@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
Copy link
Contributor

Torinde commented Apr 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants