␊ |
//==========================================================================␊ |
// Maps (E)BIOS return codes to message strings.␊ |
␊ |
struct NamedValue {␊ |
␉unsigned char value;␊ |
␉const char *name;␊ |
};␊ |
␊ |
// =========================================================================␊ |
/*␊ |
* Map a disk drive to bootable volumes contained within.␊ |
*/␊ |
|
static bool getOSVersion(BVRef bvr, char *str);␊ |
static bool cache_valid = false;␊ |
␊ |
// =============================================================================␊ |
static const struct NamedValue bios_errors[] =␊ |
{␊ |
␉{ 0x10, "Media error" },␊ |
|
␉{ 0x00, NULL }␊ |
};␊ |
␊ |
// =============================================================================␊ |
static const struct NamedValue fdiskTypes[] =␊ |
{␊ |
␉{ FDISK_DOS12,␉␉"DOS_FAT_12" }, // 0x01␊ |
|
};␊ |
␊ |
//==============================================================================␊ |
␊ |
extern void spinActivityIndicator(int sectors);␊ |
␊ |
//==========================================================================␊ |
␊ |
//==============================================================================␊ |
static int getDriveInfo( int biosdev, struct driveInfo *dip )␊ |
{␊ |
␉static struct driveInfo cached_di;␊ |
|
␉return 0;␊ |
}␊ |
␊ |
//==========================================================================␊ |
␊ |
//==============================================================================␊ |
static const char *getNameForValue( const struct NamedValue *nameTable, unsigned char value )␊ |
{␊ |
␉const struct NamedValue *np;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static const char * bios_error(int errnum)␊ |
static const char *bios_error(int errnum)␊ |
{␊ |
␉static char errorstr[] = "Error 0x00";␊ |
␉const char * errname;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int testBiosread(int biosdev, unsigned long long secno)␊ |
{␊ |
␉return Biosread(biosdev, secno);␊ |
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static int readBytes(int biosdev, unsigned long long blkno, unsigned int byteoff, unsigned int byteCount, void * buffer)␊ |
static int readBytes(int biosdev, unsigned long long blkno, unsigned int byteoff, unsigned int byteCount, void *buffer)␊ |
{␊ |
␉// ramdisks require completely different code for reading.␊ |
␉if(p_ramdiskReadBytes != NULL && biosdev >= 0x100)␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static int isExtendedFDiskPartition( const struct fdisk_part *part )␊ |
{␊ |
␉static unsigned char extParts[] =␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static int getNextFDiskPartition( int biosdev, int *partno, const struct fdisk_part **outPart )␊ |
{␊ |
␉static int sBiosdev = -1;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
/*␊ |
* Trying to figure out the filsystem type of a given partition.␊ |
* X = fdisk partition type␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static BVRef newFDiskBVRef( int biosdev,␊ |
int partno,␊ |
unsigned int blkoff,␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff,␊ |
const DPME * part,␊ |
FSInit initFunc, FSLoadFile loadFunc,␊ |
|
* So, for example, if you have two primary partitions and␊ |
* one extended partition they will be numbered 1, 2, 5.␊ |
*/␊ |
␊ |
static BVRef diskScanFDiskBootVolumes( int biosdev, int *countPtr )␊ |
{␊ |
const struct fdisk_part␉*part;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static BVRef diskScanAPMBootVolumes( int biosdev, int * countPtr )␊ |
static BVRef diskScanAPMBootVolumes( int biosdev, int *countPtr )␊ |
{␊ |
␉struct DiskBVMap␉*map;␊ |
␉struct Block0␉␉*block0_p;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static bool isPartitionUsed(gpt_ent * partition)␊ |
{␊ |
␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr)␊ |
static BVRef diskScanGPTBootVolumes(int biosdev, int *countPtr)␊ |
{␊ |
␉verbose("\tAttempting to scan GPT boot volumes [biosdev=%02Xh]:\n", biosdev);␊ |
␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static bool getOSVersion(BVRef bvr, char *str)␊ |
{␊ |
␉bool valid = false;␉␊ |
␉bool valid = false;␊ |
␉config_file_t systemVersion;␊ |
␉char dirSpec[512];␊ |
␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
static void scanFSLevelBVRSettings(BVRef chain)␊ |
{␊ |
␉BVRef bvr;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
void rescanBIOSDevice(int biosdev)␊ |
{␊ |
␉struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev);␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
struct DiskBVMap* diskResetBootVolumes(int biosdev)␊ |
{␊ |
␉struct DiskBVMap * map;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
// Frees a DiskBVMap and all of its BootVolume's␊ |
void diskFreeMap(struct DiskBVMap *map)␊ |
{␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
BVRef diskScanBootVolumes(int biosdev, int * countPtr)␊ |
BVRef diskScanBootVolumes(int biosdev, int *countPtr)␊ |
{␊ |
␉struct DiskBVMap *map;␊ |
␉BVRef bvr;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
BVRef getBVChainForBIOSDev(int biosdev)␊ |
{␊ |
␉BVRef chain = NULL;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count)␊ |
{␊ |
␉BVRef chain = NULL;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int freeFilteredBVChain(const BVRef chain)␊ |
{␊ |
␉int ret = 1;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
bool matchVolumeToString( BVRef bvr, const char* match, long matchLen)␊ |
bool matchVolumeToString( BVRef bvr, const char *match, long matchLen)␊ |
{␊ |
␉char testStr[128];␊ |
␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
/* If Rename Partition has defined an alias, then extract it for description purpose.␊ |
* The format for the rename string is the following:␊ |
* hd(x,y)|uuid|"label" "alias";hd(m,n)|uuid|"label" "alias"; etc...␊ |
*/␊ |
␊ |
static bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen)␊ |
static bool getVolumeLabelAlias(BVRef bvr, char *str, long strMaxLen)␊ |
{␊ |
␉char *aliasList, *entryStart, *entryNext;␊ |
␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
void getBootVolumeDescription( BVRef bvr, char *str, long strMaxLen, bool useDeviceDescription )␊ |
{␊ |
␉unsigned char type;␊ |
|
␉strncpy(bvr->label, p, sizeof(bvr->label) );␊ |
}␊ |
␊ |
␊ |
//==============================================================================␊ |
␊ |
int readBootSector(int biosdev, unsigned int secno, void *buffer)␊ |
{␊ |
␉int error;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
/*␊ |
* Format of boot1f32 block.␊ |
*/␊ |
␊ |
#define BOOT1F32_MAGIC "BOOT "␊ |
#define BOOT1F32_MAGICLEN 11␊ |
␊ |
|
␉return 0;␊ |
}␊ |
␊ |
␊ |
//==============================================================================␊ |
// Handle seek request from filesystem modules.␊ |
␊ |
void diskSeek(BVRef bvr, long long position)␊ |
{␊ |
␉bvr->fs_boff = position / BPS;␊ |
␉bvr->fs_byteoff = position % BPS;␊ |
}␊ |
␊ |
␊ |
//==============================================================================␊ |
// Handle read request from filesystem modules.␊ |
␊ |
int diskRead(BVRef bvr, long addr, long length)␊ |
{␊ |
␉return readBytes(bvr->biosdev, bvr->fs_boff + bvr->part_boff, bvr->fs_byteoff, length, (void *) addr);␊ |
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int rawDiskRead( BVRef bvr, unsigned int secno, void *buffer, unsigned int len )␊ |
{␊ |
␉int secs;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int rawDiskWrite( BVRef bvr, unsigned int secno, void *buffer, unsigned int len )␊ |
{␊ |
int secs;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int diskIsCDROM(BVRef bvr)␊ |
{␊ |
␉struct driveInfo di;␊ |
|
}␊ |
␊ |
//==============================================================================␊ |
␊ |
int biosDevIsCDROM(int biosdev)␊ |
{␊ |
␉struct driveInfo di;␊ |