28. How to contribute to the kernel
28.1. Development Conventions
| item | value | | — | — | | C Language Standard | c99 (without gnu extensions) | | Constant macros | Allowed | | macro functions for inlining only (simply interchangeable with normal functions) | allowed | | Macro switches | Use with caution | | Other macro functions | In principle prohibited | | Macro splicing | In principle prohibited | | Normal variable naming | Underscore naming | | Ordinary function names | Underscore names | | Object property naming | Small camel case |
Note: For items prohibited in principle, if it is really necessary to use them, each use needs to be discussed separately.
28.2. Kernel development environment
28.2.1. Option 1 Development under Linux (recommended)
Linux environment recommended ubuntu20.04
installation steps:
step1: pull the project
git clone https://github.com/pikastech/pikascript cd pikascript/port/linux
step2: compile the project
sh install_dependency.sh # Install dependencies, run for the first time
sh pull-core.sh #pull the source code from the /src directory and run it for the first time
sh init.sh # run before the first compilation, no need to run after that
sh make.sh # compile the project
step3: run unit tests
sh gtest.sh
step4: run the benchmark
sh ci_benchmark.sh
step5: Submit source code
sh push-core.sh # Push source code to /src directory
git commit -a
git push
28.2.2. Scheme 2 pico real machine development
Prepare a copy of the Raspberry Pi pico development board, then clone the complete repository and use the bsp/pico-dev project in the repository.