Haiku and PXE

Hi,
does anyone have any information on building a Haiku image utilizing the recently added support for PXE? I’d be grateful for any info on this.

TIA

El-Al

Thanks for posting! Going to recite it lots of times until I understand it :o)

Is there an easy way to make PXE boot?

The up to date instructions on network booting are on the website:
https://www.haiku-os.org/guides/network_booting/

I think it is currently broken, however.

Where may I find the Jamfile that defines “pxehaiku-loader haiku-netboot-archive” targets ?

TARGET_BOOT_PLATFORM=pxe_ia32 jam -q pxehaiku-loader haiku-netboot-archive

Should be https://git.haiku-os.org/haiku/tree/src/system/boot/Jamfile#n314

oki thank you !

I managed to build the haiku-netboot.tgz image;

/BUILDBOX/haiku> ls -ltr generated/haiku-netboot.tgz 
-rw-r--r-- 1 user users 2120042 Nov  8 20:57 generated/haiku-netboot.tgz

Then I went to src/boot/loader/net,
typed “jam”, and got some interesting pieces;

/BUILDBOX/haiku> find generated/ | grep pxe | grep loader
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/ARP.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/ChainBuffer.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/Ethernet.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/IP.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/NetDefs.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/NetStack.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/RemoteDisk.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/TCP.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/UDP.o
generated/objects/haiku/x86_64/release/system/boot/loader/net/pxe_ia32/boot_net.a

But still the pxe loader does not seem to be ready … any more hint ?

jam does not work this way, it does not matter which directory you run it from. You need to specify a target. The command line you have quoted earlier should be correct:

TARGET_BOOT_PLATFORM=pxe_ia32 jam -q pxehaiku-loader

No such target …

/BUILDBOX/haiku/src/system/kernel/platform/pxe_ia32> TARGET_BOOT_PLATFORM=pxe_ia32 jam -q pxehaiku-loader
Starting build of type regular ... 
don't know how to make pxehaiku-loader
...patience...
...found 1 target(s)...
...can't find 1 target(s)...

Right, it appears to have been renamed to haiku-loader.pxe_ia32 in order to standardize the name accross different platforms

The command is “jam -q boot_loader_pxe_ia32”. For the BIOS: “jam -q boot_loader_bios_ia32”

Thanks ! the target compiles almost find but sometimes weird happens at link stage … related to arithmetic operations in gcc, as far as I understand. I get a bunch of:

(...)

ld: generated/objects/haiku/x86_64/release/system/boot/platform/bios_ia32/bios_ia32/boot_platform_bios_ia32.o: in function `add_block_devices(DoublyLinkedList<Node, DoublyLinkedListStandardGetLink<Node> >*, bool) [clone .part.8]':

devices.cpp:(.text+0x1c76): undefined reference to `__moddi3'

ld: generated/objects/haiku/x86_64/release/system/boot/arch/x86/bios_ia32/boot_arch_x86.o: in function `calculate_cpu_conversion_factor':

(.text+0x663): undefined reference to `__udivdi3'
 
(...)

Full output here : haiku-boot_loader_pxe_ia32-failure - Pastebin.com

Maybe I should update some buildtools or add some additionnal build flags ?

/BUILDBOX/haiku> gcc --version
gcc (2019_05_24) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

/BUILDBOX/haiku> uname -a
Haiku shredder 1 hrev54154+111 Jun 7 2020 07:16 x86_64 x86_64 Haiku

You cant directly build Haiku iso’s on 64 bit Haiku, use the cross-toolchain:
https://www.haiku-os.org/guides/building/compiling-x86_64/

1 Like

Ok great, using cross-toolchain, compilation went fine !

-rwxr-xr-x 1 user users 428675 Nov 21 16:14 generated/objects/haiku/x86_64/release/system/boot/bios_ia32/boot_loader_bios_ia32

Ok I made good progress !

Found pxehaiku-loader at https://www.freelists.org/post/haiku/Setting-up-Windows-to-boot-Haiku-through-PXE ). After seting up the dhcp + tftp server,

I successfully got an haiku boot menu !

Now, the remote_disk_server is up and running on my haiku server (192.168.1.42)

Now how do I set the “boot volume” ?
The source code says it’s something starting with /dev/disk/virtual/remote_disk/

It’s proably at this step that I should use previously compiled file “boot_loader_bios_ia32”, right ?

You do not need the “bios_ia32” loader if you use the pxe one. They are exclusive to each other.

For PXE booting, the boot volume options can be set in DHCP options. According to the official docs (https://www.haiku-os.org/guides/network_booting/) this should be set in the “next_server” and “filename” options, which you need to point to the machine running remote_disk_server. If you get this set up correctly, the loader will skip the bootmenu and go directly into loading the kernel from the root filesystem.