Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Booting Harvey on real hardware I (TFTP)

Graham MacDonald edited this page Sep 10, 2020 · 16 revisions

One of the goals of every operating system has is to run in a real machine. This how to covers a method for booting from network through PXE. You will need:

  • A working computer of x86_64 (amd64) architecture PXE booting capable (check your BIOS or UEFI settings).
  • A Local Area Network (LAN) ready.
  • Another computer which will be the host, running the tftp and http server for the kernel (pxeserver) and the 9p file server (ufs)

We'll cover for this case a host with Linux and an empty "dumb" machine for booting Harvey. So if you're using one of the other platforms covered in Getting Started, just follow the proper instructions for your platform there. You won't need any disk support for this since the main file server will be served by the Linux host machine.

Preparing the host

  1. Build harvey
  2. Create the file $HARVEY/cfg/pxe/tftpboot/pxelinux.cfg/default, and paste the following into it, taking care to change the references to 192.168.0.19 with the IP address of the machine that will run pxeserver and ufs:
DEFAULT harvey
LABEL harvey
  KERNEL mboot.c32
  APPEND http://192.168.0.19/harvey.32bit service=cpu nobootprompt=tcp maxcores=1024 fs=192.168.0.19 auth=192.168.0.19 nvram=/boot/nvram nvrlen=512 nvroff=0 acpiirq=1
  1. Edit your /etc/hosts file to add the following file, taking care to replace the IP and MAC addresses with those from your host machine running centre:
192.168.0.100	centre		u9c:b6:d0:88:80:cf
  1. Run centre, taking care to change the interface to that of the machine running centre:
sudo $HARVEY/linux_amd64/bin/centre \
  -i wlp2s0 \
  -bootfilename lpxelinux.0 \
  -tftp-dir $HARVEY/cfg/pxe/tftpboot \
  -http-dir $HARVEY/cfg/pxe/tftpboot \
  -rootpath $HARVEY/cfg/pxe/tftpboot \
  -ninep-dir $HARVEY

Preparing the target

If your machine has UEFI, ensure you disable any security measure which could break the load of a kernel through the network. Then, BIOS/UEFI, select as primary device the network card and enable PXE protocol. This could be very different between vendors, so please read the manual of your motherboard: it always has worth.

Once done, just reboot the machine and wait for loading Harvey kernel and see how it boots a cpuserver. Connect to it through a drawterm.

Booting with iPXE

If your Harvey host runs iPXE, we can skip the use of PXELINUX and do everything we need from iPXE instead.

  1. Set up centre as above.
  2. Create $HARVEY/cfg/pxe/tftpboot/ipxe and put the following in it, replacing the IP address with the IP of the machine which runs the dhcp/tftp/http servers:
#!ipxe
dhcp
kernel http://192.168.0.254/harvey.32bit service=cpu nobootprompt=tcp maxcores=1024 fs=192.168.0.254 auth=192.168.0.254 nvram=/boot/nvram nvrlen=512 nvroff=0 acpiirq=1
boot
  1. Run centre as above, but with a different bootfilename (remember to change the interface!):
sudo $HARVEY/linux_amd64/bin/centre \
  -i wlp2s0 \
  -bootfilename lpxelinux.0 \
  -tftp-dir $HARVEY/cfg/pxe/tftpboot \
  -http-dir $HARVEY/cfg/pxe/tftpboot \
  -rootpath $HARVEY/cfg/pxe/tftpboot \
  -ninep-dir $HARVEY
  1. Boot your Harvey box. iPXE should fetch the "ipxe" file via TFTP, which then instructs it to grab the kernel over HTTP and boot it.

If you're already running the ISC dhcpd, you should disable the DHCP service on pxeserver (add the flag -4=false to the command), then add the following to your dhcpd.conf entry for the Harvey system:

        filename "ipxe";
        server-name "192.168.0.254";
        next-server 192.168.0.254;
Clone this wiki locally