mkfat: zero out disk as part of format

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-06-12 18:56:10 +08:00
parent 723143e36f
commit cf239b9b7a
1 changed files with 8 additions and 0 deletions

View File

@ -159,5 +159,13 @@ int fat12_mkfs(struct pang_io *io, uint32_t bytes) {
offset += sector_size;
}
// Fill in the rest of the disk
while (offset < bytes) {
if (pang_write(io, offset, mbr, sizeof(mbr)) != sizeof(mbr)) {
return -1;
}
offset += sector_size;
}
return 0;
}