Code Monkey home page Code Monkey logo

riscv32_linux_from_scratch's Introduction

RISC-V 32-bit Linux From Scratch

RISC-V has a growing following with an increasing number of commercial vendors of RISC-V compliant cores, as well as many open-source implementations.
RISC-V has had a Linux port for a while, however only the 64-bit variant of RISC-V is well supported.

Whilst the 64-bit variant has distro support, the 32-bit target is somewhat unloved and it can be harder to build a working kernel for it.
There are build systems such as Yocto which enable complete Linux distributions for embedded systems to built.

This isn't that - this is a minimal GCC + Linux Kernel + Busybox build flow targetting RISC-V 32-bit (RV32IMA).

Getting Started

0. Build system deps

# Ubuntu
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev git libncurses-dev openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev

1. Cloning

To clone this repo;

git clone https://github.com/ultraembedded/riscv32_linux_from_scratch.git

2. Acquire external source

# Clone Busybox
make clone_busybox

# Clone Linux Kernel and checkout known working release for RV32
make clone_kernel

3. Clone and build toolchains

Skip this if you already have riscv32-unknown-elf-gcc and riscv32-unknown-linux-gnu-gcc already built;

# Clone toolchain repositories
make clone_toolchain

# Build riscv32-unknown-elf-gcc for RV32IM
make build_gcc_newlib

# Build riscv32-unknown-linux-gnu-gcc for RV32IMA
make build_gcc_linux

# This results in ./toolchain/riscv32im and ./toolchain/riscv32ima-linux being created after a long wait...

riscv32_linux_from_scratch's People

Contributors

ultraembedded avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

riscv32_linux_from_scratch's Issues

Steps to build the toolchain

Hi,
Thanks for the steps and code.
What are the commands to build the kernel image for RV32IM & RV32IMA

Step-2 does only get the source and Step-3 clones and builds the toolchain right?

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.