Giter Club home page Giter Club logo

bp-linux's Introduction

Linux on BlackParrot

This is the repository for building a RISC-V Linux binary for BlackParrot. We use Buildroot to generate a BusyBox root filesystem and we use OpenSBI as the machine-mode firmware. The following commands are run within this directory.

Build

make linux.riscv [WITH_SHELL=<path_to_sh_script>] [OPENSBI_NCPUS=<n>] [MEM_SIZE=<s>]
  • OPENSBI_NCPUS: Number of harts that boot linux (default: 1)
  • WITH_SHELL: If set, at the end of the boot, runs the given shell script instead of creating the BusyBox login shell.
  • MEM_SIZE: size in MB of memory (default: 64), sets memory size in device tree; current BP max is 2048

default login: user="root", password=""

Build Steps

The build order is [Buildroot -> sysroot generation -> Linux -> OpenSBI], so each step can be done seperately in the following order:

make buildroot
make sysroot [WITH_SHELL=<path_to_sh_script>]
make vmlinux
make opensbi [OPENSBI_NCPUS=<n>]

Adding Executables

To add your custom binaries and files to the root filesystem:

  • First, generate the work/sysroot directory by running make sysroot.
  • Next, add the binaries to the work/sysroot directory.
  • Finally, proceed with the linux and opensbi build by running make linux.riscv.

Example: Adding custom binaries to a quad-core SMP Linux with user terminal:

make sysroot
cp <binaries> work/sysroot/bin/.
make linux.riscv OPENSBI_NCPUS=4

Clean

The following commands can be used to clean the work directory. Cleaning each step also wipes the next steps.

make clean
make clean_buildroot
make clean_sysroot
make clean_vmlinux
make clean_opensbi

For example, to rebuild linux for a different OPENSBI_NCPUS value you can wipe the opensbi build and rebuild with the new number of cores:

make clean_opensbi
make linux.riscv OPENSBI_NCPUS=<new_n>

Or to change the initial shell script, you can wipe the sysroot folder and regenerate it with the new script:

make clean_sysroot
make linux.riscv WITH_SHELL=<new_shell>

bp-linux's People

Contributors

dpetrisko avatar farzamgl avatar muwyse avatar yuan-mao avatar taylor-bsg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.