# ubixfs.h

    00001 #define DOSPTYP_UBX      0x2A   /* UbixFS partition type */
    00002 #define UBIXDISKMAGIC    ((u_int32_t)0x45) /* The disk magic number */
    00003 #define MAXUBIXPARTITIONS 16
    00004 #define UBIXFSMAGIC      ((u_int32_t)0x69) /* The File System Magic Number */
    00005
    00006 typedef unsigned long uLong;
    00007 typedef unsigned short uShort;
    00008
    00009
    00010 struct ubixDiskLabel {
    00011   u_int32_t magicNum;
    00012   u_int32_t magicNum2;
    00013   u_int16_t driveType;
    00014   u_int16_t numPartitions;
    00015   struct  ubixPartitions {             /* the partition table */
    00016     u_int32_t p_size;       /* number of sectors in partition */
    00017     u_int32_t p_offset;     /* starting sector */
    00018     u_int32_t p_fsize;      /* filesystem basic fragment size */
    00019     u_int32_t p_bsize;      /* BAT size */
    00020     u_int8_t p_fstype;      /* filesystem type, see below */
    00021     u_int8_t p_frag;        /* filesystem fragments per block */
    00022         } partitions[MAXUBIXPARTITIONS];
    00023   };
    00024
    00025 //Block Allocation Table Entry
    00026 struct blockAllocationTableEntry {
    00027   long attributes; //Block Attributes
    00028   long realSector; //Real Sector
    00029   long nextBlock;  //Sector Of Next Block
    00030   long reserved;   //Reserved
    00031   };
    00032
    00033
    00034 struct directoryEntry {
    00035   uLong  startCluster;   //Starting Cluster Of File
    00036   uLong  size;           //Size Of File
    00037   uLong  creationDate;  //Date Created
    00038   uLong  lastModified;  //Date Last Modified
    00039   uLong  uid;           //UID Of Owner
    00040   uLong  gid;           //GID Of Owner
    00041   uShort attributes;    //Files Attributes
    00042   uShort permissions;   //Files Permissions
    00043   char   fileName[256]; //File Name
    00044   };