Mail Archives: djgpp/2000/02/29/12:57:53
On Mon, 28 Feb 2000, Damian Yerrick wrote:
> >I think there's lots of random events you could gather on a PC by
> >accessing various ports and absolute memory addresses.
>
> Such as? I think this would be useful.
First, you can access the same sources as Linux does: the microphone
and the keyboard. (You can easily modify the standard DJGPP keyboard
handler to stash away the keystrokes for you.)
Then you can access random video memory locations. You can sample the
mouse position and/or read its motion counters/button press data. You
can look at the transfer buffer.
There are also many places in the so-called DOS List-of-Lists internal
data structure which can be used as a source of random data. For
example, the last directory entry read by DOS, the SFT (System File
Table) with the info about all open files, data read from disk that is
buffered by DOS, and much more.
> 1. time(NULL)
time(NULL) is not really random, except if sampled at random points in
time. If time(NULL) is good enough, reading the timer counter is even
better.
- Raw text -