`unsafe` and cross-platform code review of `stardust-rs`

I've been working on a proof-of-concept rust template for cross-os and cross-arch position independent code. You can find it here: GitHub - Irate-Walrus/stardust-rs: An i686 & x86_64 position independent implant template for Rust 🦀.

I have a couple of areas of concern:

  • lots of unavoidable unsafe pointer maths
  • logical structure of arch+os specific code
  • structures which have prerequisites for use
  • safer handling of errors (it all aborts in the end)

There are several constraints:

  • avoid allocations at all costs
  • compilation size should be minimal
  • #![no_std] environment e.g. no locks
  • it should be simple to understand

I'm looking for advice on:

  • testing
  • project layout
  • safety
  • building structs which have os-dependent fields and are interdependent

Throw your advice down below and thank you :slight_smile:

1 Like