Skip to content

Conversation

@alevy
Copy link
Member

@alevy alevy commented Mar 6, 2018

This brings libtock-rs to the modern era, including support for recent Rust nightlies as well as the Tock kernel's new process loading API.

It improves on the previous version by not being location dependent (so the binary is relocatable) and has been tested for NRF52-DK as well as Hail. (@torfmaster & @Woyten is that actually true?)

@Woyten
Copy link
Contributor

Woyten commented Mar 6, 2018

Hi @alevy ! We are glad to hear that you consider merging our work of the last couple of weeks. With some more contributions the project might gain in momentum with some cool new ideas popping up. 😊

In order to respond to your questions:
I do not think @torfmaster possesses a Hail board, so our test setup is NRF52DK only. By the way, @torfmaster is working on some automated hardware tests that are based on libtock-rs. Maybe the can be run against the Hail board as well.

Regarding relocation: We made the Rust code run with the new kernel by using a lot of debugging and symptom fixing on a best-effort basis. Our latest solution consists of a manual stack pointer shift at the beginning of _start. The heap is initialized on the stack itself since we consider this as the only location with protection from concurrent write access. Currently, we did not find a way to enable R9 based relocation with LLVM, so we use R9 to store the heap location. We do not know why but immutable access to global values (such as &str or &[T]) works without any problems. For global write access, however, we get an inconsistent picture: It either a) works as expected b) has no effect or c) is rejected by the linker (dangerous relocation). We do not consider this as a big issue as &static muts are unsafe anyway.

@torfmaster torfmaster mentioned this pull request Mar 8, 2018
@alevy alevy merged commit 06944b5 into tock:master Mar 10, 2018
@alevy alevy mentioned this pull request Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants