mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-09 09:23:53 +02:00
Add notes about running examples.
This commit is contained in:
parent
49bf110b31
commit
5068b1288d
src/bare-metal
@ -17,5 +17,6 @@ To use `alloc` you must implement a
|
|||||||
allocator defined in your binary. Usually this is done in the top-level binary crate.
|
allocator defined in your binary. Usually this is done in the top-level binary crate.
|
||||||
* `extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in so
|
* `extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in so
|
||||||
we get its panic handler.
|
we get its panic handler.
|
||||||
|
* This example will build but not run, as it doesn't have an entry point.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
@ -28,6 +28,7 @@ idmap.activate();
|
|||||||
* For now it only supports EL1, but support for other exception levels should be straightforward to
|
* For now it only supports EL1, but support for other exception levels should be straightforward to
|
||||||
add.
|
add.
|
||||||
* This is used in Android for the [Protected VM Firmware][2].
|
* This is used in Android for the [Protected VM Firmware][2].
|
||||||
|
* There's no easy way to run this example, as it needs to run on real hardware or under QEMU.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ we might want to allocate MMIO space for PCI BARs:
|
|||||||
<details>
|
<details>
|
||||||
|
|
||||||
* PCI BARs always have alignment equal to their size.
|
* PCI BARs always have alignment equal to their size.
|
||||||
|
* Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-example/`. (It won't
|
||||||
|
run in the Playground because of the crate dependency.)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ fn main() {
|
|||||||
from `std::sync`; and `Lazy` for lazy initialisation.
|
from `std::sync`; and `Lazy` for lazy initialisation.
|
||||||
* The [`once_cell`][2] crate also has some useful types for late initialisation with a slightly
|
* The [`once_cell`][2] crate also has some useful types for late initialisation with a slightly
|
||||||
different approach to `spin::once::Once`.
|
different approach to `spin::once::Once`.
|
||||||
|
* The Rust Playground includes `spin`, so this example will run fine inline.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ fn main() {
|
|||||||
<details>
|
<details>
|
||||||
|
|
||||||
* `tinyvec` requires that the element type implement `Default` for initialisation.
|
* `tinyvec` requires that the element type implement `Default` for initialisation.
|
||||||
|
* The Rust Playground includes `tinyvec`, so this example will run fine inline.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ working with structures shared with hardware e.g. by DMA, or sent over some exte
|
|||||||
* Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use all
|
* Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use all
|
||||||
possible u32 values as discriminants, so not all byte patterns are valid.
|
possible u32 values as discriminants, so not all byte patterns are valid.
|
||||||
* `zerocopy::byteorder` has types for byte-order aware numeric primitives.
|
* `zerocopy::byteorder` has types for byte-order aware numeric primitives.
|
||||||
|
* Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-example/`. (It won't
|
||||||
|
run in the Playground because of the crate dependency.)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user