RetroArch
Enumerations | Functions | Variables
partition.c File Reference
#include "partition.h"
#include "bit_ops.h"
#include "file_allocation_table.h"
#include "directory.h"
#include "mem_allocate.h"
#include "fatfile.h"
#include <string.h>
#include <ctype.h>
#include <sys/iosupport.h>
Include dependency graph for partition.c:

Enumerations

enum  BPB {
  BPB_jmpBoot = 0x00, BPB_OEMName = 0x03, BPB_bytesPerSector = 0x0B, BPB_sectorsPerCluster = 0x0D,
  BPB_reservedSectors = 0x0E, BPB_numFATs = 0x10, BPB_rootEntries = 0x11, BPB_numSectorsSmall = 0x13,
  BPB_mediaDesc = 0x15, BPB_sectorsPerFAT = 0x16, BPB_sectorsPerTrk = 0x18, BPB_numHeads = 0x1A,
  BPB_numHiddenSectors = 0x1C, BPB_numSectors = 0x20, BPB_FAT16_driveNumber = 0x24, BPB_FAT16_reserved1 = 0x25,
  BPB_FAT16_extBootSig = 0x26, BPB_FAT16_volumeID = 0x27, BPB_FAT16_volumeLabel = 0x2B, BPB_FAT16_fileSysType = 0x36,
  BPB_FAT16_bootCode = 0x3E, BPB_FAT32_sectorsPerFAT32 = 0x24, BPB_FAT32_extFlags = 0x28, BPB_FAT32_fsVer = 0x2A,
  BPB_FAT32_rootClus = 0x2C, BPB_FAT32_fsInfo = 0x30, BPB_FAT32_bkBootSec = 0x32, BPB_FAT32_driveNumber = 0x40,
  BPB_FAT32_reserved1 = 0x41, BPB_FAT32_extBootSig = 0x42, BPB_FAT32_volumeID = 0x43, BPB_FAT32_volumeLabel = 0x47,
  BPB_FAT32_fileSysType = 0x52, BPB_FAT32_bootCode = 0x5A, BPB_bootSig_55 = 0x1FE, BPB_bootSig_AA = 0x1FF,
  BPB_jmpBoot = 0x00, BPB_OEMName = 0x03, BPB_bytesPerSector = 0x0B, BPB_sectorsPerCluster = 0x0D,
  BPB_reservedSectors = 0x0E, BPB_numFATs = 0x10, BPB_rootEntries = 0x11, BPB_numSectorsSmall = 0x13,
  BPB_mediaDesc = 0x15, BPB_sectorsPerFAT = 0x16, BPB_sectorsPerTrk = 0x18, BPB_numHeads = 0x1A,
  BPB_numHiddenSectors = 0x1C, BPB_numSectors = 0x20, BPB_FAT16_driveNumber = 0x24, BPB_FAT16_reserved1 = 0x25,
  BPB_FAT16_extBootSig = 0x26, BPB_FAT16_volumeID = 0x27, BPB_FAT16_volumeLabel = 0x2B, BPB_FAT16_fileSysType = 0x36,
  BPB_FAT16_bootCode = 0x3E, BPB_FAT32_sectorsPerFAT32 = 0x24, BPB_FAT32_extFlags = 0x28, BPB_FAT32_fsVer = 0x2A,
  BPB_FAT32_rootClus = 0x2C, BPB_FAT32_fsInfo = 0x30, BPB_FAT32_bkBootSec = 0x32, BPB_FAT32_driveNumber = 0x40,
  BPB_FAT32_reserved1 = 0x41, BPB_FAT32_extBootSig = 0x42, BPB_FAT32_volumeID = 0x43, BPB_FAT32_volumeLabel = 0x47,
  BPB_FAT32_fileSysType = 0x52, BPB_FAT32_bootCode = 0x5A, BPB_bootSig_55 = 0x1FE, BPB_bootSig_AA = 0x1FF
}
 
enum  FSIB {
  FSIB_SIG1 = 0x00, FSIB_SIG2 = 0x1e4, FSIB_numberOfFreeCluster = 0x1e8, FSIB_numberLastAllocCluster = 0x1ec,
  FSIB_bootSig_55 = 0x1FE, FSIB_bootSig_AA = 0x1FF, FSIB_SIG1 = 0x00, FSIB_SIG2 = 0x1e4,
  FSIB_numberOfFreeCluster = 0x1e8, FSIB_numberLastAllocCluster = 0x1ec, FSIB_bootSig_55 = 0x1FE, FSIB_bootSig_AA = 0x1FF
}
 

Functions

sec_t FindFirstValidPartition_buf (const DISC_INTERFACE *disc, uint8_t *sectorBuffer)
 
sec_t FindFirstValidPartition (const DISC_INTERFACE *disc)
 
PARTITION_FAT_partition_constructor_buf (const DISC_INTERFACE *disc, uint32_t cacheSize, uint32_t sectorsPerPage, sec_t startSector, uint8_t *sectorBuffer)
 
PARTITION_FAT_partition_constructor (const DISC_INTERFACE *disc, uint32_t cacheSize, uint32_t sectorsPerPage, sec_t startSector)
 
void _FAT_partition_destructor (PARTITION *partition)
 
PARTITION_FAT_partition_getPartitionFromPath (const char *path)
 
void _FAT_partition_createFSinfo (PARTITION *partition)
 
void _FAT_partition_readFSinfo (PARTITION *partition)
 
void _FAT_partition_writeFSinfo (PARTITION *partition)
 
uint32_t_FAT_getCwdClusterPtr (const char *name)
 

Variables

static const char FAT_SIG [3] = {'F', 'A', 'T'}
 
static const char FS_INFO_SIG1 [4] = {'R', 'R', 'a', 'A'}
 
static const char FS_INFO_SIG2 [4] = {'r', 'r', 'A', 'a'}
 

Enumeration Type Documentation

◆ BPB

enum BPB
Enumerator
BPB_jmpBoot 
BPB_OEMName 
BPB_bytesPerSector 
BPB_sectorsPerCluster 
BPB_reservedSectors 
BPB_numFATs 
BPB_rootEntries 
BPB_numSectorsSmall 
BPB_mediaDesc 
BPB_sectorsPerFAT 
BPB_sectorsPerTrk 
BPB_numHeads 
BPB_numHiddenSectors 
BPB_numSectors 
BPB_FAT16_driveNumber 
BPB_FAT16_reserved1 
BPB_FAT16_extBootSig 
BPB_FAT16_volumeID 
BPB_FAT16_volumeLabel 
BPB_FAT16_fileSysType 
BPB_FAT16_bootCode 
BPB_FAT32_sectorsPerFAT32 
BPB_FAT32_extFlags 
BPB_FAT32_fsVer 
BPB_FAT32_rootClus 
BPB_FAT32_fsInfo 
BPB_FAT32_bkBootSec 
BPB_FAT32_driveNumber 
BPB_FAT32_reserved1 
BPB_FAT32_extBootSig 
BPB_FAT32_volumeID 
BPB_FAT32_volumeLabel 
BPB_FAT32_fileSysType 
BPB_FAT32_bootCode 
BPB_bootSig_55 
BPB_bootSig_AA 
BPB_jmpBoot 
BPB_OEMName 
BPB_bytesPerSector 
BPB_sectorsPerCluster 
BPB_reservedSectors 
BPB_numFATs 
BPB_rootEntries 
BPB_numSectorsSmall 
BPB_mediaDesc 
BPB_sectorsPerFAT 
BPB_sectorsPerTrk 
BPB_numHeads 
BPB_numHiddenSectors 
BPB_numSectors 
BPB_FAT16_driveNumber 
BPB_FAT16_reserved1 
BPB_FAT16_extBootSig 
BPB_FAT16_volumeID 
BPB_FAT16_volumeLabel 
BPB_FAT16_fileSysType 
BPB_FAT16_bootCode 
BPB_FAT32_sectorsPerFAT32 
BPB_FAT32_extFlags 
BPB_FAT32_fsVer 
BPB_FAT32_rootClus 
BPB_FAT32_fsInfo 
BPB_FAT32_bkBootSec 
BPB_FAT32_driveNumber 
BPB_FAT32_reserved1 
BPB_FAT32_extBootSig 
BPB_FAT32_volumeID 
BPB_FAT32_volumeLabel 
BPB_FAT32_fileSysType 
BPB_FAT32_bootCode 
BPB_bootSig_55 
BPB_bootSig_AA 

◆ FSIB

enum FSIB
Enumerator
FSIB_SIG1 
FSIB_SIG2 
FSIB_numberOfFreeCluster 
FSIB_numberLastAllocCluster 
FSIB_bootSig_55 
FSIB_bootSig_AA 
FSIB_SIG1 
FSIB_SIG2 
FSIB_numberOfFreeCluster 
FSIB_numberLastAllocCluster 
FSIB_bootSig_55 
FSIB_bootSig_AA 

Function Documentation

◆ _FAT_getCwdClusterPtr()

uint32_t* _FAT_getCwdClusterPtr ( const char *  name)
Here is the call graph for this function:

◆ _FAT_partition_constructor()

PARTITION* _FAT_partition_constructor ( const DISC_INTERFACE disc,
uint32_t  cacheSize,
uint32_t  sectorsPerPage,
sec_t  startSector 
)
Here is the caller graph for this function:

◆ _FAT_partition_constructor_buf()

PARTITION* _FAT_partition_constructor_buf ( const DISC_INTERFACE disc,
uint32_t  cacheSize,
uint32_t  sectorsPerPage,
sec_t  startSector,
uint8_t sectorBuffer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _FAT_partition_createFSinfo()

void _FAT_partition_createFSinfo ( PARTITION partition)
Here is the caller graph for this function:

◆ _FAT_partition_destructor()

void _FAT_partition_destructor ( PARTITION partition)
Here is the caller graph for this function:

◆ _FAT_partition_getPartitionFromPath()

PARTITION* _FAT_partition_getPartitionFromPath ( const char *  path)
Here is the caller graph for this function:

◆ _FAT_partition_readFSinfo()

void _FAT_partition_readFSinfo ( PARTITION partition)
Here is the caller graph for this function:

◆ _FAT_partition_writeFSinfo()

void _FAT_partition_writeFSinfo ( PARTITION partition)
Here is the caller graph for this function:

◆ FindFirstValidPartition()

sec_t FindFirstValidPartition ( const DISC_INTERFACE disc)
Here is the call graph for this function:

◆ FindFirstValidPartition_buf()

sec_t FindFirstValidPartition_buf ( const DISC_INTERFACE disc,
uint8_t sectorBuffer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FAT_SIG

const char FAT_SIG[3] = {'F', 'A', 'T'}
static

◆ FS_INFO_SIG1

const char FS_INFO_SIG1[4] = {'R', 'R', 'a', 'A'}
static

◆ FS_INFO_SIG2

const char FS_INFO_SIG2[4] = {'r', 'r', 'A', 'a'}
static