Skip to content

Commit

Permalink
Merge pull request #165 from Graicc/develop
Browse files Browse the repository at this point in the history
Add support for partition id 04h
  • Loading branch information
thejpster authored Nov 15, 2024
2 parents 8a8d52c + ca9c9fa commit cad9505
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ const PARTITION_ID_FAT16_LBA: u8 = 0x0E;
/// Marker for a FAT16 partition. Seen on a card formatted with the official
/// SD-Card formatter.
const PARTITION_ID_FAT16: u8 = 0x06;
/// Marker for a FAT16 partition smaller than 32MB. Seen on the wowki simulated
/// microsd card
const PARTITION_ID_FAT16_SMALL: u8 = 0x04;
/// Marker for a FAT32 partition. What Macosx disk utility (and also SD-Card formatter?)
/// use.
const PARTITION_ID_FAT32_CHS_LBA: u8 = 0x0B;
Expand Down
5 changes: 3 additions & 2 deletions src/volume_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
},
trace, Block, BlockCache, BlockCount, BlockDevice, BlockIdx, Error, RawVolume, ShortFileName,
Volume, VolumeIdx, VolumeInfo, VolumeType, PARTITION_ID_FAT16, PARTITION_ID_FAT16_LBA,
PARTITION_ID_FAT32_CHS_LBA, PARTITION_ID_FAT32_LBA,
PARTITION_ID_FAT16_SMALL, PARTITION_ID_FAT32_CHS_LBA, PARTITION_ID_FAT32_LBA,
};

/// Wraps a block device and gives access to the FAT-formatted volumes within
Expand Down Expand Up @@ -195,7 +195,8 @@ where
PARTITION_ID_FAT32_CHS_LBA
| PARTITION_ID_FAT32_LBA
| PARTITION_ID_FAT16_LBA
| PARTITION_ID_FAT16 => {
| PARTITION_ID_FAT16
| PARTITION_ID_FAT16_SMALL => {
let volume = fat::parse_volume(&mut data.block_cache, lba_start, num_blocks)?;
let id = RawVolume(data.id_generator.generate());
let info = VolumeInfo {
Expand Down

0 comments on commit cad9505

Please sign in to comment.