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: incorrect setting of UD_ACLU when freeing a FAT chain #96

Merged
merged 2 commits into from
Mar 22, 2022

Conversation

Konamiman
Copy link
Owner

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.

When freeing a FAT chain (while deleting a file) the UD_ACLU value
of the unit descriptor, which holds the smaller free cluster number,
is updated to the smallest cluster number freed. The code doing this
had a bug and instead, a random memory address was modified; for
small cluster numbers this meant that the Nextor code itself was
overwritten and this caused the computer to crash. This commit
fixes that.
@Konamiman Konamiman added this to the v2.1.1 beta 2 milestone Jan 7, 2022
@Konamiman Konamiman self-assigned this Jan 7, 2022
@Konamiman Konamiman changed the base branch from v2.1 to v2.1.1-beta2 January 8, 2022 12:24
source/kernel/bank2/fat.mac Outdated Show resolved Hide resolved
@Konamiman Konamiman merged commit d4a182d into v2.1.1-beta2 Mar 22, 2022
@Konamiman Konamiman deleted the fix/bad_aclu_set_on_file_delete branch March 22, 2022 09:08
@Konamiman Konamiman mentioned this pull request Mar 22, 2022
Konamiman added a commit that referenced this pull request Mar 22, 2022
* Change the mechanism to access mounted files (#93)
* Fix: incorrect setting of UD_ACLU when freeing a FAT chain (#96)
* Add the CALL SYSTEM2 command in BASIC (#97)
* Add a new KILLDSKIO environment variable (#98)
* Update kernel version number to 2.1.1 beta 2 (#101)
vipoo pushed a commit to vipoo/Nextor that referenced this pull request Oct 4, 2023
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

2 participants