| 164 | |
| 165 | private: |
| 166 | void mount() |
| 167 | { |
| 168 | _rootBlock = getLogicalSector(0); |
| 169 | _catBlock = getLogicalSector(9); |
| 170 | Bytes directory = getLogicalSector(1, 8); |
| 171 | |
| 172 | ByteReader rbr(_rootBlock); |
| 173 | rbr.seek(20); |
| 174 | _volumeLabel = trimWhitespace(rbr.read(44)); |
| 175 | |
| 176 | _dirents.clear(); |
| 177 | ByteReader dbr(directory); |
| 178 | while (!dbr.eof()) |
| 179 | { |
| 180 | Bytes direntBytes = dbr.read(16); |
| 181 | if ((direntBytes[0] != 0) && (direntBytes[0] != 0xff)) |
| 182 | { |
| 183 | auto dirent = |
| 184 | std::make_unique<MicrodosDirent>(*this, direntBytes); |
| 185 | _dirents.push_back(std::move(dirent)); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | ByteReader cbr(_catBlock); |
| 190 | _totalBlocks = 630; |
| 191 | _usedBlocks = 0; |
| 192 | for (int i = 0; i < _totalBlocks / 8; i++) |
| 193 | { |
| 194 | uint8_t b = cbr.read_8(); |
| 195 | _usedBlocks += countSetBits(b); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | std::shared_ptr<MicrodosDirent> findFile(const std::string filename) |
| 200 | { |
nothing calls this directly
no test coverage detected