feat: fixed some bugs for running on real hardware

This commit is contained in:
2021-03-05 22:23:39 +01:00
parent e532099ea7
commit 310f3621a2
6 changed files with 43 additions and 15 deletions

View File

@@ -123,6 +123,11 @@ void print_chars(char *chars, int amount) {
uint8_t fat_check_device(const block_device *device, uint8_t *first_sector) {
fat_bpb bpb;
memcpy((uint8_t *) &bpb, first_sector, sizeof(fat_bpb));
if (bpb.bpb.sectors_per_fat == 0 || bpb.bpb.sectors_per_cluster == 0) {
printf("Definitely not FAT\n");
return BLOCK_DEV_DRIVER_CHECK_NO_MATCH;
}
printf("OEM: ");
print_chars(bpb.bpb.oem_identifier, 11);
printf("\n");