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

Linux environment recommended ubuntu20.04

installation steps:

step1: pull the project

  1. git clone https://github.com/pikastech/pikascript cd pikascript/port/linux

step2: compile the project

  1. sh install_dependency.sh # Install dependencies, run for the first time
  2. sh pull-core.sh #pull the source code from the /src directory and run it for the first time
  3. sh init.sh # run before the first compilation, no need to run after that
  4. sh make.sh # compile the project

step3: run unit tests

  1. sh gtest.sh

step4: run the benchmark

  1. sh ci_benchmark.sh

step5: Submit source code

  1. sh push-core.sh # Push source code to /src directory
  2. git commit -a
  3. 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.