miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
fat32.h
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2026 Christian Spoo
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT of OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#ifndef _MINIOS_FS_FAT32_H_
24#define _MINIOS_FS_FAT32_H_
25
26#include <miniOS/fs/vfs.h>
27
28typedef struct
29{
41 char volume_label[11];
42 char system_id[8];
45} __attribute__((packed)) fat32_ebr_t;
46
47typedef struct
48{
63
64 fat32_ebr_t ebr;
65} __attribute__((packed)) fat32_bpb_t;
66
67typedef struct
68{
70 uint8_t reserved[480];
76} __attribute__((packed)) fat32_fsinfo_t;
77
78typedef struct
79{
80 char name[8];
81 char extension[3];
93} __attribute__((packed)) fat32_dir_entry_t;
94
95typedef struct
96{
105} __attribute__((packed)) fat32_long_entry_t;
106
107/* -----------------------------------------------------------------------
108 * Filesystem type registry integration
109 * ---------------------------------------------------------------------- */
110
119void fat32_init(void);
120
121#endif
void fat32_init(void)
Definition fat32.c:484
uint16_t fsinfo_sector
Definition fat32.h:34
uint16_t reserved_sector_count
Definition fat32.h:53
uint32_t hidden_sector_count
Definition fat32.h:61
fat32_ebr_t ebr
Definition fat32.h:64
char extension[3]
Definition fat32.h:81
uint16_t cluster_low
Definition fat32.h:91
uint8_t ctime_ms
Definition fat32.h:84
uint16_t name1[5]
Definition fat32.h:98
uint16_t bytes_per_sector
Definition fat32.h:51
uint32_t last_allocated_cluster
Definition fat32.h:73
uint16_t boot_signature
Definition fat32.h:44
uint8_t type
Definition fat32.h:100
uint32_t lead_signature
Definition fat32.h:69
uint16_t head_count
Definition fat32.h:60
uint8_t signature[8]
Definition gpt.h:42
uint8_t jump[3]
Definition fat32.h:49
uint16_t total_sector_count
Definition fat32.h:56
uint32_t sectors_per_fat
Definition fat32.h:30
uint16_t ctime
Definition fat32.h:85
uint8_t boot_code[420]
Definition fat32.h:43
uint16_t name3[2]
Definition fat32.h:104
uint8_t attribute
Definition fat32.h:99
uint32_t trail_signature
Definition fat32.h:75
uint32_t reserved
Definition gpt.h:46
uint16_t mdate
Definition fat32.h:90
uint16_t name2[6]
Definition fat32.h:102
uint8_t order
Definition fat32.h:97
uint16_t sectors_per_track
Definition fat32.h:59
uint16_t version
Definition fat32.h:32
uint32_t filesize
Definition fat32.h:92
char volume_label[11]
Definition fat32.h:41
uint32_t last_free_cluster_count
Definition fat32.h:72
uint8_t lowercase
Definition fat32.h:83
uint16_t root_entry_count
Definition fat32.h:55
uint16_t flags
Definition ata.h:88
uint16_t zero
Definition fat32.h:103
uint8_t drive_number
Definition fat32.h:37
char system_id[8]
Definition fat32.h:42
uint16_t backup_boot_sector
Definition fat32.h:35
uint8_t reserved2
Definition fat32.h:38
uint32_t root_directory_cluster
Definition fat32.h:33
uint64_t attributes
Definition gpt.h:64
uint16_t mtime
Definition fat32.h:89
uint8_t oem_name[8]
Definition fat32.h:50
uint8_t checksum
Definition fat32.h:101
uint32_t volume_id
Definition fat32.h:40
uint32_t large_sector_count
Definition fat32.h:62
uint16_t adate
Definition fat32.h:87
uint8_t media_descriptor_type
Definition fat32.h:57
uint8_t fat_count
Definition fat32.h:54
uint16_t cluster_high
Definition fat32.h:88
uint8_t sectors_per_cluster
Definition fat32.h:52
uint16_t cdate
Definition fat32.h:86
unsigned short uint16_t
Definition types.h:31
unsigned int uint32_t
Definition types.h:34
unsigned char uint8_t
Definition types.h:28
typedef __attribute__