Przeglądaj źródła

Kernel: Initialize TimeManagement before using KernelRNG

We should initialize the timers before KernelRNG as the RNG may want
to utilize system time as an entropy source.

Fixes #8710
Tom 4 lat temu
rodzic
commit
3cca9e6704
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Kernel/init.cpp

+ 3 - 2
Kernel/init.cpp

@@ -144,14 +144,15 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init()
     InterruptManagement::initialize();
     InterruptManagement::initialize();
     ACPI::initialize();
     ACPI::initialize();
 
 
+    // Initialize TimeManagement before using randomness!
+    TimeManagement::initialize(0);
+
     __stack_chk_guard = get_fast_random<u32>();
     __stack_chk_guard = get_fast_random<u32>();
 
 
     ProcFSComponentRegistry::initialize();
     ProcFSComponentRegistry::initialize();
     Thread::initialize();
     Thread::initialize();
     Process::initialize();
     Process::initialize();
 
 
-    TimeManagement::initialize(0);
-
     Scheduler::initialize();
     Scheduler::initialize();
 
 
     dmesgln("Starting SerenityOS...");
     dmesgln("Starting SerenityOS...");