diff --git a/src/sys/include/ubixfs/ubixfs.h b/src/sys/include/ubixfs/ubixfs.h index f364613..c86a2fe 100644 --- a/src/sys/include/ubixfs/ubixfs.h +++ b/src/sys/include/ubixfs/ubixfs.h @@ -41,50 +41,51 @@ #define typeDirectory 4 #define typeDeleted 8 -//Partition Information +/// Partition Information struct ubixDiskLabel { uInt32 magicNum; uInt32 magicNum2; uInt16 driveType; uInt16 numPartitions; - struct drivePartitions { //the partition table - uInt32 pSize; //number of sectors in partition - uInt32 pOffset; //starting sector - uInt32 pFsSize; //filesystem basic fragment size - uInt32 pBatSize; //BAT size - uInt8 pFsType; //filesystem type, see below - uInt8 pFrag; //filesystem fragments per block + struct drivePartitions { /// the partition table + uInt32 pSize; /// number of sectors in partition + uInt32 pOffset; /// starting sector + uInt32 pFsSize; /// filesystem basic fragment size + uInt32 pBatSize; /// BAT size + uInt8 pFsType; /// filesystem type, see below + uInt8 pFrag; /// filesystem fragments per block } partitions[MAXPARTITIONS]; }; struct partitionInformation { - uInt32 size; //Size In Sectors - uInt32 startSector; //Base Sector Of Partition - uInt32 blockAllocationTable; //Base Sector Of BAT - uInt32 rootDirectory; //Base Sector Of Root Directory + uInt32 size; /// Size In Sectors + uInt32 startSector; /// Base Sector Of Partition + uInt32 blockAllocationTable; /// Base Sector Of BAT + uInt32 rootDirectory; /// Base Sector Of Root Directory }; -//Block Allocation Table Entry +/// Block Allocation Table Entry struct blockAllocationTableEntry { - long attributes; //Block Attributes - long realSector; //Real Sector - long nextBlock; //Sector Of Next Block - long reserved; //Reserved + long attributes; /// Block Attributes + long realSector; /// Real Sector + long nextBlock; /// Sector Of Next Block + long reserved; /// Reserved }; -//UbixFS Directory Entry +/// UbixFS Directory Entry struct directoryEntry { - uInt32 startCluster; //Starting Cluster Of File - uInt32 size; //Size Of File - uInt32 creationDate; //Date Created - uInt32 lastModified; //Date Last Modified - uInt32 uid; //UID Of Owner - uInt32 gid; //GID Of Owner - uInt16 attributes; //Files Attributes - uInt16 permissions; //Files Permissions - char fileName[256]; //File Name - }; + uInt32 startCluster; /// Starting Cluster Of File + uInt32 size; /// Size Of File + uInt32 creationDate; /// Date Created + uInt32 lastModified; /// Date Last Modified + uInt32 uid; /// UID Of Owner + uInt32 gid; /// GID Of Owner + uShort attributes; /// Files Attributes + uShort permissions; /// Files Permissions + char fileName[256]; /// File Name +}; +/// Bootsector structure struct bootSect { uInt8 jmp[4]; uInt8 id[6]; @@ -105,7 +106,12 @@ uInt32 batEntries; }; +/** Registers UbixFS functions with the virtual file-system (using vfsRegisterFS). Returns 1 if a failure + happened, and 0 if success. */ int readFile(char *file); + +/** Sets up the Ubix filesystem with appropriate data. If the medium is a hard-drive (or any medium?), it looks + in the partition table. */ int writeFileByte(int ch,fileDescriptor *fd,long offset); int openFileUbixFS(char *file,fileDescriptor *fd); int mkDirUbixFS(char *dir,fileDescriptor *fd);