From 6c50033dfb7a4dc7094d96f9339459b08b4efac9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 8 Mar 2015 11:10:45 +0100 Subject: Add PRNG --- src/kernel/core/kmain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/kernel/core/kmain.c') diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index 5cd71c5..7cdd109 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -23,10 +23,16 @@ #include #include +#include + #include #include #include +#ifndef PRNG_INIT_ENTROPY +#define PRNG_INIT_ENTROPY 1299733235 +#endif + // ===== FOR TESTS ===== #define TEST_PLACEHOLDER_AFTER_IDT #define TEST_PLACEHOLDER_AFTER_REGION @@ -149,6 +155,10 @@ void kernel_init_stage2(void* data) { // Register FS drivers register_iso9660_driver(); + // Add entropy to prng + uint32_t x = PRNG_INIT_ENTROPY; + prng_add_entropy((uint8_t*)&x, sizeof(x)); + // Parse command line btree_t *cmdline = parse_cmdline((const char*)mbd->cmdline); -- cgit v1.2.3