Partition Table: Allow to boot with a partition number higher than 4

This is true currently only to GUID partitions,
Booting with an MBR partition is still limited to partition numbers 1-4.
This commit is contained in:
Liav A 2020-02-01 18:25:14 +02:00 committed by Andreas Kling
parent a3113721d4
commit 5d760bf172
Notes: sideshowbarker 2024-07-19 09:43:39 +09:00

View file

@ -251,11 +251,6 @@ void init_stage2()
hang();
}
if (partition_number < 1 || partition_number > 4) {
kprintf("init_stage2: invalid partition number %d; expected 1 to 4\n", partition_number);
hang();
}
MBRPartitionTable mbr(root_dev);
if (!mbr.initialize()) {
@ -278,6 +273,10 @@ void init_stage2()
root_dev = *partition;
} else {
dbgprintf("MBR Partitioned Storage Detected!\n");
if (partition_number < 1 || partition_number > 4) {
kprintf("init_stage2: invalid partition number %d; expected 1 to 4\n", partition_number);
hang();
}
auto partition = mbr.partition(partition_number);
if (!partition) {
kprintf("init_stage2: couldn't get partition %d\n", partition_number);