To start off with development for RISCV, we need to make sure that we have environment setup correctly.
- The easiest and fast way to start off the development is by spinning off Docker Container with RISCV emulation, and this is the best image to use : Docker_RISCV_Image
Internally it spins up the qemu so if you dont want to use docker container feel free to use the commands listed in Dockerfile
OR
- You can follow the guide listed on qemu page. RISCV_Getting_Started
Once first step is done, next step consist of installing required libs to start working with CRIU
- Can be installed using :
apt-get update
apt-get install -y asciidoc wget autoconf curl g++ libtool gcc git libbsd-dev
apt-get install -y libtool gcc automake make vim libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler protobuf-compiler
This are the only probably libs you will be needing to start compiling CRIU
-
CRIU is divided into two parts, main part of CRIU is something called as compel, more on compel here : compel
-
CRIU allows to compile the compel seprately from rest of the code. And it can be done using
make install-compel
-
With current progress, our
make install-compel
succeeds, that means installation is all correct syntactically. -
To know where we are messing up, we can test compel only by running any of the tests given in : tests
-
But the problem with this step is it expects something called as
compel-host-bin
and this part is generated when you do make install (Ugh I know its bit messed up .) -
So right now what you can do is do : make clean in main dir and then instead of using
make install-compel
domake install
. -
Now when make install runs, its gonna break but its going to succeed till the point where it's going to generate compel host bin (as described in step 7)
-
After this you can go back to step 6. i.e testing. Now as described before compel gets installed flawlessly but syntactically and not logically.
-
So because of this, when you start compiling your one of the test current issue which is breaking is RELOCATIONS. Which are define here : https://github.com/ssrg-vt/criu-riscv/blob/master/compel/src/lib/handle-elf.c#L483
General Notes:
-
Most of the architecture specific code is in compel and we are quite closer to porting compel for RISCV.
-
Once compel is installed and tested correctly next thing to be looked at is ofcourse installing CRIU as whole but there should not be lot of issues.
-
There are few assembly files which are all compel inside aarch folder. Most of the assembly files are migrated.
-
So we had copied code of Aarch64 and have renamed it to RISCV (tdd). So the code you are seeing right now in the RISCV folder is all aarch64 (if its not migrated).