Giter Club home page Giter Club logo

riscv-linux's Introduction

Linux/RISC-V

This is a port of Linux kernel for the RISC-V instruction set architecture. Development is currently based on the 4.6 longterm branch.

Obtaining kernel sources

Master

Overlay the riscv architecture-specific subtree onto an upstream release:

    $ curl -L https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.6.2.tar.xz | tar -xJ
    $ cd linux-4.6.2
    $ git init
    $ git remote add -t master origin https://github.com/riscv/riscv-linux.git
    $ git fetch
    $ git checkout -f -t origin/master

Note that the -t <branch> option minimizes the history fetched. To add another branch:

    $ git remote set-branches --add origin <branch>
    $ git fetch

Full kernel source trees

For convenience, full kernel source trees are maintained on separate branches tracking linux-stable:

  • linux-4.6.y-riscv
  • linux-3.14.y-riscv (historical)

Building the kernel image

  1. Create kernel configuration based on architecture defaults:

     $ make ARCH=riscv defconfig
    
  2. Optionally edit the configuration via an ncurses interface:

     $ make ARCH=riscv menuconfig
    
  3. Build the uncompressed kernel image:

     $ make -j4 ARCH=riscv vmlinux
    
  4. Boot the kernel in the functional simulator, optionally specifying a raw disk image for the root filesystem:

     $ spike +disk=path/to/root.img bbl vmlinux
    

    bbl (the Berkeley Boot Loader) is available from the riscv-pk repository.

Exporting kernel headers

The riscv-gnu-toolchain repository includes a copy of the kernel header files. If the userspace API has changed, export the updated headers to the riscv-gnu-toolchain source directory:

$ make ARCH=riscv headers_check
$ make ARCH=riscv INSTALL_HDR_PATH=path/to/riscv-gnu-toolchain/linux-headers headers_install

Rebuild riscv64-unknown-linux-gnu-gcc with the linux target:

$ cd path/to/riscv-gnu-toolchain
$ make linux

riscv-linux's People

Contributors

acmel avatar adrianbunk avatar airlied avatar alexdeucher avatar arndb avatar axellin avatar bigguiness avatar broonie avatar bzolnier avatar danvet avatar davem330 avatar dhowells avatar geertu avatar gregkh avatar htejun avatar ickle avatar jmberg-intel avatar joeperches avatar kaga-koko avatar larsclausen avatar linusw avatar mchehab avatar morimoto avatar olofj avatar pmundt avatar ralfbaechle avatar rddunlap avatar tiwai avatar torvalds avatar vsyrjala 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.