Skip to content

fix: accept both BPB sector count fields, valid NullTimeProvider date - #64

Merged
bugadani merged 1 commit into
masterfrom
fix/spec-compliance
Oct 23, 2026
Merged

bugadani merged 1 commit into
masterfrom
fix/spec-compliance

Conversation

@MabezDev

@MabezDev MabezDev commented May 1, 2026 •

Copy link
Copy Markdown
Owner
  • Accept volumes that set both total_sectors_16 and total_sectors_32. Reject only both zero.
  • NullTimeProvider returns 1980-01-01, not month 0 and day 0.

@MabezDev
MabezDev force-pushed the fix/spec-compliance branch 2 times, most recently from 0839278 to b3b0e5d Compare May 1, 2026 17:12
Comment thread embedded-fatfs/src/boot_sector.rs Outdated
if self.is_fat32() {
FsStatusFlags::decode(self.reserved_1)
} else {
// FAT12/FAT16 BPB does not carry status flags; they live in the FAT table

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude says FAT12 has no dirty flag at all, anywhere, so this comment is slightly off

Comment thread embedded-fatfs/src/fs.rs Outdated
}

pub(crate) async fn set_dirty_flag(&self, dirty: bool) -> Result<(), IO::Error> {
// FAT12/FAT16 BPB does not carry status flags; skip BPB write for non-FAT32

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude says: with this change, FAT16 has no dirty-flag persistence at all anymore. The spec-defined FAT16 mechanism (high bits of FAT entry 1) is not implemented as a replacement

…er date

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bugadani
bugadani force-pushed the fix/spec-compliance branch from b3b0e5d to e5e40fa Compare October 23, 2026 18:33
@bugadani bugadani changed the title fix: correct FAT spec compliance for status flags, sector count, and timestamps fix: accept both BPB sector count fields, valid NullTimeProvider date Oct 23, 2026
@bugadani
bugadani merged commit 98a824c into master Oct 23, 2026
4 checks passed
@bugadani
bugadani deleted the fix/spec-compliance branch October 23, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants