gcc for aarch64 is required (version 5.4 is tested)
(aarch64-linux-gnu-gcc v7.4.0 is tested & aarch64-linux-gnu-ld v2.30 is tested)
qemu-4.1 is tested; >= qemu-3.1
fastboot
We suggest to build the project with the provided docker enviroment.
For full-build:
make build
or
./docker_build.sh aarch64 full (default)
./docker_build.sh x86_64 full
If you have done full-build and do not further modify libc, you can use fast-build.
For fast-build (do not compile libc):
make fastbuild
or
./docker_build.sh aarch64 fast
./docker_build.sh x86_64 fast
Check the usage:
./docker_build.sh help
make qemu
or
cd build && ./simulate.sh
Please refer to this document
./scripts/chcore_sys_tests.exp
Turn the switch 1 & 3 to ON state and switch 2 & 4 to OFF state
./docker_build.sh hikey full
./docker_build.sh hikey fast
For the first time, download Lebian from 96board and run
sudo fastboot flash boot boot-hikey970.uefi.img
Then turn the switch 3 to OFF and find a type-c cable and connect to the DEBUG-UART.
Press the RESET button and you are ready to go.
build the image rootfs.img
rm -rf build
sh ./docker_fastbuild.sh -DCHCORE_PLAT=hikey970
cd tools/hikey970
sudo sh ./build_rootfs.sh
scp the rootfs.img to the machine where the shared Hikey970 resides
scp rootfs.img hikey@chcore-pi:~
ssh to the machine where the shared Hikey970 resides
ssh hikey@chcore-pi
run
./flash.sh
sudo minicom
Infer v0.17.0 is the latest release (2019.10.8)
brew install infer
VERSION=0.17.0; \
curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \
| sudo tar -C /opt -xJ && \
ln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer
mkdir build && cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DFBINFER=1 ..
infer capture --compilation-database compile_commands.json
infer analyze
see tests/README.md
To enable kernel tests, using the following commend to compile the kernel:
./docker_build.sh xxx xxx tests
Requirements:
- Please use #pragma once (instead of #ifndef) in header files.
- Put all header files in kernel/include directory and, especially, put the architecture-dependent ones in kernel/include/arch/xxx/arch/ (e.g., kernel/include/arch/aarch64/arch/) directory.
Please use tools/checkpatch/scripts/checkpatch.pl to check the style of your source code before committing.
The checkpatch is a submodule and you need to pull it via
git submodule init
git submodule update
and use it as follows:
./tools/checkpatch/scripts/checkpatch.pl -f foo.c
We only enable basic unit test and fbinfer when issuing a new merge request.
When you need to merge into the master, you have to trigger the full tests manually.
- Go to
CI/CD -> Pipelines. - Click
Run Pipeline. - Select the branch you want to merge.
- Click the
Run Pipelinebutton`.
The CI machine is named yyf@ci.
If gitlab CI crashes, you can log in that machine and execute pkill gitlab-runner
git clone https://github.com/kasbert/epsolar-tracer.git
cd epsolar-tracer/xr_usb_serial_common-1a
make
sudo rmmod cdc_acm
sudo insmod ./xr_usb_serial_common.ko-
TRACE_SYSCALL(disabled by default) inuser/musl-1.1.24/src/chcore-port/syscall_dispatcher.ccontrols whether to print all syscall invocations in libc. Not all syscalls are printed. Exceptions include:- SYS_sched_yield (generated too frequently);
- SYS_writev, SYS_ioctl and SYS_read (used in printf);
- SYS_io_submit (used in printf?).
-
kernel/include/common/debug.hdefines the kernel debugging options which can ease the procedure of bug hunting.