|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cross-TU on-disk-layout enums and typedefs for the FAT/exFAT adapter. More...
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... | |
Variables | |
| uint8_t | g_fs_scratch [k_ra8_fs_sector_max] |
| Single max-sector scratch buffer reused across all I/O. | |
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.
Definition in file ra8_fs_fat_types_internal.h.
| 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.
| 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.
| enum ra8_fs_bpb_off_t : uint16_t |
Byte offsets inside a 512-byte BPB / boot sector.
Definition at line 47 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_cluster_t : uint32_t |
Reserved cluster numbers used by the FAT itself.
Definition at line 349 of file ra8_fs_fat_types_internal.h.
| 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.
| enum ra8_fs_dir_off_t : uint8_t |
Byte offsets inside a 32-byte FAT directory entry.
MS FAT spec sec 6.
Definition at line 66 of file ra8_fs_fat_types_internal.h.
| 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).
Definition at line 236 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_exfat_fmt_val_t : uint32_t |
Magic values + geometry constants used by the exFAT formatter.
Definition at line 260 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 167 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_exfat_val_t : uint32_t |
exFAT entry-type tags + small magic values used by the reader.
Definition at line 191 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 377 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_fmt_val_t : uint32_t |
Magic values + geometry limits used by the formatter (ra8_fs_format).
Definition at line 408 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 145 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_lfn_t : uint32_t |
LFN directory-entry field offsets, sequence masks, and reassembly caps.
Definition at line 514 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 322 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 128 of file ra8_fs_fat_types_internal.h.
| enum ra8_fs_misc_t : uint16_t |
Misc small constants used by parsing/formatting code.
Definition at line 458 of file ra8_fs_fat_types_internal.h.
| 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.
Definition at line 574 of file ra8_fs_fat_types_internal.h.
| 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.
| 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.
| 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.
Definition at line 818 of file ra8_fs_fat_types_internal.h.
| 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.
|
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.
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().