57 lines
1.2 KiB
C
57 lines
1.2 KiB
C
// fat12.h
|
|
// Author: Josh Holtrop
|
|
// Created: 01/04/04
|
|
|
|
|
|
typedef struct {
|
|
dword location;
|
|
} __attribute__((packed)) Fat12File;
|
|
|
|
typedef struct {
|
|
dword location;
|
|
} __attribute__((packed)) Fat12Directory;
|
|
|
|
typedef struct {
|
|
char fileName[8];
|
|
char ext[3];
|
|
byte attributes;
|
|
dword createTime;
|
|
word createDate;
|
|
word accessDate;
|
|
word unused0;
|
|
word modifiedDate;
|
|
word modifiedTime;
|
|
word firstCluster;
|
|
dword fileSize;
|
|
} __attribute__((packed)) Fat12DirectoryEntry;
|
|
|
|
typedef struct {
|
|
byte jump[3];
|
|
byte sysName[8];
|
|
word bytesPerSector;
|
|
byte sectorsPerCluster;
|
|
word reservedSectors;
|
|
byte FATcount;
|
|
word maxRootEntries;
|
|
word totalSectors1;
|
|
byte mediaDescriptor;
|
|
word sectorsPerFAT;
|
|
word sectorsPerTrack;
|
|
word headCount;
|
|
dword hiddenSectors;
|
|
dword totalSectors2;
|
|
byte driveNumber;
|
|
byte reserved1;
|
|
byte extBootSignature;
|
|
dword volumeSerial;
|
|
char volumeLabel[11];
|
|
char fileSystemID[8];
|
|
} __attribute__((packed)) Fat12BootSector;
|
|
|
|
|
|
byte *fat12_readFile(char *fileName, DiskDevice *dd);
|
|
Fat12File *fat12_getFileHandle(char *fileName, DiskDevice *dd);
|
|
Fat12Directory *fat12_getDirectoryHandle(char *directory, DiskDevice *dd);
|
|
|
|
|