Eun
Eun

Reputation: 4178

Can a FSBL load another FSBL?

I am currently exploring the bootloader world.

However I asked myself if it is possible for a first stage bootloader to load and run another first stage bootloader. (lets say it lays on a FAT partition)

If so what would be the preferred way?
If not why?

Upvotes: 0

Views: 48

Answers (1)

Margaret Bloom
Margaret Bloom

Reputation: 44116

Just be sure to:

  1. Load the new FSBL in the proper segment.
    This usually means 0000:7c00 that in turns imply that you have to overwrite your current bootloader.
    You can relocate a routine (that you cared to make position independent) that could be as simple as setting ds:si, es:di and cx for a (slow) rep movsb/w/d.

  2. Set the registers properly.
    The BIOS hands control to the FSBL with definite register values (see section 6.5.1 of the relative specifications), you have to save those values (even to fixed memory locations) and restore them.

Some bootloaders could be additional constrains for a successful chainload.

Upvotes: 3

Related Questions