Newer
Older
ubixos / src / bin / fdisk / ubixfs.h
#include <sys/types.h>

#define	DOSPTYP_UBX	 0x2A	/* UbixFS partition type */
#define UBIXDISKMAGIC    ((uInt32)0x45) /* The disk magic number */
#define MAXUBIXPARTITIONS 16
#define UBIXFSMAGIC      ((uInt32)0x69) /* The File System Magic Number */

struct ubixDiskLabel {
  uInt32 magicNum;
  uInt32 magicNum2;
  uInt16 driveType;
  uInt16 numPartitions;
  struct  ubixPartitions {             /* the partition table */
    uInt32 p_size;       /* number of sectors in partition */
    uInt32 p_offset;     /* starting sector */
    uInt32 p_fsize;      /* filesystem basic fragment size */
    uInt32 p_bsize;      /* BAT size */
    uInt8 p_fstype;      /* filesystem type, see below */
    uInt8 p_frag;        /* filesystem fragments per block */
        } partitions[MAXUBIXPARTITIONS];
  };

//Block Allocation Table Entry
struct blockAllocationTableEntry {
  long attributes; //Block Attributes
  long realSector; //Real Sector  
  long nextBlock;  //Sector Of Next Block
  long reserved;   //Reserved
  };


struct directoryEntry {
  uLong  startCluster;   //Starting Cluster Of File
  uLong  size;           //Size Of File
  uLong  creationDate;  //Date Created
  uLong  lastModified;  //Date Last Modified
  uLong  uid;           //UID Of Owner
  uLong  gid;           //GID Of Owner
  uShort attributes;    //Files Attributes
  uShort permissions;   //Files Permissions
  char   fileName[256]; //File Name
  };