[Krafton Jungle] PintOS 2.0.0
크래프톤 정글 PintOS
 
Loading...
Searching...
No Matches
fat.h
Go to the documentation of this file.
1#ifndef FILESYS_FAT_H
2#define FILESYS_FAT_H
3
4#include "devices/disk.h"
5#include "filesys/file.h"
6#include <inttypes.h>
7#include <stdbool.h>
8#include <stddef.h>
9#include <stdint.h>
10
11typedef uint32_t cluster_t; /* Index of a cluster within FAT. */
12
13#define FAT_MAGIC 0xEB3C9000 /* MAGIC string to identify FAT disk */
14#define EOChain 0x0FFFFFFF /* End of cluster chain */
15
16/* Sectors of FAT information. */
17#define SECTORS_PER_CLUSTER 1 /* Number of sectors per cluster */
18#define FAT_BOOT_SECTOR 0 /* FAT boot sector. */
19#define ROOT_DIR_CLUSTER 1 /* Cluster for the root directory */
20
21void fat_init (void);
22void fat_open (void);
23void fat_close (void);
24void fat_create (void);
25void fat_close (void);
26
28 cluster_t clst /* Cluster # to stretch, 0: Create a new chain */
29);
31 cluster_t clst, /* Cluster # to be removed */
32 cluster_t pclst /* Previous cluster of clst, 0: clst is the start of chain */
33);
35void fat_put (cluster_t clst, cluster_t val);
37
38#endif /* filesys/fat.h */
uint32_t disk_sector_t
Definition: disk.h:12
void fat_remove_chain(cluster_t clst, cluster_t pclst)
Definition: fat.c:173
void fat_create(void)
Definition: fat.c:117
void fat_init(void)
Definition: fat.c:35
void fat_open(void)
Definition: fat.c:55
void fat_put(cluster_t clst, cluster_t val)
Definition: fat.c:179
cluster_t fat_get(cluster_t clst)
Definition: fat.c:185
void fat_close(void)
Definition: fat.c:84
cluster_t fat_create_chain(cluster_t clst)
Definition: fat.c:166
uint32_t cluster_t
Definition: fat.h:11
disk_sector_t cluster_to_sector(cluster_t clst)
Definition: fat.c:191
uint64_t val
Definition: intrinsic.h:123
unsigned int uint32_t
Definition: stdint.h:26