Skip to main content

Crate lamexfat

Crate lamexfat 

Source
Expand description

lamexfat — a no_std + alloc read-only exFAT filesystem reader for UEFI bootloaders.

exFAT is never on the UEFI ESP (always FAT32 by spec), so lamexfat serves removable/utility media — reading a kernel + initrd or a boot image off an exFAT-formatted USB stick or SD card, including the > 4 GiB payloads FAT32 cannot hold. The public surface mirrors lamxfs::Xfs / the lam* family, so a bootloader FsBackend adapter is a one-for-one mirror of the others.

Read-only by construction: there is no write path, allocator, or bitmap mutation. Every on-disk count/offset/cluster-chain is bounds- and cycle-checked, and ExFat::read caps its allocation at MAX_FILE_BYTES so a hostile DataLength cannot drive a denial-of-boot.

Clean-room status: the on-disk parsing is adapted from exfat-slim (github.com/ninjasource/exfat-slim, Apache-2.0) — see NOTICE and the per-file headers. New code is MIT OR Apache-2.0.

Structs§

DirEntry
A directory entry. name is the decoded (lossy-UTF-8) file name.
ExFat
A mounted, read-only exFAT volume.
Metadata
Inode-equivalent metadata from a directory entry set.
Path
A path within the volume, as raw bytes. Components are /-separated; empty components and . are ignored by the resolver, so /boot//vmlinuz and /boot/vmlinuz resolve identically. lamexfat does not own paths.

Enums§

EntryKind
The kind of a directory entry.
Error
A read or mount failure.
VbrReason
Why a boot sector / VBR was rejected.

Constants§

MAX_FILE_BYTES
Largest file ExFat::read will allocate up front. A hostile StreamExtension can declare a multi-GiB DataLength while occupying no clusters; this cap refuses the allocation rather than letting it abort the boot (mirrors lamboot’s MAX_BOOT_FILE_BYTES). ExFat::read_at streams into a caller-sized buffer and is unaffected.

Traits§

BlockRead
Block-level reads for a mounted volume.