OpenLegacyBoot: Add grub4dos (grldr) PBR detection support - #623
Conversation
482c7a2 to
42849a2
Compare
|
The change simply changes the name of the boot entry from what I understand. I.e. previously grub4dos would be detected as |
This is not just a title change. The core of this PR is adding grldr (grub4dos) PBR signature detection to Previously, OpenLegacyBoot only recognized three PBR signatures: A partition with grub4dos installed to its PBR contains the This PR adds a new detection branch: The boot entry title ("Grub4dos (legacy)") is adapted accordingly as a consequence, not the purpose of the PR. The use case is booting Windows 2000/XP (NT5): OpenLegacyBoot's direct ntldr boot has a DL register mapping issue on non-0x80 disks (ntldr requires the boot disk to be |
|
Right, might you want it to be detected as Windows for more native icons though? If not, I could merge as is. |
Please merge as-is. Keeping the title as "Grub4dos (legacy)" is intentional during the setup phase: grub4dos requires configuring Once configured, the entry name can be customized per-partition using OpenCore's built-in disk label mechanism, which already works with legacy boot entries:
OpenLegacyBoot already checks for this file via |
Summary
Adds grub4dos (
grldr) PBR detection to OpenLegacyBoot, allowing OC tochain-load grub4dos as a standalone legacy boot entry.
Background
OpenLegacyBoot currently detects
NTLDR,BOOTMGR, andISOLINUXPBRsignatures but not
grldr. grub4dos is a legacy (MBR) boot loaderchain-loaded via OpenLegacyBoot to boot NT5 systems (Windows 2000/XP).
Unlike Vista/7, which can boot natively via UEFI+GPT (requiring CSM only
for video), NT5 requires a full legacy BIOS environment and cannot boot
through UEFI at all. In OpenDuet or CSM-based UEFI systems,
ntldr'sstrict
DL=0x80requirement often fails because the firmware's diskenumeration differs from native BIOS. grub4dos serves as an intermediary
that performs the necessary drive mapping (
map () (hd0)) beforechain-loading
ntldr.With grldr detection, each NT5 installation can have its own grub4dos
PBR and appear as an independent entry in the OC picker, rather than
relying on a single shared grub4dos menu with multiple entries.
Changes
LegacyBootInternal.h: AddOcLegacyOsTypeGrldrenum value.LegacyBootSupport.c: Detect both"GRLDR"and"grldr"PBRsignatures. Case-insensitive search is required because FAT32 stores
directory entries in uppercase while NTFS preserves the original
lowercase filename.
OpenLegacyBoot.c: AddGrub4dos (legacy)entry name. Flavour reusesOC_FLAVOUR_WINDOWS(consistent with all existing legacy entries), sono new theme assets are required.
The existing
NTLDRdetection branch is preserved unchanged — partitionswithout grub4dos installed continue to appear as
Windows (legacy).Testing
grub4dos, boots Win2000 successfully.
mapworks correctly.Recommended menu.lst
For environments where the target disk may not be
hd0(e.g. OpenDuetdisk enumeration), a conditional map avoids errors on native BIOS boot: