lurk101
Posts: 355
Joined: Mon Jan 27, 2020 2:35 pm

Re: Random Number Generator Using Build In Hardware

Fri Oct 09, 2020 2:00 pm

jahboater wrote:
Fri Oct 09, 2020 1:30 pm
lurk101 wrote:
Fri Oct 09, 2020 4:42 am
ejolson wrote:
Fri Oct 09, 2020 3:56 am
... and in order to generate historically accurate random numbers.
Would you have the source code for the 7th edition's historic PDP-11 Unix version of the rand function?
@ejolson posted this earlier in the thread:
Can't find it. The PDP11 code, not the pascal code.

ejolson
Posts: 6320
Joined: Tue Mar 18, 2014 11:47 am

Re: Random Number Generator Using Build In Hardware

Fri Oct 09, 2020 2:37 pm

lurk101 wrote:
Fri Oct 09, 2020 2:00 pm
jahboater wrote:
Fri Oct 09, 2020 1:30 pm
lurk101 wrote:
Fri Oct 09, 2020 4:42 am

Would you have the source code for the 7th edition's historic PDP-11 Unix version of the rand function?
@ejolson posted this earlier in the thread:
Can't find it. The PDP11 code, not the pascal code.
You're right. The edition 7 code was in a different thread that is here

viewtopic.php?p=1713336#p1713336

see also

https://minnie.tuhs.org/cgi-bin/utree.p ... c/libc/gen

The same algorithm was in BSD 2.9 and optionally modified in BSD 2.11. Previous editions of research Unix used a simpler 16-bit generator coded in assembler, so that could be a historically accurate Hunt the Wumpus alternative.

While easily predictable, the advantage of random number generators that use the built-in ALU is that they are not easily influenced by micro-psychokinetic powers or ambient temperature.

ejolson
Posts: 6320
Joined: Tue Mar 18, 2014 11:47 am

Re: Random Number Generator Using Build In Hardware

Fri Oct 09, 2020 4:53 pm

There is discussion of how the hardware random number generator can be mixed into the Linux entropy pool on the Pi at

viewtopic.php?p=1735378#p1735378

I find it interesting this is done by a user level program rather than the kernel. I wonder what would happen if the output of the PDP-11 pseudo-random generator were instead mixed in. Would any of those monitoring tools notice?

ejolson
Posts: 6320
Joined: Tue Mar 18, 2014 11:47 am

Re: Random Number Generator Using Build In Hardware

Sun Oct 11, 2020 3:22 am

I've now started a thread under projects describing my efforts recreating the game Hunt the Wumpus as it appears in the 7th edition of historic Unix using a dynamically equivalent pseudo-random number generator on the Raspberry Pi.

viewtopic.php?f=41&t=287943

Return to “C/C++”