示例#1
0
文件: FAT.cs 项目: Orvid/Cosmos
        public FAT32(Partition p) : base(p)
        {
            BootSector = new BootSectorFAT32(p);
            BootSector.Refresh();
            if ((BootSector as BootSectorFAT32).BPB_FSInfo != 0x0)
                FileSystemInfo32 = new FileSystemInfo32(p, (BootSector as BootSectorFAT32).BPB_FSInfo);
            else
                FileSystemInfo32 = null;

            FileAllocationTable = new FileAllocationTableFAT32(this, p,
                BootSector.ReservedSectorCount, 
                (uint)(BootSector.ReservedSectorCount + BootSector.FATsz16));
            CalcOffsets();
        }
示例#2
0
        public FileAllocationTableFAT32(FAT32 fat32, Partition p, uint firstsector, uint secondsector)
        {
            this.fat32 = fat32;
            this.FirstSector = firstsector;
            this.SecondSector = secondsector;
            this.TotalClusters = (fat32.BootSector.TotalSectors32-fat32.BootSector.ReservedSectorCount)/ fat32.BootSector.SectorsPerCluster;
            this.p = p;
            this.ClusterSize = (uint)(fat32.BootSector.SectorsPerCluster * fat32.BootSector.BytesPerSec);

            switch (fat32.BootSector.BytesPerSec/4)
            {
                case 128:
                    Shift = 7;
                    Mask = 0x7f;
                    break;
                default:
                    throw new Exception("weird sector size");
            }
        }
示例#3
0
文件: FAT.cs 项目: Orvid/Cosmos
 protected FAT(Partition p)
 {
     this.p = p;
 }
示例#4
0
 public FileSystemInfo32(Partition p, uint Offset)
 {
     this.p = p;
     this.Offset = Offset;
     Sector = new byte[p.BlockSize];
 }
示例#5
0
 public BootSectorFAT32(Partition p) : base(p) { }
示例#6
0
 public BootSector(Partition p)
 {
     this.p = p;
     Sector = new byte[p.BlockSize];
 }