| 653 | } |
| 654 | } |
| 655 | bool FatSystem::init() |
| 656 | { |
| 657 | // Parsing header |
| 658 | parseHeader(); |
| 659 | |
| 660 | // Computing values |
| 661 | fatStart = bytesPerSector*reservedSectors; |
| 662 | dataStart = fatStart + fats*sectorsPerFat*bytesPerSector; |
| 663 | bytesPerCluster = bytesPerSector*sectorsPerCluster; |
| 664 | totalSize = totalSectors*bytesPerSector; |
| 665 | fatSize = sectorsPerFat*bytesPerSector; |
| 666 | totalClusters = (fatSize*8)/bits; |
| 667 | dataSize = totalClusters*bytesPerCluster; |
| 668 | |
| 669 | if (type == FAT16) { |
| 670 | int rootBytes = rootEntries*32; |
| 671 | rootClusters = rootBytes/bytesPerCluster + ((rootBytes%bytesPerCluster) ? 1 : 0); |
| 672 | } |
| 673 | |
| 674 | return strange == 0; |
| 675 | } |
| 676 | |
| 677 | void FatSystem::infos() |
| 678 | { |