On Tue, 2019-12-17 at 22:46 +0100, David Bala?ic via Syslinux
wrote:> Hi!
> I have bootable (USB flash) disk, that _appears_ to be using syslinux.
> (the word syslinux is in the PBR, in the hexdump).
> How can I chainload it? The payload seems to be a file that I tried
> load with COMBOOT, COM32 etc, but nothing works (they report that the
> file is not in proper format, wrong magic number or simply crash). How
> to proceed?
>
I'm not sure how to chainload the PBR, but assuming that syslinux is in the
MBR,
you might be able to boot it with QEMU.
in BIOS MODE:
$ qemu-system-x86_64 -machine accel=kvm -m 512 -drive file=$MY_FILE,format=raw
or in UEFI MODE:
$ cp /usr/share/edk2/ovmf/OVMF_VARS.fd .
$ qemu-system-x86_64 -machine accel=kvm -m 512 -drive
if=pflash,format=raw,unit=0,file=/usr/share/edk2/ovmf/OVMF_CODE.fd,readonly=on
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd -drive
file=$MY_FILE,format=raw
If syslinux isn't in the MBR, you might be able to put it there by
dd'ing
(gpt)mbr.bin to the file/device like so:
# dd bs=440 count=1 conv=notrunc,sync if=/usr/share/syslinux/gptmbr.bin
of="$MY_FILE"
Substitute "$MY_FILE" with the image of the device you are trying to
boot.
You probably want to make a backup copy of your flash disk before writing
anything to it.
Use mbr.bin instead of gptmbr.bin if the partition table is in "msdos"
format.
Be sure that the partition that you are trying to chainload is set
active/bootable using your favorite partition managing tool.
Good luck.