mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Fix booting from "inactive" MBR partitions
Apparently you can boot from any MBR partition, not just the one labeled as "bootable" or "active". The only ones you don't want to boot from are the ones that don't exist.
This commit is contained in:
parent
de65c960e9
commit
842bf96e2c
Notes:
sideshowbarker
2024-07-19 13:40:30 +09:00
Author: https://github.com/deoxxa Commit: https://github.com/SerenityOS/serenity/commit/842bf96e2cb Pull-request: https://github.com/SerenityOS/serenity/pull/212
@ -53,9 +53,17 @@ RetainPtr<DiskPartition> MBRPartitionTable::partition(unsigned index)
|
|||||||
kprintf("MBRPartitionTable::partition: status=%#x offset=%#x\n", entry.status, entry.offset);
|
kprintf("MBRPartitionTable::partition: status=%#x offset=%#x\n", entry.status, entry.offset);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (entry.status == 0x00) {
|
if (entry.offset == 0x00) {
|
||||||
|
#ifdef MBR_DEBUG
|
||||||
|
kprintf("MBRPartitionTable::partition: missing partition requested index=%d\n", index);
|
||||||
|
#endif
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MBR_DEBUG
|
||||||
|
kprintf("MBRPartitionTable::partition: found partition index=%d type=%x\n", index, entry.type);
|
||||||
|
#endif
|
||||||
|
|
||||||
return DiskPartition::create(m_device.copy_ref(), entry.offset);
|
return DiskPartition::create(m_device.copy_ref(), entry.offset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user