Reputation: 18288
I have a bootloader which assembles fine. Now I want to test it. My hope was to create a new Virtual box partion and somehow write this boot-loader directly to it. Is there a way to accomplish this easily?
Most guides I have seen take advantage of a boot-able USB drive. I would like to write directly to the partition.
I actually think it would be cool to basically copy paste the 512 bytes of my assembled bootloader code via a HEX editor into the VDI file (at the right offset) that Virtual Box uses as a hard-disk. That is assuming that will work, and that is possible. I noticed after offset 0x27c that the VDI "Partition" is zeroed.
Upvotes: 1
Views: 1124
Reputation: 8831
When I tried to do this, I wasn't able to find documentation about this, but by poking around with a hex editor I figured out that the MBR starts at offset 0x2000. Keep in mind that this typically contains the partition table, so your bootloader can only take up the first 440 bytes, not the entire 512.
Upvotes: 4