22
33#include <cstddef>
44#include "types.h"
5+ #include "format.h"
56
67// References:
78// exFAT: https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification
1011// Boot Sector.
1112typedef struct
1213{
13- u8 jumpBoot [3 ]; // {0xEB, 0x76, 0x90}.
14+ u8 jumpBoot [3 ]; // {0xEB, 0x76, 0x90}.
1415 char fileSystemName [8 ]; // "EXFAT ".
15- u8 mustBeZero [53 ];
16+ u8 mustBeZero [53 ];
1617 u64 partitionOffset ; // Arbitrary value or 0 = ignore this field.
1718 u64 volumeLength ; // Minimum "2^20 / 2^BytesPerSectorShift", maximum "2^64 - 1". If excess space sub-region size = 0 then max. is "ClusterHeapOffset + (2^32 - 11) * 2^SectorsPerClusterShift".
1819 u32 fatOffset ; // Minimum "24", maximum "ClusterHeapOffset - (FatLength * NumberOfFats)".
@@ -28,8 +29,8 @@ typedef struct
2829 u8 numberOfFats ; // "1" or "2" (TexFAT only).
2930 u8 driveSelect ; // Arbitrary value. Recommended 0x80.
3031 u8 percentInUse ; // 0-100 "percentage of allocated clusters in the Cluster Heap, rounded down to the nearest integer" or 0xFF if unknown.
31- u8 reserved [7 ];
32- u8 bootCode [390 ]; // Bootstrapping code or 0xF4 filled (x86 halt).
32+ u8 reserved [7 ];
33+ u8 bootCode [390 ]; // Bootstrapping code or 0xF4 filled (x86 halt).
3334 u16 bootSignature ; // 0xAA55.
3435 //u8 excessSpace[(1u<<bytesPerSectorShift) - 512];
3536} BootSector ;
@@ -38,10 +39,10 @@ static_assert(offsetof(BootSector, bootSignature) == 510, "Member bootSignature
3839// Extended Boot Sector.
3940/*typedef struct
4041{
41- u8 extendedBootCode[(1u<<bytesPerSectorShift) - 4];
42+ u8 extendedBootCode[(1u<<bytesPerSectorShift) - 4];
4243 u32 extendedBootSignature; // 0xAA550000.
4344} ExtendedBootSector;*/
4445
4546
4647
47- void calcFormatExFat (void ); // (const u64 totSec, FormatParams *const paramsOut)
48+ void calcFormatExFat (FormatParams & params );
0 commit comments