-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zphrs GetRandom - adds support for the GetRandom syscall (also adds the Instant struct to the kernel) #207
Conversation
src/kernel/src/once.rs
Outdated
@@ -45,7 +45,7 @@ impl<T> Once<T> { | |||
Ordering::SeqCst, | |||
) { | |||
Ok(_) => { | |||
// We will initialize this Once. | |||
// We willx initialize this Once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some cleanup to do, there's those binary files from src/toolchain/install that need to be removed, and then extraneous debugging messages, etc. Otherwise, this looks good. Is the goal to replace the dieharder implementation with a way to extract random info out of qemu and run the tests on linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
src/kernel/src/random/mod.rs
Outdated
extern "C" fn contribute_entropy_regularly() { | ||
logln!("Starting entropy contribution"); | ||
loop { | ||
logln!("Contributing entropy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to print every second? In general, maybe reduce some of the loglns in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 2 small things :)
tools/xtask/src/qemu.rs
Outdated
@@ -65,8 +69,13 @@ impl QemuCommand { | |||
self.cmd | |||
.arg("--no-reboot") // exit instead of rebooting | |||
.arg("-s") // shorthand for -gdb tcp::1234 | |||
.arg("-serial") | |||
.arg("mon:stdio"); | |||
// .arg("-serial") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't hard code in the -smp or the -nographic.
…dom implementation rather than the userspace one
Fixed issue with loading the gitmodule
See twizzler-operating-system/rfcs#12 for more details.
Justification for adding the
Instant
struct to the kernel: Since the Fortuna specification itself requires only reseeding at most every 100ms to prevent fully replacing the entropy pool with junk events (ex. events with 0s as the only bytes for the seed) within any reasonable timeframe, I required some way of keeping track of how long has passed. Additionally,Instant
s will be useful in the future for any timing difference based entropy sources such as timing driver events for instance.Future work:
contribute_entropy
to contribute to the entropy pools.Note: Before merging this PR, make sure to first merge this one into getrandom-twizzler. Otherwise other contributors will face issues with their submodules.