Ports/riscv64
RISC-V
RISC-V is an open and free instruction set architecture (ISA). The RISC-V ISA specifications are licensed under a Creative Commons license (CC BY 4.0). Anyone could get the final versions of the user-level ISA specifications and drafts of the compressed and privileged ISA specifications.
Another key feature of the RISC-V architecture that it is scalable and allows multiple implementations. The minimal specification has the commands to store and load, jump and integer arithmetic. It supports the 32-, 64- and 128-bit register sizes: "RV32I, RV64I and RV128I" ("I" stands for integer). This Linux port runs on "RV64IMAFDC" or "RV64GC" ("G" == "IMAFD"):
- I - Integer and basic instructions
- M - Multiply and divide
- A - Atomic operations
- F - Single precision floating point
- D - Double precision floating point
- C - Compressed instructions
At this page one could find the latest information about the status of the ALT porting to the new platform - RISC-V (RV64GC). The ALT port is building on the HiFive Unleashed board from SiFive.
Working plan
- The following Linux kernels has been bare metal tested on SiFive HiFive Unleashed:
- BOOT methods:
- Berkeley bootloader -- DONE
- U-BOOT (link) -- DONE
- Sisyphus port -- IN PROGRESS
- Toolchain (see the status above) -- DONE
- Linux Kernel -- DONE
- X11 -- DONE
- Desktop Environment -- IN PROGRESS
- ALT image metaprofile -- IN PROGRESS
- Girar Builder -- IN PROGRESS
- QEMU image (see below) -- DONE
One could find the rootfs latest snapshot (Nov 2018) at here. The RPM/SRPM repository at here.
QEMU
To run the ALT RISC-V port on QEMU one need to install the QEMU with riscv64 support.
In case of the ALT x86-64 host system for example: qemu-system-riscv-core.
Next stuff are needed:
- rootfs -- raw image or to build a new one there is a tgz packed version
- kernel for QEMU
After this steps were done it's time to run a kernel!
(possibly need to change path to the kernel and rootfs according to particular system)
qemu-system-riscv64 \
-nographic -machine virt -kernel /boot/vmlinux-4.19.6-un-def-alt3 \
-drive file=rootfs.raw,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 \
-append "earlyprintk root=/dev/vda rootwait fastboot console=ttyS0 debug sunrpc.debug STOP=udev" \
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
To log-in to the shell: Username: root Password: 123
Useful links:
- Berkeley bootloader utils to merge the linux kernel in to the bbl.bin with the dummy payload.
- RISC-V specifications
- All Aboard -- cool series of blog posts by Palmer Dabbelt about RISC-V, toolchain, etc.
- OSSDEVCONF-2018 (russian language)