Skip to content

Latest commit

 

History

History
161 lines (116 loc) · 6.25 KB

software.md

File metadata and controls

161 lines (116 loc) · 6.25 KB
layout title tagline group weight
page
Software
navigation
4

{% include JB/setup %}

For building your own software, OpenRISC is supported by a 32-bit GNU toolchain offering C and C++ support. The toolchain is available in several forms, depending on your use case:

To run multiple applications in parallel and to use their rich features there is an up-to-date support for a few operating systems:

  • Linux is a widely used general purpose operating system.

  • RTEMS is a real-time operating system for embedded systems.

To build multiple applications you may want a easy to use build system like:

  • buildroot makefiles and patches to build a complete bootable Linux system.

  • OpenADK also a system to build a complete bootable Linux system with applications. Has good support for OpenRISC.

Toolchains

A cross-compiler toolchain is used to compile your software code for the OpenRISC processor. The toolchain is executed on the host computer and generates a program or library that can be executed on the processor then. There is a baremetal toolchain that is based on the Newlib C library. Other toolchains to compile programs to be run on an operating system can be found below.

Basic Tool and Compiler Support

Some basic tools form an actual toolchain:

  • Binutils: Binutils contains tools needed for linking programs and libraries, compiling assembler code etc. The binutils distribution contains support for OpenRISC (or1k). Beside this a development repository is used to test new features before submitting it to the binutils project.

  • GCC: GCC is the compiler that translates C/C++ to programs or libraries. The GCC project has support for OpenRISC or1k. Historical development, binaries and experimental features are available in our development repository.

  • GDB: The debugger is used to find and fix bugs in programs running on the target platform. The gdb distribution contains support for OpenRISC (or1k). An OpenRISC development repository is used to test new features and share with the community before submitting to the upstream gdb project.

Newlib Toolchain

Newlib is a C library for embedded systems. Our baremetal toolchain or1k-elf is built on it. The library provides the basic functions like printf and memory allocation. The libgloss is the part of newlib that does the actual hardware handling: It configures the processor, the UART and sets the stack according to the available physical memory. For this it depends on some external symbols, which are defined by board libraries and may be overwritten.

Beside the basic C library functionality, the libgloss port for OpenRISC defines some helper functions for exception and interrupt handling, timers and other peripherals. The latest releases and documentation can be found on the or1k-elf newlib website.

You can download prebuilt toolchains here or build it yourself following these instructions.

musl toolchain

The musl toolchain is the preferred toolchain for building programs that should run on Linux. The exceptions to this is software that depend on extensions only found in glibc. For example, building Debian requires glibc.

You can download prebuilt toolchains here or build it yourself following these instructions.

uClibc-ng Toolchain

The uClibc-ng toolchain is a reboot of the uClibc project which also is for building programs that should run on Linux. It has good support for OpenRISC and is more compatible with glibc, meaning you can easily compile more applications for it compared to musl.

You can download and build the source downloading from the uClibc-ng website.

The glibc toolchain is available for OpenRISC since version 2.35. This toolchain provides a fully featured C system API including internationalization, 64-bit time and filesystem support.

You can download and build the source downloading from the glibc website.

Operating Systems

Linux

The Linux operating system should need no introduction. The support for OpenRISC is stable.

See our tutorials on compiling and running Linux on OpenRISC.

RTEMS

The RTEMS port was dead for a few years, but has been re-established in 2014 during a Google Summer of Code project. The student documented his work in his blog and the work is part of the RTEMS project now.

Applications

Buildroot

The Buildroot project provides a build system cross compiling and packaging multiple applications for your embedded project. This means instead of you having to go and download tarballs and run ./configure && make && make install and chase down build failures you have an nice tool to do it all for you.

Buildroot supports building and packaging applications for Linux using uClibc-ng.

OpenADK

The OpenADK project comes from the maintainers of uClibc-ng and is also a embedded Linux construction kit. The team is active in the OpenRISC community so you can expect good support.

It supports both musl and uClibc-ng.