Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

FAT fragmentation is not handled at all #1

Open
parasyte opened this issue Aug 19, 2014 · 0 comments
Open

FAT fragmentation is not handled at all #1

parasyte opened this issue Aug 19, 2014 · 0 comments
Labels

Comments

@parasyte
Copy link
Owner

When the file system on SD gets fragmented (by adding and removing small files) alt64 will be unable to read some files correctly, especially when loading ROMs. See:

alt64/menu.c

Lines 1315 to 1322 in 3ba0910

if(mb<=32){
resp = diskRead(begin_sector, (void *)0xb0000000, file_sectors); //2048 cluster 1Mb
}
else{
resp = diskRead(begin_sector, (void *)0xb0000000, lower_half);
sleep(10);
resp = diskRead(begin_sector+lower_half, (void *)0xb2000000, file_sectors-lower_half);
}

The issue is that the code assumes there is no fragmentation, so it just does a pure DMA from SD, starting with the first sector in the FAT.

A fragmented ROM will be read incorrectly, and usually will not boot. (Or it may boot and crash later, or have other strange errors.)

@parasyte parasyte added the bug label Aug 19, 2014
parasyte pushed a commit that referenced this issue Jun 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant