Skip to content

Commit cad9505

Browse files
authored
Merge pull request #165 from Graicc/develop
Add support for partition id 04h
2 parents 8a8d52c + ca9c9fa commit cad9505

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ const PARTITION_ID_FAT16_LBA: u8 = 0x0E;
420420
/// Marker for a FAT16 partition. Seen on a card formatted with the official
421421
/// SD-Card formatter.
422422
const PARTITION_ID_FAT16: u8 = 0x06;
423+
/// Marker for a FAT16 partition smaller than 32MB. Seen on the wowki simulated
424+
/// microsd card
425+
const PARTITION_ID_FAT16_SMALL: u8 = 0x04;
423426
/// Marker for a FAT32 partition. What Macosx disk utility (and also SD-Card formatter?)
424427
/// use.
425428
const PARTITION_ID_FAT32_CHS_LBA: u8 = 0x0B;

src/volume_mgr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::{
1717
},
1818
trace, Block, BlockCache, BlockCount, BlockDevice, BlockIdx, Error, RawVolume, ShortFileName,
1919
Volume, VolumeIdx, VolumeInfo, VolumeType, PARTITION_ID_FAT16, PARTITION_ID_FAT16_LBA,
20-
PARTITION_ID_FAT32_CHS_LBA, PARTITION_ID_FAT32_LBA,
20+
PARTITION_ID_FAT16_SMALL, PARTITION_ID_FAT32_CHS_LBA, PARTITION_ID_FAT32_LBA,
2121
};
2222

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

0 commit comments

Comments
 (0)