|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/io.h>#include <miniOS/fs/fat32.h>#include <miniOS/fs/vfs.h>#include <miniOS/drivers/block_layer.h>#include <miniOS/drivers/block_device.h>#include <string.h>
Classes | |
| struct | find_ctx |
| struct | readdir_ctx |
Typedefs | |
| typedef int(*) | fat32_scan_cb_t(const char *name, uint8_t name_len, uint32_t cluster, uint8_t is_dir, uint32_t filesize, void *ud) |
Functions | |
| static int | read_part_sector (uint32_t part_sector, void *buf) |
| static uint32_t | fat_entry (uint32_t cluster) |
| static uint32_t | cluster_to_part_sector (uint32_t cluster) |
| static uint32_t | entry_cluster (const fat32_dir_entry_t *e) |
| static uint8_t | lfn_checksum (const char *name11) |
| static uint32_t | lfn_decode (const uint16_t *lfn, int slot_count, char *out, uint32_t out_size) |
| static uint32_t | short_name (const fat32_dir_entry_t *e, char *out, uint32_t out_size) |
| static int | fat32_scan_dir (uint32_t dir_cluster, uint64_t *offset_p, fat32_scan_cb_t cb, void *ud) |
| static int | find_entry_cb (const char *name, uint8_t name_len, uint32_t cluster, uint8_t is_dir, uint32_t filesize, void *ud) |
| static int | fat32_lookup (const char *path, vfs_inode_info_t *out) |
| static int | readdir_adapter (const char *name, uint8_t name_len, uint32_t cluster, uint8_t is_dir, uint32_t filesize, void *ud) |
| static int | fat32_readdir (uint32_t ino, uint64_t *offset, vfs_dirent_cb_t cb, void *ud) |
| static int | fat32_read (uint32_t ino, uint64_t off, void *buf, uint32_t len) |
| static int | fat32_statfs (vfs_statfs_t *out) |
| static void | fat32_do_unmount (void) |
| int | fat32_mount (uint64_t part_lba_start, uint64_t part_lba_end) |
| static int | fat32_fs_mount (const char *source, const char *target, const void *data) |
| void | fat32_init (void) |
Variables | |
| static uint64_t | g_part_start |
| static uint64_t | g_part_end |
| static uint32_t | g_bytes_per_sector |
| static uint32_t | g_sectors_per_cluster |
| static uint32_t | g_first_data_sector |
| static uint32_t | g_fat_start_sector |
| static uint32_t | g_root_cluster |
| static uint8_t | g_fat_buf [512] |
| static uint8_t | g_dir_buf [512] |
| static int | g_fat32_mounted = 0 |
| static vfs_ops_t | g_fat32_ops |
| typedef int(*) fat32_scan_cb_t(const char *name, uint8_t name_len, uint32_t cluster, uint8_t is_dir, uint32_t filesize, void *ud) |


|
static |


|
static |


|
static |


| void fat32_init | ( | void | ) |
fat32_init() - Register the FAT32 filesystem type with the VFS registry.
After this call, vfs_mount_fstype("fat32", source, target, data) can be used to mount any FAT32 partition by passing a vfs_mount_data_t as @data. fat32_init() does NOT mount anything itself; it only registers the type. Call once during kernel startup, before the first FAT32 mount.


|
static |






|
static |


|
static |


|
static |




|
static |

|
static |




|
static |


|
static |




|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |