Giter Site home page Giter Site logo

embedded_workshop_2021's Introduction

Tools and setup

See here.

Block A

First Block: Running on and integrating with desktop OSes.

File

  • Makefile
  • Comparison of failure scenarios of C and Rust
  • Platform agnositc APIs in C and Rust
  • Highlight of problems with glibc versions

syscall

  • Quick example showing basic usage of pointers
  • Quick-and-dirty example to show that rust is no magic sauce (but the compiler helps)
  • The same example again but with a bit more careful error handling in place.

C-Interoperability

Rust calls C

  • Showcase of how a rust application can use an external C dependency. This was already done under the hood by the syscall example.
  • We build the example with gcc

C calls Rust

  • Basic example of a C application making use of some Rust library
  • We use cbindgen to generate bindings to the Rust lib to expose a C API.

Bindgen + cc

  • Showcase of combining bindgen and cc to compile a C library and create bindigns to it for Rust.
  • These are two crates generated and generated_sys to mirror the separation found in most projects

Pi

We move to a different plattform, the RaspberryPi

blink

  • The typical Hello World example used to make an LED blink
  • We make use of a reaedy-made library rppal but encounter challenges with crosscompiling

blink_mem

  • How does the rppal library make the led blink?
  • We poke around the library to find out that we need to set some registers
  • We use /dev/mem to write our own code doing so
  • This is in preparation of a later example

Block B

Rust Java interop

  • Interoperability of Java and Rust
  • Small example of an integration between Java and Rust. This will be reused in the Android example

Rust C++ interop

  • Interoperability of C++ and Rust
  • Showcase demonstrating the use of the cxx crate.
  • Whilst this is more powerful than the plain C interoperability, we also see some of the limitations.

no_std

No_std hello world

  • After we learned where parts of the Rust ecosystem are located, we can make use of those present in the no_std world.
  • Printing Hello World with no_std but using the OS nonetheless ist ridiculous and surprisingly hard
  • We learn to get a feeling for no_std and its limitations but see some of Rusts beauty: The mighty features like the Ownership system can also be used in a no_std environment.
  • Since we ditched the standard library, our resulting executable is tiny

bare_blink

  • Remember the code from the blinkblink_mem making the LED blink by poking around the memory? We can do this without the OS with nearly the same code! Of course we need to provide a bit of glue around it, after all, we write a exceptionally simple OS-Kernel.

Block C & D

embedded_workshop_2021's People

Contributors

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