Coder Social home page Coder Social logo

riscv-uclinux's Introduction

riscv uclinux

Download sources

$ git clone https://github.com/chmmn/riscv-uclinux.git
$ cd riscv-uclinux
$ make -f toolchain.mk sources

Build GNU toolchain

Edit toolchain.mk:

PREFIX=/opt/riscv-nommu
TARGET=riscv32-unknown-linux-gnu
ARCH=rv32ima
ABI=ilp32

or

PREFIX=/opt/riscv-nommu
TARGET=riscv64-unknown-linux-gnu
ARCH=rv64imafdc
ABI=lp64d

Build toolchain:

$ for i in binutils gcc1 headers uclibc-ng gcc2 elf2flt;do make -f toolchain.mk ${i}_config; make -f toolchain.mk ${i}_build; make -f toolchain.mk ${i}_install; done

Run gcc:

$ /opt/riscv-nommu/bin/riscv32-unknown-linux-gnu-g++ -v

or

$ /opt/riscv-nommu/bin/riscv64-unknown-linux-gnu-g++ -v

Build flat binary.

$ riscv32-unknown-linux-gnu-gcc -c -fPIC -O2 main.c -o main.o
$ riscv32-unknown-linux-gnu-gcc -Wl,-elf2flt=-r main.o -o main

Prebuilt busybox root cpio file

32bit

wget https://www.whatfun.me/riscv/rootfs/rootfs32.cpio.gz

64bit

wget https://www.whatfun.me/riscv/rootfs/rootfs64.cpio.gz

Prebuilt vmlinux

32bit

$ wget https://www.whatfun.me/riscv/vmlinux32.bz2
$ bunzip2 vmlinux32.bz2

run it

$ spike --isa=rv32ima -m0x80000000:0x60000000 vmlinux

or

# qemu-system-riscv32 -kernel vmlinux -nographic

64bit

$ wget https://www.whatfun.me/riscv/vmlinux64.bz2
$ bunzip2 vmlinux64.bz2

run it

$ spike --isa=rv64imafdc vmlinux

or

# qemu-system-riscv64 -kernel vmlinux -nographic

riscv-uclinux's People

Contributors

chmmn avatar

Watchers

 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.