Expand description
FAT32 module loader FAT32 module loader for reading userspace ELFs from boot partition.
Self-contained FAT32 parser with no external filesystem dependencies. Reads the BPB, follows cluster chains, parses directory entries (8.3 + LFN), and loads ELF modules into memory.
ยงSafety considerations
All unsafe blocks are confined to ELF memory copy and are documented.
The parser uses no global mutable state : all buffers are stack-local.
Structsยง
- Boot
Modules - Bpb ๐
- Cluster
Chain ๐Iter - Iterates over clusters in a chain, with cycle detection.
- DirEntry
- FatFs
- Module
Info - Short
Name ๐Display - Small stack-allocated buffer for displaying a short file name.
Enumsยง
- DirEntry
Name ๐
Constantsยง
- ATTR_
ARCHIVE ๐ - ATTR_
DIRECTORY ๐ - ATTR_
HIDDEN ๐ - ATTR_
LFN ๐ - ATTR_
READ_ ๐ONLY - ATTR_
SYSTEM ๐ - ATTR_
VOLUME_ ๐ID - DIR_
ENTRY_ ๐SIZE - FAT32_
EOC ๐ - MAX_
CLUSTER_ ๐CHAIN - Maximum cluster chain length to prevent infinite loops on corrupted FAT.
- MAX_
PATH_ ๐DEPTH - Maximum number of path components.
- MODULE_
DIR ๐ - MODULE_
NAMES ๐ - SECTOR_
SIZE ๐
Functionsยง
- is_
valid_ ๐elf - Validate that a buffer looks like a valid ELF header.
- load_
all_ modules - Load all boot modules from the FAT32 boot partition.
- load_
elf_ ๐from_ fat - Load an ELF from a directory entry into allocated memory.
- load_
module - Load a single module from FAT32.
- make_
sfn ๐ - Build an 8.3 short name from a string for comparison.