Coder Social home page Coder Social logo

namboy94 / octorust Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.63 MB

A program for compiling invasive rust applications

License: GNU General Public License v3.0

Python 1.79% Shell 0.46% X10 0.29% C 0.32% Rust 97.04% HTML 0.01% RenderScript 0.10%

octorust's Introduction

octorust

pipeline status

Logo

octorust is a python application that makes use of rustc, cargo and gcc to compile applications written in rust for use in invasive Platforms utilizing OctoPOS/iRTSS.

The program has been written in the course of my bachelor thesis, which can be found here.

Installation

octorust has been tested to work on Arch Linux and Ubuntu Linux. It should work on all Linux distributions and probably on MacOS and Windows, that has not been tested though.

A script for automatic installation on Ubuntu systems has been provided. To install octorust using this script, simply run ./ubuntu_setup.sh.

Prerequisites

A working rustup is assumed to exist on the system. If not, install it either using your package manager (sudo pacman -S rustup on Arch Linux, other distros that don't have rustup packaged can use the rustup installation script).

octorust is currently using dependencies that require the use of a specific nigthly rustc-compiler. To be able to compile invasie rust applications, this nightly compiler should be set using the following commands

$rustup install nightly-2017-06-01
$rustup default nightly-2017-06-01

For x86guest support, install the i686-unknown-linux-gnu target using:

$rustup target install i686-unknown-linux-gnu

A gcc with support for both 32-bit and 64-bit is also required (On most distibutions, installing the gcc-multilib package should to the trick)

A sparc-elf-gcc compiler should also be installed and in the path, but if this is not the case, the installer will download one and store it in ~/.octorust/toolchains/sparc-elf.

Installation from source

From the root directory, execute python setup.py install --user (The --user flag tells setuptools to install the application for the current user instead of system-wide).

This will:

1. Install the python application
2. Create the directory ~/.octorust
3. Copy octolib and any dependencies like libcore and libc to ~/.octorust
4. Compile the libcore and libc crates and install them in the rustup
   toolchain installation directory
5. Install a sparc-elf-gcc if one could not be found in $PATH

Once installed, make sure that ~/.local/bin is in your path, which should make it possible to call the octorust command.

Post-Installation

Once everything is installed, you will need to install an OctoPOS/iRTSS build. To do so,

try to compile one of the applications inside the eval directory. To do so, execute the following command:

$ octorust --fetch-irtss -i VERSION

You can set the -i option to specify a release date of the iRTSS version to use. If ommited, octorust will fetch the most current release. The utilized iRTSS version during development was 2017-06-07.

To ensure that you have the correct access rights to download iRTSS builds, please ensure that you have a ~/.netrc file in your home directory with the following structure:

machine www4.cs.fau.de
login <username>
password <password>

With an iRTSS build installed, we can now compile invasive rust programs. To do so, run the following command:

$ octorust eval/minimal-infect -a x86guest -v generic -o out -i 2017-06-07

This will attempt to compile the sample application for the x86guest architecture and the generic variant. The 2017-06-07 iRTSS release will be used. Once compiled, the out file will contain this program.

Further Information

octorust's People

Contributors

namboy94 avatar

Stargazers

Andreas Zwinkau 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.