必要なツール

初回ビルドにはネットワーク接続が必要です.

ソースの取得

SSH

git clone --recurse-submodules \
  [email protected]:horizon2038/spencer.git spencer
cd spencer
git submodule status

HTTPS

git -c url."https://github.com/"[email protected]: \
  clone --recurse-submodules \
  https://github.com/horizon2038/spencer.git spencer
cd spencer
git submodule status

x86_64向けにビルドする

cargo xtask build \
  --arch x86-64 \
  --platform pc99 \
  --release
Kernelout/x86_64-pc99-release/a9n/kernel.elf
Loaderout/x86_64-pc99-release/a9nloader/a9nloader-rs.efi
Disk Imageout/x86_64-pc99-release/spencer.img

QEMUで起動する

cargo xtask run \
  --arch x86-64 \
  --platform pc99 \
  --release

シリアル出力

Nun - an operating system framework based on the A9N Microkernel
Configuring <init> ...
Configuring Initial IPC buffer to thread local storage...
Hello, world!
version: <kernel version>

ソフトウェアエミュレーションを使う場合は--accel offを追加します.

AArch64

cargo xtask build --arch aarch64 --platform qemu --release
cargo xtask run --arch aarch64 --platform qemu --release

複数のコアで実行する

仮想CPUを2個以上使う場合は--enable-smpが必要です.

cargo xtask run \
  --arch x86-64 \
  --platform pc99 \
  --release \
  --enable-smp \
  --smp 4