ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_fat_types_internal.h File Reference

Cross-TU on-disk-layout enums and typedefs for the FAT/exFAT adapter. More...

#include <stddef.h>
#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_fs.h"
Include dependency graph for ra8_fs_fat_types_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dir_walk_t
 Internal cursor used by the directory iterator. More...
struct  dir_loc_t
 Identifies the directory a lookup/scan should operate in. More...
struct  lfn_state_t
 In-progress reassembly of one LFN chain across the directory scan. More...
struct  dir_pos_t
 The on-disk address of one 32-byte directory slot. More...
struct  dir_slot_t
 A directory cursor that addresses one entry, not just one sector. More...
struct  dir_target_t
 One resolved directory entry: where it is, and what is in it. More...
struct  dir_insert_t
 Everything decided about a new directory entry before anything is written. More...
struct  exfat_cursor_t
 Linear cursor over a directory's 32-byte entries. More...
struct  exfat_dir_t
 Identifies the exFAT directory a lookup, scan or link operates in. More...
struct  exfat_setpos_t
 Directory position (cluster + entry index) of one 32-byte entry. More...
struct  ra8_fs_fmt_geom_t
 Computed on-disk geometry for one ra8_fs_format() run. More...

Enumerations

enum  ra8_fs_bpb_off_t : uint16_t {
  k_bpb_off_bytes_per_sec = 11 ,
  k_bpb_off_sec_per_clus = 13 ,
  k_bpb_off_rsvd_sec_cnt = 14 ,
  k_bpb_off_num_fats = 16 ,
  k_bpb_off_root_ent_cnt = 17 ,
  k_bpb_off_tot_sec_16 = 19 ,
  k_bpb_off_fat_sz_16 = 22 ,
  k_bpb_off_tot_sec_32 = 32 ,
  k_bpb_off_fat_sz_32 = 36 ,
  k_bpb_off_root_clus = 44 ,
  k_bpb_off_signature_lo = 510 ,
  k_bpb_off_signature_hi = 511
}
 Byte offsets inside a 512-byte BPB / boot sector. More...
enum  ra8_fs_dir_off_t : uint8_t {
  k_dir_off_name = 0 ,
  k_dir_off_attr = 11 ,
  k_dir_off_ntres = 12 ,
  k_dir_off_fst_clus_hi = 20 ,
  k_dir_off_fst_clus_lo = 26 ,
  k_dir_off_file_size = 28 ,
  k_dir_name_field_len = 11
}
 Byte offsets inside a 32-byte FAT directory entry. More...
enum  ra8_fs_ntres_t : uint8_t {
  k_ntres_base_lower = 0x08U ,
  k_ntres_ext_lower = 0x10U
}
 The two case flags Windows keeps in DIR_NTRes (byte 12). More...
enum  ra8_fs_dir_marker_t : uint8_t {
  k_dir_marker_free_perm = 0x00 ,
  k_dir_marker_free_used = 0xE5 ,
  k_dir_marker_kanji_e5 = 0x05 ,
  k_dir_marker_dot = 0x2E
}
 Special markers in DIR_Name[0]. More...
enum  ra8_fs_sig_t : uint8_t {
  k_bpb_sig_lo = 0x55 ,
  k_bpb_sig_hi = 0xAA
}
 Required boot-sector signature bytes (0x55 0xAA at off 510..511). More...
enum  ra8_fs_mbr_off_t : uint16_t {
  k_mbr_off_part0_type = 0x1C2U ,
  k_mbr_off_part0_lba = 0x1C6U ,
  k_mbr_part_entry_stride = 16U ,
  k_mbr_part_entry_count = 4U
}
 Byte offsets inside an MBR partition table (when LBA 0 is not a BPB). More...
enum  ra8_fs_gpt_t : uint16_t {
  k_gpt_part_type_protective = 0xEEU ,
  k_gpt_header_lba = 1U ,
  k_gpt_sig_len = 8U ,
  k_gpt_off_entry_lba = 0x48U ,
  k_gpt_off_entry_count = 0x50U ,
  k_gpt_off_entry_size = 0x54U ,
  k_gpt_entry_bytes = 128U ,
  k_gpt_entry_scan_max = 128U ,
  k_gpt_entry_off_first_lba = 0x20U ,
  k_gpt_guid_len = 16U
}
 GPT on-disk constants (UEFI spec 2.10 ch 5 "GUID Partition Table"). More...
enum  ra8_fs_exfat_off_t : uint16_t {
  k_exfat_off_fsname = 3 ,
  k_exfat_off_fat_lba = 0x50 ,
  k_exfat_off_fat_len = 0x54 ,
  k_exfat_off_heap_lba = 0x58 ,
  k_exfat_off_clus_count = 0x5C ,
  k_exfat_off_root_clus = 0x60 ,
  k_exfat_off_bps_shift = 0x6C ,
  k_exfat_off_spc_shift = 0x6D ,
  k_exfat_off_num_fats = 0x6E ,
  k_exfat_strm_off_flags = 1 ,
  k_exfat_strm_off_nlen = 3 ,
  k_exfat_strm_off_vlen_hi = 0x0C ,
  k_exfat_strm_off_clus = 0x14 ,
  k_exfat_strm_off_dlen = 0x18 ,
  k_exfat_strm_off_dlen_hi = 0x1C ,
  k_exfat_name_off = 2 ,
  k_exfat_upc_off_csum = 4
}
 Byte offsets in the exFAT boot sector (VBR) and directory entries. More...
enum  ra8_fs_exfat_val_t : uint32_t {
  k_exfat_entry_eod = 0x00U ,
  k_exfat_entry_bitmap = 0x81U ,
  k_exfat_entry_file = 0x85U ,
  k_exfat_entry_stream = 0xC0U ,
  k_exfat_entry_name = 0xC1U ,
  k_exfat_secflag_no_fat = 0x02U ,
  k_exfat_secflag_poss = 0x01U ,
  k_exfat_secflag_alloc = 0x03U ,
  k_exfat_attr_read_only = 0x01U ,
  k_exfat_attr_directory = 0x10U ,
  k_exfat_attr_archive = 0x20U ,
  k_exfat_fsname_len = 8U ,
  k_exfat_name_per_entry = 15U ,
  k_exfat_entry_bytes = 32U ,
  k_exfat_bps_shift_min = 9U ,
  k_exfat_bps_shift_max = 12U ,
  k_exfat_scan_limit = 65536U ,
  k_exfat_name_cap = 64U ,
  k_exfat_name_u8_cap = 193U ,
  k_exfat_upc_words = 2918U ,
  k_exfat_upc_run_tag = 0xFFFFU ,
  k_exfat_csum_hi_bit = 0x8000U ,
  k_exfat_off_file_secnt = 1U ,
  k_exfat_off_file_csum = 2U ,
  k_exfat_off_file_attr = 4U ,
  k_exfat_off_strm_hash = 4U ,
  k_exfat_off_strm_valid = 8U ,
  k_exfat_bit_mask = 7U ,
  k_exfat_bit_shift = 3U ,
  k_exfat_inuse_bit = 0x80U ,
  k_exfat_max_set_bytes = 224U ,
  k_exfat_path_depth = 32U ,
  k_exfat_dir_grow_max = 2U
}
 exFAT entry-type tags + small magic values used by the reader. More...
enum  ra8_fs_exfat_fmt_off_t : uint16_t {
  k_exfat_foff_jump = 0U ,
  k_exfat_foff_part_off = 64U ,
  k_exfat_foff_vol_len = 72U ,
  k_exfat_foff_serial = 100U ,
  k_exfat_foff_fs_rev = 104U ,
  k_exfat_foff_vol_flags = 106U ,
  k_exfat_foff_drive = 111U ,
  k_exfat_foff_percent = 112U ,
  k_exfat_foff_ext_sig = 508U ,
  k_exfat_foff_boot_sig = 510U ,
  k_exfat_de_second = 32U ,
  k_exfat_de_third = 64U ,
  k_exfat_de_first_clus = 20U ,
  k_exfat_de_data_len = 24U ,
  k_exfat_de_upc_csum = 4U ,
  k_exfat_de_lbl_cnt = 1U ,
  k_exfat_de_lbl_name = 2U
}
 VBR + directory-entry byte offsets written by the exFAT formatter. More...
enum  ra8_fs_exfat_fmt_val_t : uint32_t {
  k_exfat_entry_upcase = 0x82U ,
  k_exfat_entry_label = 0x83U ,
  k_exfat_fmt_jump0 = 0xEBU ,
  k_exfat_fmt_jump1 = 0x76U ,
  k_exfat_fmt_jump2 = 0x90U ,
  k_exfat_fmt_fs_rev = 0x0100U ,
  k_exfat_fmt_drive = 0x80U ,
  k_exfat_fmt_percent = 0U ,
  k_exfat_fmt_boot_sig = 0xAA55U ,
  k_exfat_fmt_ext_sig = 0xAA550000U ,
  k_exfat_fmt_fat_media = 0xFFFFFFF8U ,
  k_exfat_fmt_fat_eoc = 0xFFFFFFFFU ,
  k_exfat_fmt_first_clus = 2U ,
  k_exfat_fmt_num_fats = 1U ,
  k_exfat_fmt_boot_secs = 24U ,
  k_exfat_fmt_backup_lba = 12U ,
  k_exfat_fmt_ext_first = 1U ,
  k_exfat_fmt_ext_count = 8U ,
  k_exfat_fmt_oem_lba = 9U ,
  k_exfat_fmt_resv_lba = 10U ,
  k_exfat_fmt_csum_lba = 11U ,
  k_exfat_fmt_csum_skip0 = 106U ,
  k_exfat_fmt_csum_skip1 = 107U ,
  k_exfat_fmt_csum_skip2 = 112U ,
  k_exfat_fmt_csum_hibit = 0x80000000U ,
  k_exfat_fmt_min_sectors = 65536U ,
  k_exfat_fmt_thr_256m = 524288U ,
  k_exfat_fmt_thr_32g = 67108864U ,
  k_exfat_fmt_thr_256g = 536870912U ,
  k_exfat_fmt_clus_4k = 12U ,
  k_exfat_fmt_clus_32k = 15U ,
  k_exfat_fmt_clus_128k = 17U ,
  k_exfat_fmt_clus_256k = 18U ,
  k_exfat_fmt_geom_iters = 4U ,
  k_exfat_fmt_upc_std_bytes = 5836U ,
  k_exfat_fmt_part_align = 1048576U ,
  k_exfat_fmt_serial = 0x52A8E47AU ,
  k_exfat_fmt_label_max = 11U ,
  k_exfat_fmt_byte_bits = 8U ,
  k_exfat_fmt_byte_full = 0xFFU
}
 Magic values + geometry constants used by the exFAT formatter. More...
enum  ra8_fs_mbr_fmt_t : uint32_t {
  k_mbr_fmt_disk_sig_off = 440U ,
  k_mbr_fmt_part0_off = 446U ,
  k_mbr_fmt_pe_boot = 0U ,
  k_mbr_fmt_pe_chs_start = 1U ,
  k_mbr_fmt_pe_type = 4U ,
  k_mbr_fmt_pe_chs_end = 5U ,
  k_mbr_fmt_pe_lba = 8U ,
  k_mbr_fmt_pe_nsect = 12U ,
  k_mbr_fmt_boot_none = 0x00U ,
  k_mbr_fmt_type_exfat = 0x07U ,
  k_mbr_fmt_chs_heads = 255U ,
  k_mbr_fmt_chs_spt = 63U ,
  k_mbr_fmt_chs_max = 16450560U ,
  k_mbr_fmt_chs_ovf_h = 0xFEU ,
  k_mbr_fmt_chs_ovf_m = 0xFFU ,
  k_mbr_fmt_chs_ovf_l = 0xFFU ,
  k_mbr_fmt_chs_sec_mask = 0x3FU ,
  k_mbr_fmt_chs_cyl_hi_mask = 0x300U ,
  k_mbr_fmt_chs_cyl_hi_shift = 2U ,
  k_mbr_fmt_disk_sig_base = 0x1A2B3C4DU
}
 Byte offsets, field strides, and CHS constants for the MBR the exFAT formatter writes at LBA 0. More...
enum  ra8_fs_cluster_t : uint32_t {
  k_cluster_first_data = 2 ,
  k_cluster_eoc_min_fat12 = 0x0FF8 ,
  k_cluster_eoc_min_fat16 = 0xFFF8 ,
  k_cluster_eoc_min_fat32 = 0x0FFFFFF8 ,
  k_cluster_mask_fat32 = 0x0FFFFFFFU ,
  k_cluster_eoc_min_exfat = 0xFFFFFFF8U ,
  k_cluster_eoc_write_fat12 = 0x0FFF ,
  k_cluster_eoc_write_fat16 = 0xFFFF ,
  k_cluster_eoc_write_fat32 = 0x0FFFFFFFU ,
  k_cluster_eoc_write_exfat = 0xFFFFFFFFU ,
  k_cluster_free = 0 ,
  k_cluster_count_fat12_max = 4085 ,
  k_cluster_count_fat16_max = 65525 ,
  k_fat12_value_mask = 0x0FFFU ,
  k_fat12_low_nibble_mask = 0x000FU ,
  k_fat12_high_nibble_mask = 0xF000U
}
 Reserved cluster numbers used by the FAT itself. More...
enum  ra8_fs_fmt_off_t : uint16_t {
  k_fmt_off_jmp0 = 0 ,
  k_fmt_off_jmp1 = 1 ,
  k_fmt_off_jmp2 = 2 ,
  k_fmt_off_oem = 3 ,
  k_fmt_off_media = 21 ,
  k_fmt_off_sec_per_trk = 24 ,
  k_fmt_off_num_heads = 26 ,
  k_fmt_off_f16_drvnum = 36 ,
  k_fmt_off_f16_bootsig = 38 ,
  k_fmt_off_f16_volid = 39 ,
  k_fmt_off_f16_label = 43 ,
  k_fmt_off_f16_fstype = 54 ,
  k_fmt_off_f32_fsinfo = 48 ,
  k_fmt_off_f32_bkboot = 50 ,
  k_fmt_off_f32_drvnum = 64 ,
  k_fmt_off_f32_bootsig = 66 ,
  k_fmt_off_f32_volid = 67 ,
  k_fmt_off_f32_label = 71 ,
  k_fmt_off_f32_fstype = 82 ,
  k_fmt_fsi_off_lead = 0 ,
  k_fmt_fsi_off_struct = 484 ,
  k_fmt_fsi_off_free = 488 ,
  k_fmt_fsi_off_nxtfree = 492 ,
  k_fmt_fsi_off_trail = 508
}
 Extra BPB byte offsets written only by the formatter (ra8_fs_format). More...
enum  ra8_fs_fmt_val_t : uint32_t {
  k_fmt_jmp_byte0 = 0xEBU ,
  k_fmt_jmp_byte1 = 0x58U ,
  k_fmt_jmp_byte2 = 0x90U ,
  k_fmt_media_fixed = 0xF8U ,
  k_fmt_drvnum_hd = 0x80U ,
  k_fmt_ext_bootsig = 0x29U ,
  k_fmt_sec_per_trk = 63U ,
  k_fmt_num_heads = 255U ,
  k_fmt_num_fats = 2U ,
  k_fmt_root_ents_f16 = 512U ,
  k_fmt_resv_f16 = 1U ,
  k_fmt_resv_f32 = 32U ,
  k_fmt_root_clus_f32 = 2U ,
  k_fmt_fsinfo_sector = 1U ,
  k_fmt_bkboot_sector = 6U ,
  k_fmt_volid_base = 0x52A8D200U ,
  k_fmt_fsi_lead_sig = 0x41615252U ,
  k_fmt_fsi_struct_sig = 0x61417272U ,
  k_fmt_fsi_trail_sig = 0xAA550000U ,
  k_fmt_label_len = 11U ,
  k_fmt_spc_max = 64U ,
  k_fmt_zero_chunk_bytes = 16384U ,
  k_fmt_fat32_entry_bytes = 4U ,
  k_fmt_fat16_entry_bytes = 2U ,
  k_fmt_fat32_clus_cap = 0x0FFFFFF0U ,
  k_fmt_fsi_unknown = 0xFFFFFFFFU ,
  k_fmt_fat32_nxt_free = 3U ,
  k_fmt_f32_thr_260m = 532480U ,
  k_fmt_f32_thr_8g = 16777216U ,
  k_fmt_f32_thr_16g = 33554432U ,
  k_fmt_f32_thr_32g = 67108864U ,
  k_fmt_f32_clus_512b = 9U ,
  k_fmt_f32_clus_4k = 12U ,
  k_fmt_f32_clus_8k = 13U ,
  k_fmt_f32_clus_16k = 14U ,
  k_fmt_f32_clus_32k = 15U
}
 Magic values + geometry limits used by the formatter (ra8_fs_format). More...
enum  ra8_fs_misc_t : uint16_t {
  k_byte_mask = 0xFFU ,
  k_shift_byte = 8 ,
  k_shift_two_bytes = 16 ,
  k_shift_three_bytes = 24 ,
  k_shift_nibble = 4 ,
  k_shift_word32 = 32 ,
  k_nibble_mask = 0x0F ,
  k_byte_mask_full = 0xFF ,
  k_word_mask = 0xFFFFU ,
  k_max_8_3_name = 11 ,
  k_dot_pos = 8 ,
  k_filename_base_len = 8 ,
  k_filename_ext_len = 3 ,
  k_path_max = 64
}
 Misc small constants used by parsing/formatting code. More...
enum  ra8_fs_lfn_t : uint32_t {
  k_lfn_off_seq = 0U ,
  k_lfn_off_type = 12U ,
  k_lfn_off_checksum = 13U ,
  k_lfn_off_clus_lo = 26U ,
  k_lfn_seq_order_mask = 0x1FU ,
  k_lfn_seq_last = 0x40U ,
  k_lfn_chars_per_ent = 13U ,
  k_lfn_max_entries = 19U ,
  k_lfn_utf8_cap = 742U ,
  k_lfn_unicode_pad = 0xFFFFU ,
  k_sfn_csum_high_bit = 0x80U ,
  k_lfn_write_max = 247U ,
  k_lfn_erase_max = 20U ,
  k_lfn_alias_tail_max = 999999U ,
  k_lfn_alias_base_max = 6U
}
 LFN directory-entry field offsets, sequence masks, and reassembly caps. More...
enum  ra8_fs_name_kind_t : uint8_t {
  k_name_kind_invalid = 0U ,
  k_name_kind_short = 1U ,
  k_name_kind_long = 2U
}
 How a leaf component has to be stored in a FAT directory. More...
enum  exfat_set_const_t : uint32_t {
  k_exfat_set_max_entries = 19U ,
  k_exfat_set_writable = 7U ,
  k_exfat_set_min_entries = 3U
}
 Bounds on one exFAT directory entry set. More...
enum  ra8_fs_sec_role_t : uint8_t {
  k_fs_sec_role_walk = 0U ,
  k_fs_sec_role_fat = 1U ,
  k_fs_sec_role_fat2 = 2U ,
  k_fs_sec_role_io = 3U ,
  k_fs_sec_roles = 4U
}
 Index of each fixed-role sector buffer in the arena (#683). More...

Variables

uint8_t g_fs_scratch [k_ra8_fs_sector_max]
 Single max-sector scratch buffer reused across all I/O.

Detailed Description

Cross-TU on-disk-layout enums and typedefs for the FAT/exFAT adapter.

The TYPES half of the FAT/exFAT adapter's module-private declarations. It carries the on-disk-layout enums (BPB / directory / MBR / GPT / exFAT / formatter), the directory/format/exFAT cursor typedefs, and the one shared scratch-sector buffer. It is pulled in by the ra8_fs_fat_internal.h umbrella (and therefore by every ra8_fs_fat*.c file) and by the prototype sub-headers, whose helper declarations reference these types.

This header aggregates the module's on-disk-layout enums shared across the FAT translation units.

Since
0.1.0

Definition in file ra8_fs_fat_types_internal.h.

Enumeration Type Documentation

◆ exfat_set_const_t

enum exfat_set_const_t : uint32_t

Bounds on one exFAT directory entry set.

exFAT spec sec 7.4: a File entry carries a SecondaryCount, and the set is that many 32-byte entries plus the File entry itself. This adapter's name cap (k_exfat_name_cap, 64 UTF-16 units) needs one Stream entry plus ceil(64 / 15) Name entries, so k_exfat_set_writable is the largest set it can rewrite. k_exfat_set_max_entries is the largest the FORMAT allows and bounds the walk over a set some other implementation wrote.

Invariant
k_exfat_set_writable <= k_exfat_set_max_entries.
Example:
@ k_exfat_set_max_entries
1 File + 1 Stream + 17 Name entries.
Directory position (cluster + entry index) of one 32-byte entry.
See also
priv_exfat_find_set()
Since
0.1.0
Enumerator
k_exfat_set_max_entries 

1 File + 1 Stream + 17 Name entries.

k_exfat_set_writable 

1 File + 1 Stream + 5 Name (64 chars).

k_exfat_set_min_entries 

The smallest legal set: File+Stream+Name.

Definition at line 750 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_bpb_off_t

enum ra8_fs_bpb_off_t : uint16_t

Byte offsets inside a 512-byte BPB / boot sector.

Enumerator
k_bpb_off_bytes_per_sec 

MS FAT spec sec 3.1 "BPB_BytsPerSec".

k_bpb_off_sec_per_clus 

MS FAT spec sec 3.1 "BPB_SecPerClus".

k_bpb_off_rsvd_sec_cnt 

MS FAT spec sec 3.1 "BPB_RsvdSecCnt".

k_bpb_off_num_fats 

MS FAT spec sec 3.1 "BPB_NumFATs".

k_bpb_off_root_ent_cnt 

MS FAT spec sec 3.1 "BPB_RootEntCnt".

k_bpb_off_tot_sec_16 

MS FAT spec sec 3.1 "BPB_TotSec16".

k_bpb_off_fat_sz_16 

MS FAT spec sec 3.1 "BPB_FATSz16".

k_bpb_off_tot_sec_32 

MS FAT spec sec 3.1 "BPB_TotSec32".

k_bpb_off_fat_sz_32 

MS FAT spec sec 3.5 "BPB_FATSz32".

k_bpb_off_root_clus 

MS FAT spec sec 3.5 "BPB_RootClus".

k_bpb_off_signature_lo 

Boot sig byte 1 (0x55).

k_bpb_off_signature_hi 

Boot sig byte 2 (0xAA).

Definition at line 47 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_cluster_t

enum ra8_fs_cluster_t : uint32_t

Reserved cluster numbers used by the FAT itself.

Enumerator
k_cluster_first_data 

Cluster numbers start at 2.

k_cluster_eoc_min_fat12 

MS FAT spec sec 4.1 EOC threshold.

k_cluster_eoc_min_fat16 

MS FAT spec sec 4.1 EOC threshold.

k_cluster_eoc_min_fat32 

MS FAT spec sec 4.2 EOC threshold.

k_cluster_mask_fat32 

Top 4 bits reserved on FAT32.

k_cluster_eoc_min_exfat 

exFAT spec sec 4.1 EOC threshold.

k_cluster_eoc_write_fat12 

Value we write to terminate.

k_cluster_eoc_write_fat16 

Cluster eoc write fat16.

k_cluster_eoc_write_fat32 

Cluster eoc write fat32.

k_cluster_eoc_write_exfat 

exFAT spec sec 4.1 EOC marker.

k_cluster_free 

Cluster free.

k_cluster_count_fat12_max 

MS FAT spec sec 3.5 boundary.

k_cluster_count_fat16_max 

MS FAT spec sec 3.5 boundary.

k_fat12_value_mask 

12-bit FAT12 entry mask.

k_fat12_low_nibble_mask 

Untouched nibble (even cluster).

k_fat12_high_nibble_mask 

Untouched nibble (odd cluster).

Definition at line 349 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_dir_marker_t

enum ra8_fs_dir_marker_t : uint8_t

Special markers in DIR_Name[0].

MS FAT spec sec 6.

Enumerator
k_dir_marker_free_perm 

End-of-directory.

k_dir_marker_free_used 

Slot was used, deleted.

k_dir_marker_kanji_e5 

0xE5 in raw name, escaped.

k_dir_marker_dot 

'.

' – a "." / ".." entry.

Definition at line 101 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_dir_off_t

enum ra8_fs_dir_off_t : uint8_t

Byte offsets inside a 32-byte FAT directory entry.

MS FAT spec sec 6.

Enumerator
k_dir_off_name 

MS FAT spec sec 6 "DIR_Name" (11 bytes).

k_dir_off_attr 

MS FAT spec sec 6 "DIR_Attr".

k_dir_off_ntres 

MS FAT spec sec 6 "DIR_NTRes".

k_dir_off_fst_clus_hi 

MS FAT spec sec 6 "DIR_FstClusHI".

k_dir_off_fst_clus_lo 

MS FAT spec sec 6 "DIR_FstClusLO".

k_dir_off_file_size 

MS FAT spec sec 6 "DIR_FileSize".

k_dir_name_field_len 

8 + 3 raw chars (no dot).

Definition at line 66 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_exfat_fmt_off_t

enum ra8_fs_exfat_fmt_off_t : uint16_t

VBR + directory-entry byte offsets written by the exFAT formatter.

Companion to the reader's ra8_fs_exfat_off_t; covers the fields the reader never touches (boot signatures, serial, label entry, ...). Microsoft exFAT spec sections 3 (Main Boot Sector) and 7 (directory entries).

Enumerator
k_exfat_foff_jump 

JumpBoot (3 bytes).

k_exfat_foff_part_off 

PartitionOffset (64-bit).

k_exfat_foff_vol_len 

VolumeLength (64-bit).

k_exfat_foff_serial 

VolumeSerialNumber (32-bit).

k_exfat_foff_fs_rev 

FileSystemRevision (16-bit).

k_exfat_foff_vol_flags 

VolumeFlags (16-bit).

k_exfat_foff_drive 

DriveSelect.

k_exfat_foff_percent 

PercentInUse.

k_exfat_foff_ext_sig 

ExtendedBootSignature (extended sectors).

k_exfat_foff_boot_sig 

BootSignature 0xAA55 (16-bit).

k_exfat_de_second 

Offset of the 2nd dir entry in a set.

k_exfat_de_third 

Offset of the 3rd dir entry in a set.

k_exfat_de_first_clus 

Bitmap/Up-case entry: FirstCluster.

k_exfat_de_data_len 

Bitmap/Up-case entry: DataLength (64-bit).

k_exfat_de_upc_csum 

Up-case entry: TableChecksum (32-bit).

k_exfat_de_lbl_cnt 

Volume-label entry: CharacterCount.

k_exfat_de_lbl_name 

Volume-label entry: UTF-16 label.

Definition at line 236 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_exfat_fmt_val_t

enum ra8_fs_exfat_fmt_val_t : uint32_t

Magic values + geometry constants used by the exFAT formatter.

Enumerator
k_exfat_entry_upcase 

Up-case Table directory entry.

k_exfat_entry_label 

Volume Label directory entry.

k_exfat_fmt_jump0 

JumpBoot byte 0.

k_exfat_fmt_jump1 

JumpBoot byte 1.

k_exfat_fmt_jump2 

JumpBoot byte 2.

k_exfat_fmt_fs_rev 

FileSystemRevision = 1.00.

k_exfat_fmt_drive 

DriveSelect (first fixed disk).

k_exfat_fmt_percent 

PercentInUse = 0% (fresh volume).

k_exfat_fmt_boot_sig 

BootSignature (sector 0).

k_exfat_fmt_ext_sig 

ExtendedBootSignature (sectors 1-8).

k_exfat_fmt_fat_media 

FatEntry[0] media descriptor.

k_exfat_fmt_fat_eoc 

FatEntry end-of-chain.

k_exfat_fmt_first_clus 

First cluster of the heap.

k_exfat_fmt_num_fats 

exFAT uses a single FAT.

k_exfat_fmt_boot_secs 

12 main + 12 backup boot sectors.

k_exfat_fmt_backup_lba 

Backup boot region start.

k_exfat_fmt_ext_first 

First extended boot sector.

k_exfat_fmt_ext_count 

Extended boot sector count.

k_exfat_fmt_oem_lba 

OEM Parameters sector.

k_exfat_fmt_resv_lba 

Reserved sector.

k_exfat_fmt_csum_lba 

Boot Checksum sector.

k_exfat_fmt_csum_skip0 

Checksum-excluded byte: VolumeFlags.

k_exfat_fmt_csum_skip1 

Checksum-excluded byte: VolumeFlags.

k_exfat_fmt_csum_skip2 

Checksum-excluded byte: PercentInUse.

k_exfat_fmt_csum_hibit 

Rotate-right wrap bit (32-bit).

k_exfat_fmt_min_sectors 

Smallest exFAT volume: 32 MiB.

k_exfat_fmt_thr_256m 

<= 256 MB -> 4 KB clusters.

k_exfat_fmt_thr_32g 

<= 32 GB -> 32 KB clusters.

k_exfat_fmt_thr_256g 

<= 256 GB -> 128 KB clusters.

k_exfat_fmt_clus_4k 

log2 cluster BYTES for 4 KB clusters.

k_exfat_fmt_clus_32k 

... 32 KB.

k_exfat_fmt_clus_128k 

... 128 KB.

k_exfat_fmt_clus_256k 

... 256 KB (> 256 GB cards).

k_exfat_fmt_geom_iters 

Fixed-point geometry passes.

k_exfat_fmt_upc_std_bytes 

Canonical Microsoft up-case table len.

k_exfat_fmt_part_align 

exFAT partition alignment: 1 MiB.

k_exfat_fmt_serial 

Arbitrary volume-serial base.

k_exfat_fmt_label_max 

Volume-label cap (UTF-16 units).

k_exfat_fmt_byte_bits 

Bits per bitmap byte.

k_exfat_fmt_byte_full 

A fully-allocated bitmap byte.

Definition at line 260 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_exfat_off_t

enum ra8_fs_exfat_off_t : uint16_t

Byte offsets in the exFAT boot sector (VBR) and directory entries.

exFAT (Microsoft exFAT spec) replaces the FAT BPB with a Volume Boot Record carrying sector-relative region offsets and log2 geometry. The directory uses 32-byte typed entry sets (File 0x85 + Stream 0xC0 + Name 0xC1) with UTF-16LE names. Read-only support; fields are little-endian.

Enumerator
k_exfat_off_fsname 

"EXFAT " filesystem-name field (8 chars).

k_exfat_off_fat_lba 

FatOffset (sectors from VBR).

k_exfat_off_fat_len 

FatLength (sectors).

k_exfat_off_heap_lba 

ClusterHeapOffset (sectors from VBR).

k_exfat_off_clus_count 

ClusterCount.

k_exfat_off_root_clus 

FirstClusterOfRootDirectory.

k_exfat_off_bps_shift 

BytesPerSectorShift (log2).

k_exfat_off_spc_shift 

SectorsPerClusterShift (log2).

k_exfat_off_num_fats 

NumberOfFats.

k_exfat_strm_off_flags 

Stream-ext GeneralSecondaryFlags.

k_exfat_strm_off_nlen 

Stream-ext NameLength (UTF-16 units).

k_exfat_strm_off_vlen_hi 

Stream-ext ValidDataLength high word.

k_exfat_strm_off_clus 

Stream-ext FirstCluster.

k_exfat_strm_off_dlen 

Stream-ext DataLength (low 32 used).

k_exfat_strm_off_dlen_hi 

Stream-ext DataLength high word.

k_exfat_name_off 

File-name entry character offset.

k_exfat_upc_off_csum 

Up-case-table entry TableChecksum (32-bit).

Definition at line 167 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_exfat_val_t

enum ra8_fs_exfat_val_t : uint32_t

exFAT entry-type tags + small magic values used by the reader.

Enumerator
k_exfat_entry_eod 

End-of-directory marker.

k_exfat_entry_bitmap 

Allocation-bitmap directory entry.

k_exfat_entry_file 

File directory entry.

k_exfat_entry_stream 

Stream-extension entry.

k_exfat_entry_name 

File-name entry.

k_exfat_secflag_no_fat 

GeneralSecondaryFlags: NoFatChain.

k_exfat_secflag_poss 

GeneralSecondaryFlags: AllocationPossible.

k_exfat_secflag_alloc 

AllocationPossible | NoFatChain.

k_exfat_attr_read_only 

FileAttributes: read-only.

k_exfat_attr_directory 

FileAttributes: directory.

k_exfat_attr_archive 

FileAttributes: archive.

k_exfat_fsname_len 

"EXFAT " field length.

k_exfat_name_per_entry 

UTF-16 units per file-name entry.

k_exfat_entry_bytes 

Directory entry size.

k_exfat_bps_shift_min 

log2(512): smallest BytesPerSectorShift.

k_exfat_bps_shift_max 

log2(4096): largest BytesPerSectorShift.

k_exfat_scan_limit 

Max dir entries scanned (P10 bound).

k_exfat_name_cap 

Longest name we store, in UTF-16 units.

k_exfat_name_u8_cap 

That name in UTF-8: 3 * 64, plus a NUL.

k_exfat_upc_words 

k_exfat_fmt_upc_std_bytes / 2.

k_exfat_upc_run_tag 

Up-case table: an identity run follows.

k_exfat_csum_hi_bit 

Wrap bit for the rotate-add checksum.

k_exfat_off_file_secnt 

File entry: SecondaryCount.

k_exfat_off_file_csum 

File entry: SetChecksum (2 bytes).

k_exfat_off_file_attr 

File entry: FileAttributes (2 bytes).

k_exfat_off_strm_hash 

Stream entry: NameHash (2 bytes).

k_exfat_off_strm_valid 

Stream entry: ValidDataLength (8 B).

k_exfat_bit_mask 

Bit index within a bitmap byte.

k_exfat_bit_shift 

log2(8): cluster index -> byte.

k_exfat_inuse_bit 

Directory entry type bit 7 = in use.

k_exfat_max_set_bytes 

(2 + ceil(64/15)) * 32 = 7 entries.

k_exfat_path_depth 

Max nested components per exFAT path.

k_exfat_dir_grow_max 

Max clusters one find-space call appends.

Definition at line 191 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_fmt_off_t

enum ra8_fs_fmt_off_t : uint16_t

Extra BPB byte offsets written only by the formatter (ra8_fs_format).

Complements ra8_fs_bpb_off_t (the read path) with the boot-prologue, media, extended-signature, label, and filesystem-type fields that the mount path never reads but a valid on-disk volume must carry. Offsets follow Microsoft "FAT: General Overview of On-Disk Format" sec 3.

Enumerator
k_fmt_off_jmp0 

Jump-boot byte 0 (0xEB).

k_fmt_off_jmp1 

Jump-boot byte 1 (offset).

k_fmt_off_jmp2 

Jump-boot byte 2 (0x90 NOP).

k_fmt_off_oem 

OEM name field (8 bytes).

k_fmt_off_media 

BPB_Media descriptor.

k_fmt_off_sec_per_trk 

BPB_SecPerTrk.

k_fmt_off_num_heads 

BPB_NumHeads.

k_fmt_off_f16_drvnum 

FAT12/16 BS_DrvNum.

k_fmt_off_f16_bootsig 

FAT12/16 BS_BootSig (0x29).

k_fmt_off_f16_volid 

FAT12/16 BS_VolID (4 bytes).

k_fmt_off_f16_label 

FAT12/16 BS_VolLab (11 bytes).

k_fmt_off_f16_fstype 

FAT12/16 BS_FilSysType (8 bytes).

k_fmt_off_f32_fsinfo 

FAT32 BPB_FSInfo sector number.

k_fmt_off_f32_bkboot 

FAT32 BPB_BkBootSec (backup boot).

k_fmt_off_f32_drvnum 

FAT32 BS_DrvNum.

k_fmt_off_f32_bootsig 

FAT32 BS_BootSig (0x29).

k_fmt_off_f32_volid 

FAT32 BS_VolID (4 bytes).

k_fmt_off_f32_label 

FAT32 BS_VolLab (11 bytes).

k_fmt_off_f32_fstype 

FAT32 BS_FilSysType (8 bytes).

k_fmt_fsi_off_lead 

FSInfo FSI_LeadSig offset.

k_fmt_fsi_off_struct 

FSInfo FSI_StrucSig offset.

k_fmt_fsi_off_free 

FSInfo FSI_Free_Count offset.

k_fmt_fsi_off_nxtfree 

FSInfo FSI_Nxt_Free offset.

k_fmt_fsi_off_trail 

FSInfo FSI_TrailSig offset.

Definition at line 377 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_fmt_val_t

enum ra8_fs_fmt_val_t : uint32_t

Magic values + geometry limits used by the formatter (ra8_fs_format).

Enumerator
k_fmt_jmp_byte0 

Short jump opcode.

k_fmt_jmp_byte1 

Jump displacement (to +0x5A).

k_fmt_jmp_byte2 

NOP padding.

k_fmt_media_fixed 

Media descriptor: non-removable.

k_fmt_drvnum_hd 

BS_DrvNum: first fixed disk.

k_fmt_ext_bootsig 

Extended boot signature present.

k_fmt_sec_per_trk 

Conventional CHS sectors/track.

k_fmt_num_heads 

Conventional CHS heads.

k_fmt_num_fats 

Two FAT copies, like every mkfs.

k_fmt_root_ents_f16 

FAT12/16 root-directory entries.

k_fmt_resv_f16 

FAT12/16 reserved (boot) sectors.

k_fmt_resv_f32 

FAT32 reserved sectors.

k_fmt_root_clus_f32 

FAT32 root directory cluster.

k_fmt_fsinfo_sector 

FAT32 FSInfo sector LBA.

k_fmt_bkboot_sector 

FAT32 backup boot sector LBA.

k_fmt_volid_base 

Arbitrary volume-serial base.

k_fmt_fsi_lead_sig 

FSInfo lead signature "RRaA".

k_fmt_fsi_struct_sig 

FSInfo struct signature "rrAa".

k_fmt_fsi_trail_sig 

FSInfo trailing signature.

k_fmt_label_len 

Volume-label field width (bytes).

k_fmt_spc_max 

Largest sectors-per-cluster we set.

k_fmt_zero_chunk_bytes 

Zero-fill bounce buffer size.

k_fmt_fat32_entry_bytes 

Bytes per FAT32 FAT entry.

k_fmt_fat16_entry_bytes 

Bytes per FAT16 (and FAT12-sizing) entry.

k_fmt_fat32_clus_cap 

Max FAT32 cluster count we accept.

k_fmt_fsi_unknown 

FSInfo free-count "unknown".

k_fmt_fat32_nxt_free 

First allocatable FAT32 cluster.

k_fmt_f32_thr_260m 

<= 260 MB -> 512 B clusters.

k_fmt_f32_thr_8g 

<= 8 GB -> 4 KB clusters.

k_fmt_f32_thr_16g 

<= 16 GB -> 8 KB clusters.

k_fmt_f32_thr_32g 

<= 32 GB -> 16 KB clusters.

k_fmt_f32_clus_512b 

log2(512): <= 260 MB cards.

k_fmt_f32_clus_4k 

log2(4 KB): <= 8 GB cards.

k_fmt_f32_clus_8k 

log2(8 KB): <= 16 GB cards.

k_fmt_f32_clus_16k 

log2(16 KB): <= 32 GB cards.

k_fmt_f32_clus_32k 

log2(32 KB): > 32 GB cards.

Definition at line 408 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_gpt_t

enum ra8_fs_gpt_t : uint16_t

GPT on-disk constants (UEFI spec 2.10 ch 5 "GUID Partition Table").

A GPT disk carries a protective MBR (partition 0 type 0xEE), the GPT header at LBA 1 ("EFI PART"), and a partition entry array (128-byte entries). FAT/exFAT data volumes live in entries whose type GUID is Microsoft Basic Data; macOS additionally creates an EFI System Partition first, which must be skipped to reach the user volume.

Enumerator
k_gpt_part_type_protective 

MBR type byte for a GPT disk.

k_gpt_header_lba 

GPT header location.

k_gpt_sig_len 

"EFI PART" signature length.

k_gpt_off_entry_lba 

Entry-array first LBA (8 bytes LE).

k_gpt_off_entry_count 

Number of partition entries.

k_gpt_off_entry_size 

Bytes per partition entry.

k_gpt_entry_bytes 

Standard entry size supported.

k_gpt_entry_scan_max 

Bounded entry walk (UEFI minimum).

k_gpt_entry_off_first_lba 

Entry: first LBA (8 bytes LE).

k_gpt_guid_len 

Type-GUID length in an entry.

Definition at line 145 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_lfn_t

enum ra8_fs_lfn_t : uint32_t

LFN directory-entry field offsets, sequence masks, and reassembly caps.

Enumerator
k_lfn_off_seq 

Sequence/order byte (LDIR_Ord).

k_lfn_off_type 

LDIR_Type – zero for a name component.

k_lfn_off_checksum 

Checksum of the matching 8.3 name.

k_lfn_off_clus_lo 

LDIR_FstClusLO – must be written as 0.

k_lfn_seq_order_mask 

Order = seq & 0x1F (1..20).

k_lfn_seq_last 

Set on the last logical group.

k_lfn_chars_per_ent 

UTF-16 chars carried per LFN entry.

k_lfn_max_entries 

Cap so 19*13 = 247 chars fits the buffer.

k_lfn_utf8_cap 

A 247-unit name in UTF-8: 3 * 247, + NUL.

k_lfn_unicode_pad 

Slot padding past the name terminator.

k_sfn_csum_high_bit 

Rotate-in bit when the running sum is odd.

k_lfn_write_max 

Longest name we WRITE (k_lfn_max_entries).

k_lfn_erase_max 

Longest chain we ERASE (spec LDIR_Ord max).

k_lfn_alias_tail_max 

Highest ~N probed by the alias generator.

k_lfn_alias_base_max 

Basis chars kept ahead of a one-digit ~N.

Definition at line 514 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_mbr_fmt_t

enum ra8_fs_mbr_fmt_t : uint32_t

Byte offsets, field strides, and CHS constants for the MBR the exFAT formatter writes at LBA 0.

A PC expects removable media to carry a partition table, not a "superfloppy" volume at sector 0. The exFAT formatter therefore lays a classic DOS/MBR partition table (disk signature at 440, one primary partition entry at 446, the 0x55AA boot signature) with a single type-0x07 (exFAT/NTFS) partition aligned at ::k_exfat_fmt_part_lba. The legacy CHS fields are filled from the conventional 255-head / 63-sector geometry (or the 0xFE/0xFF/0xFF "beyond CHS, use LBA" sentinel above k_mbr_fmt_chs_max) so fdisk/sfdisk report the partition without a CHS-mismatch warning.

Enumerator
k_mbr_fmt_disk_sig_off 

MBR disk signature (4 bytes LE).

k_mbr_fmt_part0_off 

First partition-table entry.

k_mbr_fmt_pe_boot 

Entry: boot flag (relative).

k_mbr_fmt_pe_chs_start 

Entry: start CHS (3 bytes).

k_mbr_fmt_pe_type 

Entry: partition type byte.

k_mbr_fmt_pe_chs_end 

Entry: end CHS (3 bytes).

k_mbr_fmt_pe_lba 

Entry: first LBA (4 bytes LE).

k_mbr_fmt_pe_nsect 

Entry: sector count (4 bytes LE).

k_mbr_fmt_boot_none 

Non-bootable partition.

k_mbr_fmt_type_exfat 

Partition type: exFAT/NTFS/HPFS.

k_mbr_fmt_chs_heads 

Conventional heads-per-cylinder.

k_mbr_fmt_chs_spt 

Conventional sectors-per-track.

k_mbr_fmt_chs_max 

1024*255*63: first LBA past CHS.

k_mbr_fmt_chs_ovf_h 

Overflow CHS head byte.

k_mbr_fmt_chs_ovf_m 

Overflow CHS sector/cyl-hi byte.

k_mbr_fmt_chs_ovf_l 

Overflow CHS cylinder-low byte.

k_mbr_fmt_chs_sec_mask 

Low 6 bits of the CHS sector byte.

k_mbr_fmt_chs_cyl_hi_mask 

Cylinder bits [9:8] before packing.

k_mbr_fmt_chs_cyl_hi_shift 

Shift packing cyl[9:8] into bits[7:6].

k_mbr_fmt_disk_sig_base 

Arbitrary disk-signature base.

Definition at line 322 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_mbr_off_t

enum ra8_fs_mbr_off_t : uint16_t

Byte offsets inside an MBR partition table (when LBA 0 is not a BPB).

A standard SD card is MBR-partitioned: LBA 0 holds a partition table (four 16-byte entries starting at 0x1BE) and the FAT boot sector lives at the partition's first LBA. Entry 0's type and first-LBA are named directly; entries 1-3 are reached by adding k_mbr_part_entry_stride, so the auto path (partition 0) and ra8_fs_mount_partition (any of 0-3) share one set of offsets.

Enumerator
k_mbr_off_part0_type 

Partition 0 type byte (0 = unused).

k_mbr_off_part0_lba 

Partition 0 first-LBA (4 bytes, LE).

k_mbr_part_entry_stride 

Bytes between primary partition entries.

k_mbr_part_entry_count 

Primary partition entries in an MBR.

Definition at line 128 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_misc_t

enum ra8_fs_misc_t : uint16_t

Misc small constants used by parsing/formatting code.

Enumerator
k_byte_mask 

Byte mask.

k_shift_byte 

Shift byte.

k_shift_two_bytes 

Shift two bytes.

k_shift_three_bytes 

Shift three bytes.

k_shift_nibble 

Shift nibble.

k_shift_word32 

Shift a whole 32-bit word (u64 halves).

k_nibble_mask 

Nibble mask.

k_byte_mask_full 

Byte mask full.

k_word_mask 

Word mask.

k_max_8_3_name 

8.3 packed length without dot.

k_dot_pos 

In an 8.3 packed name, dot would go here.

k_filename_base_len 

Filename base length.

k_filename_ext_len 

Filename ext length.

k_path_max 

Path maximum.

Definition at line 458 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_name_kind_t

enum ra8_fs_name_kind_t : uint8_t

How a leaf component has to be stored in a FAT directory.

Three answers, because there are three on-disk shapes: a name that is already an 8.3 name occupies one slot; a name that differs from one only in case occupies one slot plus a DIR_NTRes bit; and anything else needs a VFAT chain plus a generated ~N alias. The distinction is made once, by priv_name_classify(), so that open, mkdir and rename cannot disagree about it.

Invariant
k_name_kind_short implies the packed 8.3 output is valid.
See also
priv_name_classify()
Since
0.1.0
Enumerator
k_name_kind_invalid 

Empty, over-long, or holds an illegal character.

k_name_kind_short 

Fits 8.3; store one entry (+ NTRes case bits).

k_name_kind_long 

Needs a VFAT chain and a generated ~N alias.

Definition at line 574 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_ntres_t

enum ra8_fs_ntres_t : uint8_t

The two case flags Windows keeps in DIR_NTRes (byte 12).

A name that differs from its 8.3 form only by being lower case needs no long-name chain at all: the entry stores the upper-case form and sets one or both of these bits, and every reader that knows them renders data.log rather than DATA.LOG. The bits are not in the Microsoft FAT specification's field table – it reserves the byte – but they are what every Windows, Linux and macOS driver writes and reads, so they are the interoperable encoding.

Invariant
The two bits are independent; either, both, or neither may be set.
See also
priv_name_classify()
Since
0.1.0
Enumerator
k_ntres_base_lower 

Render DIR_Name[0..7] lower case.

k_ntres_ext_lower 

Render DIR_Name[8..10] lower case.

Definition at line 92 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_sec_role_t

enum ra8_fs_sec_role_t : uint8_t

Index of each fixed-role sector buffer in the arena (#683).

One row per role in the discipline documented in ra8_fs_fat_bytes_internal.h; k_fs_sec_roles sizes the backing array.

Invariant
k_fs_sec_roles is the count of role rows above it.
See also
priv_sec_walk()
Since
0.1.0
Enumerator
k_fs_sec_role_walk 

Directory scans and entry read-modify-write.

k_fs_sec_role_fat 

The sector holding a FAT entry.

k_fs_sec_role_fat2 

FAT12 straddle: the following sector.

k_fs_sec_role_io 

Leaf data / bitmap sector transfers.

k_fs_sec_roles 

Arena row count.

Definition at line 818 of file ra8_fs_fat_types_internal.h.

◆ ra8_fs_sig_t

enum ra8_fs_sig_t : uint8_t

Required boot-sector signature bytes (0x55 0xAA at off 510..511).

Enumerator
k_bpb_sig_lo 

Bpb sig lo.

k_bpb_sig_hi 

Bpb sig hi.

Definition at line 112 of file ra8_fs_fat_types_internal.h.

Variable Documentation

◆ g_fs_scratch

uint8_t g_fs_scratch[k_ra8_fs_sector_max]
extern

Single max-sector scratch buffer reused across all I/O.

Shared by every FAT/exFAT translation unit; declared extern in ra8_fs_fat_internal.h and defined here exactly once. Sized to k_ra8_fs_sector_max so a 4Kn medium fits without allocation.

One module-wide bounce buffer for every BPB, FAT, directory, and data-sector access. Sized to k_ra8_fs_sector_max so a 4Kn medium fits; a 512-byte mount simply uses the first quarter. Defined once in ra8_fs_fat_mount.c.

Note
Not reentrant; the adapter is single-threaded by contract.
Warning
Do not access concurrently; callers serialise all FS operations.
Since
0.1.0

Definition at line 40 of file ra8_fs_fat_mount.c.

Referenced by internal_exfat_write_bitmap(), internal_exfat_write_boot(), internal_exfat_write_boot_tail(), internal_exfat_write_fat(), internal_exfat_write_mbr(), internal_exfat_write_root(), internal_fmt_seed_fats(), internal_fmt_write_fsinfo(), internal_gpt_read_geom(), internal_gpt_scan_entries(), internal_locate_indexed(), internal_read_boot_sector(), priv_exfat_write_upcase(), priv_gpt_locate_partition(), priv_parse_bpb_into_mount(), and priv_parse_volume().