Index: boot/freeldr/freeldr/arch/realmode/helpers.inc =================================================================== --- boot/freeldr/freeldr/arch/realmode/helpers.inc (revision 74470) +++ boot/freeldr/freeldr/arch/realmode/helpers.inc (working copy) @@ -106,6 +106,7 @@ /* Load segment registers */ cli xor ax, ax + mov dl, byte ptr FrldrBootDrive mov ds, ax mov es, ax mov fs, ax Index: boot/freeldr/freeldr/miscboot.c =================================================================== --- boot/freeldr/freeldr/miscboot.c (revision 74470) +++ boot/freeldr/freeldr/miscboot.c (working copy) @@ -34,6 +34,8 @@ CHAR FileName[260]; PFILE FilePointer; ULONG BytesRead; + CHAR SettingValue[80]; + UCHAR DriveNumber; /* Find all the message box settings and run them */ UiShowMessageBoxesInSection(SectionName); @@ -51,6 +53,15 @@ return; } + /* Read the boot drive */ + if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, sizeof(SettingValue))) + { + UiMessageBox("Boot drive not specified for selected OS!"); + return; + } + + DriveNumber = DriveMapGetBiosDriveNumber(SettingValue); + FilePointer = FsOpenFile(FileName); if (!FilePointer) { @@ -85,6 +96,7 @@ */ // DiskStopFloppyMotor(); // DisableA20(); + FrldrBootDrive = DriveNumber; ChainLoadBiosBootSectorCode(); }