1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 18:35:07 +00:00

Kernel: Make Random work on CPUs without rdrand

- If rdseed is not available, fallback to rdrand.
- If rdrand is not available, block for entropy, or use insecure prng
  depending on if user wants fast or good random.
This commit is contained in:
Peter Elliott 2020-06-27 11:10:01 -06:00 committed by Andreas Kling
parent 1eb338ab71
commit e1aef94a40
4 changed files with 71 additions and 12 deletions

View file

@ -131,7 +131,7 @@ extern "C" [[noreturn]] void init()
klog() << "Starting SerenityOS...";
__stack_chk_guard = get_good_random<u32>();
__stack_chk_guard = get_fast_random<u32>();
TimeManagement::initialize();
@ -169,7 +169,7 @@ extern "C" [[noreturn]] void init()
extern "C" [[noreturn]] void init_ap(u32 cpu)
{
APIC::the().enable(cpu);
#if 0
Scheduler::idle_loop();
#else