Responding to arping
- Rust nightly-2026-05-31
- Be sure to add
rust-srccomponent, as it will be needed to build rust core library forx86_64-unknown-uefi. - Linux host
% cd /path/to/an-os-in-rust % rustup toolchain install nightly-2026-06-26-x86_64-unknown-linux-gnu % rustup override set nightly-2026-06-26-x86_64-unknown-linux-gnu # This sets the toolchain for the an-os-in-rust directory. % rustup component add rust-src --toolchain nightly-2026-06-26-x86_64-unknown-linux-gnu # This adds the `rust-src` component for the nightly toolchain
- macOS host
% cd /path/to/an-os-in-rust % rustup toolchain install nightly-2026-06-26-aarch64-apple-darwin % rustup override set nightly-2026-06-26-aarch64-apple-darwin # This sets the toolchain for the an-os-in-rust directory. % rustup component add rust-src --toolchain nightly-2026-06-26-aarch64-apple-darwin # This adds the `rust-src` component for the nightly toolchain
- Be sure to add
- An UEFI compatible machine (Tested on QEMU with OVMF)
The following will build both the bootloader and the kernel. Results will be found under target/.
% make- Copy the bootloader executable
target/x86_64-unknown-uefi/debug/bootx64.efito\EFI\BOOT\bootx64.efiin your virtual machine's EFI System Partition. - Copy the kernel executable
target/x86_64-unknown-aosir/debug/aosirto\aosirin your virtual machine's EFI System Partition. - Turn on your machine.
% sudo qemu-system-x86_64 \ -S \ -gdb tcp:localhost:1234 \ -drive if=pflash,format=raw,readonly,file=./qemu/OVMF_CODE-with-csm.fd \ -hda fat:rw:./qemu/hda \ -monitor stdio \ -drive if=pflash,format=raw,file=./qemu/OVMF_VARS-with-csm.fd \ -d cpu_reset \ -m 4096 \ -nic tap,ifname=tap0,model=rtl8139
- Observe that it does nothing useful ;)
- If you use
arpingto broadcast an ARP request, the kernel will respond.% sudo arping -I tap0 -U -S 192.168.16.1 192.168.16.40 ARPING 192.168.16.40 42 bytes from 52:54:00:12:34:56 (192.168.16.40): index=0 time=13.679 msec 42 bytes from 52:54:00:12:34:56 (192.168.16.40): index=1 time=7.824 msec 42 bytes from 52:54:00:12:34:56 (192.168.16.40): index=2 time=6.584 msec 42 bytes from 52:54:00:12:34:56 (192.168.16.40): index=3 time=4.954 msec ... ...