2020-09-18 18:18:03 +02:00
|
|
|
# Random Number Generator
|
|
|
|
|
|
|
|
I/O device type 10 is a random number generator. I do this as
|
|
|
|
part of the VM I/O extensions to allow implementors to use the
|
|
|
|
best approach on their host system.
|
2019-01-22 03:00:09 +01:00
|
|
|
|
2019-01-19 18:28:17 +01:00
|
|
|
~~~
|
2021-04-19 19:35:29 +02:00
|
|
|
:n:random (-n)
|
2023-12-11 00:32:03 +01:00
|
|
|
DEVICE:RNG io:scan-for
|
|
|
|
dup n:negative? [ drop 'Error:_RNG_device_not_found s:put nl ] if;
|
2021-04-19 19:35:29 +02:00
|
|
|
io:invoke ;
|
2021-08-23 15:23:10 +02:00
|
|
|
|
2023-04-12 02:34:17 +02:00
|
|
|
'interface/rng.retro 'n:random d:set-source
|
2019-10-14 17:17:43 +02:00
|
|
|
~~~
|
2023-04-12 02:34:17 +02:00
|
|
|
|