open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
73 stars 99 forks source link

Support RISC-V arch for device agent #2373

Open gavingao-vto opened 3 years ago

gavingao-vto commented 3 years ago

Hi @dabooz , Do we need risc-v platform support on agent side? I'm doing some work on risc-v platform.


Examples repo:  https://github.com/open-horizon/examples

Examples that need to be ported: edge/services/cpu_percent edge/services/gps edge/services/helloworld edge/services/helloMMS edge/services/nginx-operator edge/evtstreams/cpu2evtstreams

RISC-V ubuntu image: https://cdimage.ubuntu.com/ubuntu-server/focal/daily-preinstalled/current/focal-preinstalled-server-riscv64.img.xz

Booting risc-v platform with qemu: xz -dk focal-preinstalled-server-riscv64.img.xz Optionally, if you want larger disk, you can expand the disk (filesystem will be automatical> qemu-img resize -f raw focal-preinstalled-server-riscv64.img +5G

Next use OpenSBI bootloader & u-boot-qemu to boot the virtual machine Working example with all the options is:

qemu-system-riscv64 \ -machine virt -nographic -m 2048 -smp 4 \ -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \ -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \ -device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \ -drive file=focal-preinstalled-server-riscv64.img,format=raw,if=virtio The important options to use are: Machine type virt aka -machine virt Bios is OpenSBI -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf "kernel" is qemu smode uboot -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf One can use pass through networking, adjust memory (-m) & cpu counts (-smp) as needed. Switch to the serial console, wait for cloud-init to complete, then login using ubuntu:ubuntu. See the cloud-init section below to further customise the first boot behaviour with cloud-init.

anax porting work :

davidyao19 commented 3 years ago

RISC-V is booming in China market, and I think, globally it's growing faster too. I just got this new that MIPS joined RISC-V camp too. It will be nice if we can have RISC-V support in open horizon.

losdevnull commented 3 years ago

More on RISC-V and why it is getting more attractions in China market.
https://techmonitor.ai/techonology/hardware/risc-v-arm-nvidia-intel-open-source