[syslinux] Custom MBR

Geert Stappers stappers at stappers.nl
Sun Dec 14 01:32:33 PST 2008


Op 20081213 om 15:48 schreef YYZ:
> Hi,
> 
> I have a multi-boot setup with windows installed on the active primary
> partition. Now this partition is encrypted and the only way to boot
> windows is through a custom boot loader provided by the encryption
> software (which requires entering a pre-boot password to unlock the
> decryption key). Unfortunately, this boot loader is pretty lame (in terms
> of multi-boot capabilities) and is completely inflexible (in that, it must
> reside in mbr + unused sectors of track0 and cannot be relocated). However,
> it's first stage in the mbr can be backed up in a file and chainloaded (as
> long as subsequent stages in track0 are intact). Additionally, it won't
> boot windows unless this partition is active.
> 
> Now I could boot other operating systems by adding entries to the boot.ini
> of the encrypted windows system but this way, I would be required to enter
> the password even though those other operating systems that I finally boot
> are not encrypted. Not only that, this leads to the decryption keys loaded
> in the memory even when I'm not running encrypted windows.
> 
> Now I want to completely bypass this boot loader by overwriting its first
> stage in MBR with custom code (while keeping the windows partition active)
> to transfer control to syslinux installed in an available partition (which
> in my case is a logical drive). Once I'm in syslinux, I can easily start
> any operating system I want (even the encrypted windows by chainloading
> the original mbr that I backed up in a file).
> 
> Now, I looked at the syslinux mbr source (the newer version) and it
> appears to already have the code to parse the extended partition tables.
> With little modification, it should be possible to make it do what I want.
> Unfortunately, though somewhat familiar with assembly language, I don't
> think it's something I can pull-off myself.
> 
> That's the reason for my request to bundle such a custom mbr with
> syslinux - it could act as a first stage loader for an unconditional boot
> into syslinux. The users would be able to install this MBR into sector 0,
> set the correct byte to the # of partition where syslinux is installed
> (0,1,2,3 or primary 4 onwards for logical), and the MBR code would find,
> load and execute the corresponding boot sector. Once in syslinux, they
> can interactively decide which operating system they want to boot into.
> 
> Of course users can use the traditional mbr based on the activation flag,
> if they don't want this functionality.
> 
> Thanks!


To me it sounds like the wish of having multiple MBRs,
but that conflicts the rule of "there is only one master".

For another MBR, Master Boot Record, use another bootdevice.
Such as floppy disk or USB memory stick.

Write the MBR on that extra device with a bootloader _installer_
Don't do writing of MBR with  bootloader.
(a bootloader is for bootloading, sure not for writing boot information)


Cheers
Geert Stappers
-- 
Those who care about the discussion,
care about the discussion order,
they reply below the text.




More information about the Syslinux mailing list