NIC driver included!
- Rust 1.71.0-nightly (4a59ba4d5 2023-05-01) toolchain.
- Be sure to add
rust-src
component, as it will be needed to build rust core library forx86_64-unknown-uefi
. - Steps:
% rustup toolchain install --force nightly-2023-05-01 % rustup default nightly-2023-05-01-x86_64-unknown-linux-gnu # This sets default toolchain to nightly-2023-05-12 % rustup component add rust-src --toolchain nightly-2023-05-01-x86_64-unknown-linux-gnu # 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.efi
to\EFI\BOOT\bootx64.efi
in your virtual machine's EFI System Partition. - Copy the kernel executable
target/x86_64-unknown-aosir/debug/aosir
to\aosir
in 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=/home/tomoyat1/src/qemu/OVMF_CODE-with-csm.fd \ -hda fat:rw:/home/tomoyat1/src/qemu/hda \ -monitor stdio \ -drive if=pflash,format=raw,file=/home/tomoyat1/src/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
arping
to broadcast a ARP request, the results of parsing the ethernet frame header will be outputted to serial console.% sudo arping -I tap0 -U -S 192.168.11.16 192.168.11.1 // Both source and destination IP address don't matter now.