Task switching is voluntary.
- Rust nightly-2024-10-31-x86_64-unknown-linux-gnu
- Be sure to add
rust-srccomponent, as it will be needed to build rust core library forx86_64-unknown-uefi. - Steps:
% cd /path/to/an-os-in-rust % rustup override set nightly-2024-10-31-x86_64-unknown-linux-gnu # This sets the toolchain for the an-os-in-rust directory. % rustup component add rust-src --toolchain nightly-2024-10-31-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.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=/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
arpingto 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.