Code Monkey home page Code Monkey logo

cyphos's Introduction

CyPhOS

CyPhOS - Real-time operating system for cyber-physical systems

The system supports the ARMv7 (Cortex-A9) and AMD64 processor architecture.

Prerequisites

To compile this operating system you need an arm (arm-none-eabi) toolchain. Currently supported is gcc 5.3 (newer/older versions might also work). Make sure your compiler is in your $PATH.

Also version 2 of AspectC++ is required to compile the operating system. Make sure that ag++ and ac++ is within you $PATH variable.

Supported GCC versions

  • 6.2 (or newer 6 series)
  • 7.3
  • 8.1, 8.2

Although older GCC versions might work CyPhOS is only developed and tested with the newest released GCC version (8.2).

Unsupported GCC versions

  • 6.1 Does not work because of a bug where volatile is ignored. Bugreport

Compiling the crossdev-toolchain (necessary for ARMv7)

Setup the environment

First you need to configure the build environment with some variables.

export TARGET=arm-none-eabi
export PREFIX="$HOME/cross-compiler/$TARGET"
export PATH="$PREFIX/bin:$PATH"

$PREFIX is set to the installation directory of the cross-compiler toolchain.

Building binutils

  • Download the binutils sourcecode here to some directory
  • Change into the directory of the sourcecode: cd $somedirectory
  • Extract the sourcecode: tar xf binutils-$VERSION.tar.bz2
  • Create the build directory: mkdir binutils-build
  • Change into the build directory: cd binutils-build
  • Configure the binutils sources: ../binutils-$VERSION/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
  • Compile the sources: make
  • Install the compiled tools: make install

Building crossdev gcc

  • Download the gcc sourcecode here to some directory
  • Change into the directory of the sourcecode: cd $somedirectory
  • Extract the sourcecode: tar xf gcc-$VERSION.tar.bz2
  • Create the build directory: mkdir gcc-build
  • Change into the build directory: cd gcc-build
  • Configure the gcc sources: ../gcc-$VERSION/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
  • Compile the bootstrap gcc: make all-gcc
  • Compile the additional libgcc: make all-target-libgcc
  • Install the compiler and libgcc: make install-gcc; make install-target-libgcc

You must also include the path of your installed compiler to your $PATH variable.

Building of the OS

To compile the OS the specific board needs to be set. This can be done by setting the CYPHOS_ARCH environment variable.

  • export CYPHOS_ARCH="BOARDVALUE" where BOARDVALUE is one of the targets below.

After setting the variable you can just call make -jN (where N is the number of threads to compiler)

During the compilation a script is started to generate parts of the linker script which enables the operating system to preload components during runtime.

  • make -j4 (for example)

This will result in an elf binary under build/boot and a raw binary under build/boot.img

To boot this image look under the board specific documentation.

Supported Hardware

Currently there is only support for ARM systems with Cortex-A9 processors and AMD64 system.

List of currently supported platforms:

Platform-specific guides

ODroid-U3

Build

The board specific value for the architecture variable (BOARDVALUE above) is armv7/exynos4412

Booting

To boot the operating system you need a bootloader with support for baremetal booting and without the MMU enabled already. You can use a modified version of u-boot for exynos from:

Github which can boot baremetal images via fastboot

PandaBoard ES

Build

The board specific value for the architecture variable (BOARDVALUE above) is armv7/omap4460

Booting

To boot the operating system from USB you need the usbboot bootloader.

Github (Booting with usb3 ports is a bit unstable)

As an alternative I recommend setting up network based PXEboot with U-boot.

Wandboard (Quad)

Build

The board specific value for the architecture variable (BOARDVALUE above) is armv7/imx6

Booting

The generated image file is best booted via u-boot direct loading. You can use loady to load the binary build/boot.img

To load this image use the following command sequence in u-boot:

  • loady - This will listen for a ymodem file transfer (can be initiated via minicom for example)
  • Send the build/boot.img to the serial console of u-boot.
  • go 0x12000000 this needs to be the address of the file transfer. This instructs u-boot to branch(jump) the cpu to the startup code of CyPhOS.

As an alternative I recommend setting up network based PXEboot with U-boot.

AMD64 architecture

You only need gcc with g++ and ag++ installed on your system.

Compilation can be done via:

  • export CYPHOS_ARCH=x86
  • make iso
  • This will result in an .iso file that you can dd on an USB stick or boot via qemu directly. Also the generated ELF image is multiboot compliant.

cyphos's People

Contributors

djselbeck 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.