fixes for disk sizing etc.

This commit is contained in:
bunnie 2025-09-08 09:52:53 +08:00
parent 00db7d108d
commit 0ed6ae30c3

View file

@ -66,12 +66,11 @@ pub unsafe fn init_usb() {
disk.fill(0);
// setup MBR
disk[..MBR_TEMPLATE.len()].copy_from_slice(&MBR_TEMPLATE);
/*
//set block size
disk[0xb..0xd].copy_from_slice(&SECTOR_SIZE.to_le_bytes());
//set storage size
crate::println!("storage size set to {}kiB", RAMDISK_LEN / 1024);
disk[0x20..0x24].copy_from_slice(&(RAMDISK_LEN as u32 / SECTOR_SIZE as u32).to_le_bytes());
*/
// populate an initial "windows-friendly" FAT layout, generated by plugging the empty disk
// into windows and letting it...do its thing, then snapshotting the data.
disk[TABLE_OFFSET_FAT1..TABLE_OFFSET_FAT1 + FAT_TABLE.len()].copy_from_slice(&FAT_TABLE);