tosc-rs / mnemos

An Operating System for Building Small Computers
https://mnemos.dev
Apache License 2.0
253 stars 18 forks source link

refac(D1): pull most of the code back into a `core` crate #283

Closed hawkw closed 1 year ago

hawkw commented 1 year ago

By reintroducing a mnemos-d1-core crate, we can put most of the platform implementation in a crate without a forced-target, allowing us to run unit tests for the platform impl on the build host. The actual dependencies on riscv and riscv-rt, which won't build for the host's target, are now cfg-gated. We must still have the crate containing the top-level binaries have a forced-target, or else we hit weird cargo bugs I don't understand, but it's now a thin wrapper around the core crate which has a forced-target and defines the board binaries.

This also has the side benefit of letting us put the d1-core crate in the workspace's default-members, so it gets seen by cargo test/cargo fmt/etc without having to pass it explicitly. And, we can have tests now!