FPGA開発日記

カテゴリ別記事インデックス https://msyksphinz.github.io/github_pages , English Version https://fpgadevdiary.hatenadiary.com/

RISC-V Getting Started GuideのLinuxビルドを試す(2. VirtualBox Ubuntu 16.04 LTSで試す)

f:id:msyksphinz:20200503214338p:plain

RISC-V Getting Started Guideというページがある。目的ベースで、QEMULinuxなどのオペレーティングシステムを動かすための方法や、様々なツールキットを動かすための情報がまとめられている。

前回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

f:id:msyksphinz:20200504212907g:plain