RISC-V Getting Started Guideというページがある。目的ベースで、QEMUやLinuxなどのオペレーティングシステムを動かすための方法や、様々なツールキットを動かすための情報がまとめられている。
前回WSLでビルドを試行して上手く行かなかったので、次はVirtualBox上でUbuntuを立ち上げてそちらでビルドしてみよう。使用したのは16.04.6 LTS (Xenial Xerus)だ。
色々試行した結果、どうもやはりctng-linuxでは上手く行かなようで、riscv-gnu-toolchainをダウンロードし直してビルドした。
その際、さらにriscv-gnu-toolchainのリビジョンもタグを打って調整しないと動作しなかった。tag: v20180629
でビルドした。
$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain $ git clone https://github.com/qemu/qemu $ git clone https://github.com/torvalds/linux $ git clone https://github.com/riscv/riscv-pk $ git clone https://github.com/michaeljclark/busybear-linux --recurse-submodules
これでフロー通りにビルドを行うと正しく構成できたようだ。
$ qemu-system-riscv64 -nographic -machine virt -kernel riscv-pk/build/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=busybear-linux/busybear.bin,format=raw,id=hd0 -device virtio-blk-device,drive=hd0