Click to expand FAT generation notes
Previously, code presumed that (other than firmware file) the existing files would have FAT entirely in first sector. This should now be fixed.
Generation of FAT uses much simpler method now, relying on the following properties:
1. All files are laid out contiguously, in order listed in table
2. No unused sectors between files
3. Last "file" is actually firmware (generated UF2)
New method of FAT generation is two steps:
1. Fill default value of CLUSTER+1 (or zero if past end of UF2) ... essentially make entire used FAT area a single, long, continuous FAT chain
2. Fill in the exceptions:
a. clusters 0 & 1 need special values
b. for each file, make end-of-FAT chain
That's it! Simpler, and avoids the edge cases....
.github/workflows/...
ports/test_ghostfat/boards/...
src/ghostfat.c
UF2_DIV_CEIL
-- avoid undefined behavior from overflow with signed inputsTextContent
toFileContent
to reflect ability to store binary filesClick to expand FAT generation notes
Previously, code presumed that (other than firmware file) the existing files would have FAT entirely in first sector. This should now be fixed. Generation of FAT uses much simpler method now, relying on the following properties: 1. All files are laid out contiguously, in order listed in table 2. No unused sectors between files 3. Last "file" is actually firmware (generated UF2) New method of FAT generation is two steps: 1. Fill default value of CLUSTER+1 (or zero if past end of UF2) ... essentially make entire used FAT area a single, long, continuous FAT chain 2. Fill in the exceptions: a. clusters 0 & 1 need special values b. for each file, make end-of-FAT chain That's it! Simpler, and avoids the edge cases....