mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-26 02:20:31 +03:00
mbr: Make detection more lax. Addresses #185
This commit is contained in:
parent
ff7d9502e5
commit
c23eac8018
@ -248,10 +248,6 @@ bool is_valid_mbr(struct volume *volume) {
|
||||
// Check if actually valid mbr
|
||||
uint16_t hint = 0;
|
||||
|
||||
volume_read(volume, &hint, 510, sizeof(uint16_t));
|
||||
if (hint != 0xaa55)
|
||||
return false;
|
||||
|
||||
volume_read(volume, &hint, 446, sizeof(uint8_t));
|
||||
if ((uint8_t)hint != 0x00 && (uint8_t)hint != 0x80)
|
||||
return false;
|
||||
|
@ -616,18 +616,6 @@ int main(int argc, char *argv[]) {
|
||||
uint8_t hint8 = 0;
|
||||
uint16_t hint16 = 0;
|
||||
|
||||
device_read(&hint16, 510, sizeof(uint16_t));
|
||||
hint16 = ENDSWAP(hint16);
|
||||
if (hint16 != 0xaa55) {
|
||||
if (!force_mbr) {
|
||||
mbr = 0;
|
||||
} else {
|
||||
hint16 = 0xaa55;
|
||||
hint16 = ENDSWAP(hint16);
|
||||
device_write(&hint16, 510, sizeof(uint16_t));
|
||||
}
|
||||
}
|
||||
|
||||
bool any_active = false;
|
||||
|
||||
device_read(&hint8, 446, sizeof(uint8_t));
|
||||
|
Loading…
Reference in New Issue
Block a user