mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +00:00
Kernel: Add base support for VirtRNG (VirtIO based Hardware RNG)
This is a very basic implementation that only requests 4096 bytes of entropy from the host once, but its still high quality entropy so it should be a good fix for #4490 (boot-time entropy starvation) for virtualized environments. Co-authored-by: Sahan <sahan.h.fernando@gmail.com>
This commit is contained in:
parent
d1f7a2f9a5
commit
e4d9fa914e
5 changed files with 144 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <Kernel/VirtIO/VirtIO.h>
|
||||
#include <Kernel/VirtIO/VirtIOConsole.h>
|
||||
#include <Kernel/VirtIO/VirtIORNG.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -41,6 +42,10 @@ void VirtIO::detect()
|
|||
[[maybe_unused]] auto& unused = adopt(*new VirtIOConsole(address)).leak_ref();
|
||||
break;
|
||||
}
|
||||
case VIRTIO_ENTROPY_PCI_DEVICE_ID: {
|
||||
[[maybe_unused]] auto& unused = adopt(*new VirtIORNG(address)).leak_ref();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
dbgln_if(VIRTIO_DEBUG, "VirtIO: Unknown VirtIO device with ID: {}", id.device_id);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue