|
Retro Rocket Kernel
BASIC-Powered Operating System
|
#include "kernel.h"Data Structures | |
| struct | fat32_fs_info_t |
| FAT32 FSINFO structure. More... | |
| struct | fat32_t |
| FAT32 filesystem information, used internally by the driver. This is a higher level version of FSINFO. More... | |
| struct | directory_entry_t |
| A directory entry, e.g. file, volume label, directory, long filename entry. More... | |
| struct | parameter_block_t |
| FAT32 BIOS parameter block (BPB), stored in the boot sector of the drive. More... | |
| struct | lfn_t |
| Long filename entry, overlays a directory_entry_t. These entries repeat before a non-lfn entry, each holding up to 13 UCS-2 characters. Note that they are not stored in order, the 'order' attribute indicates which order they go in. More... | |
Macros | |
| #define | FAT32_SIGNATURE 0x41615252 |
| FAT32 FSINFO sector signature. More... | |
| #define | FAT32_SIGNATURE2 0x61417272 |
| #define | FAT32_SIGNATURE3 0xAA550000 |
| #define | ATTR_READ_ONLY 0x01 |
| #define | ATTR_HIDDEN 0x02 |
| #define | ATTR_SYSTEM 0x04 |
| #define | ATTR_VOLUME_ID 0x08 |
| #define | ATTR_DIRECTORY 0x10 |
| #define | ATTR_ARCHIVE 0x20 |
| #define | ATTR_LONG_NAME 0x0F |
| #define | ATTR_LFN_DELETED 0x80 |
| #define | ATTR_LFN_LAST_ENTRY 0x40 |
| #define | DELETED_ENTRY 0xE5 |
| #define | CLUSTER_END 0x0FFFFFF8 |
| #define | CLUSTER_BAD 0x0FFFFFF7 |
| #define | CLUSTER_FREE 0x00000000 |
| #define | GPT_EFI_SYSTEM "28732AC1-1FF8-D211-BA4B-00A0C93EC93B" |
| EFI system partition GUID. More... | |
| #define | GPT_MICROSOFT_BASIC_DATA "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" |
| Microsoft basic data partition GUID. More... | |
Functions | |
| struct fat32_fs_info_t | __attribute__ ((packed)) fat32_fs_info_t |
| FAT32 FSINFO structure. More... | |
| void | init_fat32 () |
| Register fat32 as a filesystem type. More... | |
Variables | |
| uint32_t | signature1 |
| char | reserved1 [480] |
| uint32_t | structsig |
| uint32_t | freecount |
| uint32_t | nextfree |
| char | reserved2 [12] |
| uint32_t | trailsig |
| char | name [11] |
| uint8_t | attr |
| uint8_t | nt |
| uint8_t | create_time_tenths |
| uint16_t | create_time |
| uint16_t | create_date |
| uint16_t | access_date |
| uint16_t | first_cluster_hi |
| uint16_t | write_time |
| uint16_t | write_date |
| uint16_t | first_cluster_lo |
| uint32_t | size |
| uint8_t | code1 |
| uint8_t | code2 |
| uint8_t | code3 |
| char | oemidentifier [8] |
| uint16_t | bytespersector |
| uint8_t | sectorspercluster |
| uint16_t | reservedsectors |
| uint8_t | numberoffats |
| uint16_t | numberofdirentries |
| uint16_t | totalsectors |
| uint8_t | mediatype |
| uint16_t | unusedsectorsperfat |
| uint16_t | sectorspertrack |
| uint16_t | numberofheads |
| uint32_t | hiddensectors |
| uint32_t | sectorsonmedia |
| uint32_t | sectorsperfat |
| uint16_t | flags |
| uint16_t | fatversion |
| uint32_t | rootdircluster |
| uint16_t | fsinfocluster |
| uint16_t | backupbootsectorcluster |
| char | reserved [12] |
| uint8_t | drivenumber |
| uint8_t | ntflags |
| uint8_t | signature |
| uint32_t | serialnumber |
| char | volumelabel [11] |
| char | systemid [9] |
| uint8_t | order |
| Note the order is arbitrary. It may have the value 0, 3, 65, 48... No way to know! To work around this weirdness, we have an array of lfn_t[256] that holds all possible entries ordered by the order value, which we can then iterate once we encounter a non-lfn to build the name. More... | |
| uint16_t | first [5] |
| uint8_t | attributes |
| uint8_t | entry_type |
| uint8_t | checksum |
| uint16_t | second [6] |
| uint16_t | third [2] |
| #define ATTR_ARCHIVE 0x20 |
| #define ATTR_DIRECTORY 0x10 |
| #define ATTR_HIDDEN 0x02 |
| #define ATTR_LFN_DELETED 0x80 |
| #define ATTR_LFN_LAST_ENTRY 0x40 |
| #define ATTR_LONG_NAME 0x0F |
| #define ATTR_READ_ONLY 0x01 |
| #define ATTR_SYSTEM 0x04 |
| #define ATTR_VOLUME_ID 0x08 |
| #define CLUSTER_BAD 0x0FFFFFF7 |
| #define CLUSTER_END 0x0FFFFFF8 |
| #define CLUSTER_FREE 0x00000000 |
| #define DELETED_ENTRY 0xE5 |
| #define FAT32_SIGNATURE 0x41615252 |
FAT32 FSINFO sector signature.
| #define FAT32_SIGNATURE2 0x61417272 |
| #define FAT32_SIGNATURE3 0xAA550000 |
| #define GPT_EFI_SYSTEM "28732AC1-1FF8-D211-BA4B-00A0C93EC93B" |
EFI system partition GUID.
| #define GPT_MICROSOFT_BASIC_DATA "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" |
Microsoft basic data partition GUID.
| struct fat32_fs_info_t __attribute__ | ( | (packed) | ) |
FAT32 FSINFO structure.
Long filename entry, overlays a directory_entry_t. These entries repeat before a non-lfn entry, each holding up to 13 UCS-2 characters. Note that they are not stored in order, the 'order' attribute indicates which order they go in.
FAT32 BIOS parameter block (BPB), stored in the boot sector of the drive.
A directory entry, e.g. file, volume label, directory, long filename entry.
| void init_fat32 | ( | ) |
Register fat32 as a filesystem type.
| uint16_t access_date |
| uint8_t attr |
| uint8_t attributes |
| uint16_t backupbootsectorcluster |
| uint16_t bytespersector |
| uint8_t checksum |
| uint8_t code1 |
| uint8_t code2 |
| uint8_t code3 |
| uint16_t create_date |
| uint16_t create_time |
| uint8_t create_time_tenths |
| uint8_t drivenumber |
| uint8_t entry_type |
| uint16_t fatversion |
| uint16_t first[5] |
| uint16_t first_cluster_hi |
| uint16_t first_cluster_lo |
| uint16_t flags |
| uint32_t freecount |
| uint16_t fsinfocluster |
| uint32_t hiddensectors |
| uint8_t mediatype |
| char name[11] |
| uint32_t nextfree |
| uint8_t nt |
| uint8_t ntflags |
| uint16_t numberofdirentries |
| uint8_t numberoffats |
| uint16_t numberofheads |
| char oemidentifier[8] |
| uint8_t order |
Note the order is arbitrary. It may have the value 0, 3, 65, 48... No way to know! To work around this weirdness, we have an array of lfn_t[256] that holds all possible entries ordered by the order value, which we can then iterate once we encounter a non-lfn to build the name.
| uint16_t reserved |
| char reserved1[480] |
| char reserved2[12] |
| uint16_t reservedsectors |
| uint32_t rootdircluster |
| uint16_t second[6] |
| uint32_t sectorsonmedia |
| uint8_t sectorspercluster |
| uint32_t sectorsperfat |
| uint16_t sectorspertrack |
| uint32_t serialnumber |
| uint8_t signature |
| uint32_t signature1 |
| uint32_t size |
| uint32_t structsig |
| char systemid[9] |
| uint16_t third[2] |
| uint16_t totalsectors |
| uint32_t trailsig |
| uint16_t unusedsectorsperfat |
| char volumelabel[11] |
| uint16_t write_date |
| uint16_t write_time |