Skip to main content

Module fat32_loader

Module fat32_loader 

Source
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ยง

BootModules
Bpb ๐Ÿ”’
ClusterChainIter ๐Ÿ”’
Iterates over clusters in a chain, with cycle detection.
DirEntry
FatFs
ModuleInfo
ShortNameDisplay ๐Ÿ”’
Small stack-allocated buffer for displaying a short file name.

Enumsยง

DirEntryName ๐Ÿ”’

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.