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

Reduce memory v2 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

arnout
Copy link

@arnout arnout commented Nov 27, 2014

Changes in v2:

  • Add a second patch that adds the -F option to not salvage files even if -a is given. Turns out that salvaging files allocates another total_cluster_bytes*sizeof(uint32_t), so I had to bypass that.
  • Fix whitespace (my editor isn't able to do the crazy tab+spaces combination).
  • Unmap the mmapped fs->fat when read_fat is called a second time.

By using mmap, we avoid allocating the entire FAT table, and we make it
possible for the OS to read in pages from the disk on demand only.

This option is only available in combination with -w, because any write
to the mmapped region may be written to disk at any time.

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771091

Limitations and possible improvements:
- Don't know if mmap is available with DJGPP.
- mmap could be used unconditionally if -w is given.
- The conditional handling could be moved to fs_read/fs_write.
- The same change would be useful in fatlabel and mkfs.fat.
This allows to override the automatic -f when -a is selected.
zuber147 added a commit to zuber147/dosfstools that referenced this pull request Oct 5, 2020
C program to find the greatest of two numbers
schmurtzm added a commit to OnionUI/Onion that referenced this pull request Jun 15, 2023
New:
- Add check disk step, important to avoid SD card FAT file system corruption.

Fixes:
- SD card mount point has changed on last firmware : fix available space on SD card.
- Don't resume OTA app after a forced reboot.

Issues :
- fsck.fat is based on last release for best compatbility. However it uses a lot of memory and could crash on big SD card. This PR is quite old but could improve this behaviour : dosfstools/dosfstools#2
github-merge-queue bot pushed a commit to OnionUI/Onion that referenced this pull request Jun 15, 2023
New:
- Add check disk step, important to avoid SD card FAT file system corruption.

Fixes:
- SD card mount point has changed on last firmware : fix available space on SD card.
- Don't resume OTA app after a forced reboot.

Issues :
- fsck.fat is based on last release for best compatbility. However it uses a lot of memory and could crash on big SD card. This PR is quite old but could improve this behaviour : dosfstools/dosfstools#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant