mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-23 09:02:11 +03:00
fat: Loosen up check more and lower its priority in file.s2.c
This commit is contained in:
parent
afedae6d08
commit
b1672e4ab9
@ -111,22 +111,20 @@ static int fat32_init_context(struct fat32_context* context, struct volume *part
|
||||
|
||||
// Checks for FAT12/16
|
||||
if (strncmp((((void *)&bpb) + 0x36), "FAT", 3) == 0) {
|
||||
if (*(((uint8_t *)&bpb) + 0x26) != 0x29) {
|
||||
return 1;
|
||||
}
|
||||
uint8_t sig = *(((uint8_t *)&bpb) + 0x26);
|
||||
|
||||
goto valid;
|
||||
if (sig == 0x29 || sig == 0xd0) {
|
||||
goto valid;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks for FAT32
|
||||
if (strncmp((((void *)&bpb) + 0x52), "FAT", 3) == 0) {
|
||||
uint8_t sig = *(((uint8_t *)&bpb) + 0x42);
|
||||
|
||||
if (sig != 0x29 && sig != 0x28 && sig != 0xd0) {
|
||||
return 1;
|
||||
if (sig == 0x29 || sig == 0x28 || sig == 0xd0) {
|
||||
goto valid;
|
||||
}
|
||||
|
||||
goto valid;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
@ -60,15 +60,15 @@ struct file_handle *fopen(struct volume *part, const char *filename) {
|
||||
if ((ret = ext2_open(part, filename)) != NULL) {
|
||||
goto success;
|
||||
}
|
||||
if ((ret = fat32_open(part, filename)) != NULL) {
|
||||
goto success;
|
||||
}
|
||||
if ((ret = iso9660_open(part, filename)) != NULL) {
|
||||
goto success;
|
||||
}
|
||||
if ((ret = ntfs_open(part, filename)) != NULL) {
|
||||
goto success;
|
||||
}
|
||||
if ((ret = fat32_open(part, filename)) != NULL) {
|
||||
goto success;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user