Lines Matching refs:bpb
191 fn validate(&self, bpb: &BiosParameterBlock) -> Result<(), SystemError> { in validate()
192 if bpb.fat_size_16 != 0 { in validate()
197 if bpb.root_entries_cnt != 0 { in validate()
202 if bpb.total_sectors_16 != 0 { in validate()
234 let mut bpb = BiosParameterBlock::default(); in new() localVariable
236 cursor.read_exact(&mut bpb.jmp_boot)?; in new()
237 cursor.read_exact(&mut bpb.oem_name)?; in new()
238 bpb.bytes_per_sector = cursor.read_u16()?; in new()
239 bpb.sector_per_cluster = cursor.read_u8()?; in new()
240 bpb.rsvd_sec_cnt = cursor.read_u16()?; in new()
241 bpb.num_fats = cursor.read_u8()?; in new()
242 bpb.root_entries_cnt = cursor.read_u16()?; in new()
243 bpb.total_sectors_16 = cursor.read_u16()?; in new()
244 bpb.media = cursor.read_u8()?; in new()
245 bpb.fat_size_16 = cursor.read_u16()?; in new()
246 bpb.sector_per_track = cursor.read_u16()?; in new()
247 bpb.num_heads = cursor.read_u16()?; in new()
248 bpb.hidden_sectors = cursor.read_u32()?; in new()
249 bpb.total_sectors_32 = cursor.read_u32()?; in new()
270 bpb.trail_sig = cursor.read_u16()?; in new()
273 let root_sectors = ((bpb.root_entries_cnt as u32 * 32) + (bpb.bytes_per_sector as u32 - 1)) in new()
274 / (bpb.bytes_per_sector as u32); in new()
277 let fat_size = if bpb.fat_size_16 != 0 { in new()
278 bpb.fat_size_16 as u32 in new()
284 let total_sectors = if bpb.total_sectors_16 != 0 { in new()
285 bpb.total_sectors_16 as u32 in new()
287 bpb.total_sectors_32 in new()
292 - ((bpb.rsvd_sec_cnt as u32) + (bpb.num_fats as u32) * fat_size + root_sectors); in new()
294 let count_clusters = data_sectors / (bpb.sector_per_cluster as u32); in new()
297 bpb.fat_type = if count_clusters < FATFileSystem::FAT12_MAX_CLUSTER { in new()
309 bpb.validate()?; in new()
311 return Ok(bpb); in new()