Fix: incorrect setting of UD_ACLU when freeing a FAT chain #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nextor 2.1.1 Alpha 1 introduced a new mechanism to improve the performance of cluster chain allocation in large drives, by caching the value of the smallest free cluster number (#68 and #72).
There's however a problem. When freeing a FAT chain (while deleting a file) the value of the cached value in the unit descriptor of the drive is updated to the smallest cluster number freed, but the code doing this has a bug and instead, a random memory address is modified; for small cluster numbers this means that the Nextor code itself is overwritten and this caused the computer to crash.
This pull request fixes this problem. To test the fix, you can use an empty floppy/storage device (or an equivalent disk image in an emulator); creating and deleting a few files will end up causing a computer crash in Nextor 2.1.1 beta 1, which shouldn't happen when this fix is applied.