You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andre Richter ad2d0d1182
🎉 Update to Rust 2018 🎉
6 years ago
..
.cargo Use aarch64-unknown-none target in nightly 🎉 6 years ago
raspi3_boot 🎉 Update to Rust 2018 🎉 6 years ago
src 🎉 Update to Rust 2018 🎉 6 years ago
Cargo.lock 🎉 Update to Rust 2018 🎉 6 years ago
Cargo.toml 🎉 Update to Rust 2018 🎉 6 years ago
Makefile Add nm target 6 years ago
README.md Update README.md 6 years ago
kernel8 🎉 Update to Rust 2018 🎉 6 years ago
kernel8.img 🎉 Update to Rust 2018 🎉 6 years ago
link.ld Alignment. Binaries from newer Rust version. 6 years ago

README.md

Tutorial 08 - Hardware Random Number Generator

This going to be an easy tutorial. We query a number from the (undocumented) hardware random number generator. You can use this to implement a simple, but accurate dice throw in any game. It is important as without hardware support you can only generate pseudo-random numbers.

rand.s

Due to lack of documentation, we mimic the respective Linux driver.

Rng::init(&self) initializes the hardware.

Rng::rand(&self, min: u32, max: u32) returns a random number between min and max.

main.rs

Press a key to query a random value and then display it on the serial console.