NetBSD boot vs multiboot with syslinux (FAIL)

Requirements

English please, and no colors

export LANG=C
export LC_MESSAGES=C
alias ll='ls -alkF'
echo 'syn off' >> ~/.vimrc
apt update
apt install -y man-db manpages mlocate

THE SYS/EXTLINUX WAY

apt install -y syslinux-utils extlinux

cfdisk...
mkfs.ext2...

mount /dev/sda1 /mnt/
ls -lF /mnt/
rm -f /mnt/syslinux/
mkdir /mnt/syslinux/

extlinux -v # 6.03
extlinux -i /mnt/syslinux
#extlinux -i /mnt/syslinux --device /dev/sda1

updatedb
locate mbr.bin
locate libcom32.c32
locate mboot.c32

ls -lhF /usr/lib/EXTLINUX/mbr.bin # 440 bytes
dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda conv=notrunc status=progress

cp /usr/lib/syslinux/modules/bios/libcom32.c32 /usr/lib/syslinux/modules/bios/mboot.c32 /mnt/syslinux/

check the timestamps

ls -lhF /mnt/syslinux/
ls -lhF /mnt/netbsd*

netbsd/pxeboot

cp base/usr/mdec/boot pxeboot_ia32.bin /mnt/

vi /mnt/syslinux/extlinux.conf

prompt 1
timeout 30
default netbsd/boot

label netbsd/boot
        kernel boot

label netbsd/pxeboot
        kernel pxeboot_ia32.bin

When trying to chainload netbsd/pxeboot from EXTLINUX on ext2, and in turns when it loads netbsd or netbsd.gz

pxe_init: bad cksum (0x82) for !PXE at 0x23be2

==> probably netbsd/pxeboot is trying to load something from the network and cannot access ext2/a9/NetBSD DOS partition. We rather need the boot loader to tackle hd0e:netbsd.

pxeboot cannot understand this, it rather supports NFS and TFTP.

boot hd0a:netbsd

Now when trying boot instead

Booting kernel failed: Invalid argument

==> probably boot is not loadable by syslinux, although it is a DOS executable (COM) file.

MULTIBOOT

cd /mnt/
wget http://lab.nethence.com/elge/netbsd.genericmulti
cd ~/

cp netbsd-GENERIC.gz netbsd.gz MD5 netbsd /mnt/
vi /mnt/syslinux/extlinux.conf

prompt 1
timeout 30
default netbsd.gz

label netbsd.genericmulti
        kernel mboot.c32
        append netbsd.genericmulti

label netbsd.gz
        kernel mboot.c32
        append netbsd.gz

label netbsd
        kernel mboot.c32
        append netbsd

FAIL – When trying to boot netbsd.gz directly from EXTLINUX on ext2/a9/NetBSD DOS partition

Invalid Multiboot image: neither ELF header nor a.out kludge found

READY TO GO

cd ~/
sync
mount | grep sda
umount /mnt/dev
umount /mnt

and finally SWITCH TO NORMAL MODE from the Online.net user interface.

Troubleshooting

netbsd/pxeboot

When trying to load extlinux 6.04

Failed to load ldlinux.c32

==> use a 6.03 release or 6.04-pre1, not pre2 nor pre3

Resources

netbsd/pxeboot

MULTIBOOT


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun