diff --git a/src/userland/mbr/main.c b/src/userland/mbr/main.c index 6b8fe83..10883d3 100644 --- a/src/userland/mbr/main.c +++ b/src/userland/mbr/main.c @@ -21,6 +21,14 @@ } for (uint32_t entry = 0; entry < 4; entry++) { PartitionTableEntry *partition = &device->mbr->entries[entry]; + if (partition->lbaStart == 0 || + (partition->startCHS[0] == 0 && + partition->startCHS[1] == 0 && + partition->startCHS[2] == 0)) { + // starting at the first block, this partition does not exist + // skip it + continue; + } printf("partition %i: %i: start: %i, end: %i, active: %i\n", entry, partition->type, partition->lbaStart, partition->lbaStart + partition->sectorCount, partition->active); if (partition->type == 0xEE) { printf("partition %i is a GPT\n", entry);