Skip to content
vimer edited this page Jun 14, 2024 · 13 revisions

Welcome to the yubos riscv32 wiki!

A. Start from source build

  1. git clone git://git.busybox.net/buildroot
  2. make qemu_riscv32_virt_defconfig
  3. make
  4. cd output/images/
  5. Download Debian riscv32 image(Step 1)
  6. modify start-qemu.sh (Step 2)

1 download riscv32 image

You can downlaod: pre-built Debian riscv32 ext2 image

[Update: now below the URL is 404, so it is not recommended to use this method] Or to make an ext2/4 format image by hand:

0. wget https://mirror.iscas.ac.cn/vimeros/yubos-extra/sid-riscv32-yubos-rootfs.tar.gz
1. sudo apt install e2fsprogs
2. sudo dd if=/dev/zero of=debian_rootfs.ext2 bs=1M count=1024
3. sudo mkfs.ext2 debian_rootfs.ext2
4. sudo mkdir /tmp/temp
5. sudo mount -o loop debian_rootfs.ext2 /tmp/temp/
6. sudo tar zxvf sid-riscv32-yubos-rootfs.tar.gz -C /tmp/temp
7. sudo umount /tmp/temp

2 start qemu

Modify start-qemu.sh as following:

Change -append "rootwait root=/dev/vda ro" into -append "init=/lib/systemd/systemd console=ttyS0 rw root=/dev/vda earlycon=sbi systemd.unit=runlevel1.target" then execute:

sudo bash start-qemu.sh

user: root

passwd: debian

B. Start from pre-built image

  1. riscv32 kernel image
  2. Debian riscv32 rootfs
  3. fw_jump.elf
qemu-system-riscv32 \
        -nographic -machine virt \
        -m 2G \
        -bios fw_jump.elf \
        -kernel Image \
        -drive file=debian_rv32_rootfs.ext2,format=raw,id=hd0  \
        -device virtio-blk-device,drive=hd0 \
        -append "init=/lib/systemd/systemd console=ttyS0 rw root=/dev/vda earlycon=sbi" \
        -device virtio-net-device,netdev=usernet \
        -netdev user,id=usernet,hostfwd=tcp::"$ssh_port"-:22

user:root passwd: debian