OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 9:21 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Random number generating in PM
PostPosted: Mon Dec 10, 2001 12:00 am 
How can I generate an random number in protected mode?


Top
  
 
 Post subject: RE:andom number generating in PM
PostPosted: Mon Dec 10, 2001 12:00 am 
>On 2001-12-10 11:22:55, Iwabee wrote:
>How can I generate an random number in protected mode?

Without a source of radioactivity you can't :)

You can get pseudo-random numbers though...
The typical approach is to have an algorithm that takes
the current time as a seed and does some wacky computation
with it.

Random number generation has had alot of research.
A quick search on google should turn up a bunch of different
methods and downloadable implementations.


Top
  
 
 Post subject: RE:andom number generating in PM
PostPosted: Thu Dec 13, 2001 12:00 am 
>On 2001-12-10 11:22:55, Iwabee wrote:
>How can I generate an random number in protected mode?

Try this: Make a cycling calculation of the
square root of two and then make a 'device'
entery for your OS that returns the curent
location in the computation. Store the value
somewhere in a file and start again at that
place when you restart your computer.
Another way is to take a value, square it,
take the 3 center digits, and use that value,
then square the number formed of those 3 digits,
square that, take the 3 center digits and keep
repeating.


Top
  
 
 Post subject: RE:andom
PostPosted: Wed Jan 09, 2002 12:00 am 
>On 2001-12-10 17:24:38, Chase wrote:
>>On 2001-12-10 11:22:55, Iwabee wrote:
>>How can I generate an random number in protected mode?
>
>Without a source of radioactivity you can't :)
>

Actually, the newer Intel chipsets all have
hardware RNG based on measurement of thermal
fluctuations in the BIOS die. see
http://www.intel.com/design/security/rng/rngppr.htm
for details.

Other random number systems have been available
as bus cards for years. Most of those use either
a variation on the thermal fluctuations system,
or use a 'noise generator' of some kind (for
example, a wire or semiconductor chip that has a unpredictably variable resistance; this results
in a truly random variation that can be detected
by a built-in ohmmeter).

However, to date only a small minority of systems
have these. The usual suggestion is to use a
conventional PRNG as your main algorithm, and to
use the RNG for providing it seed if there is
one; otherwise, use a traditional seed-generation
method such as sampling the current time in
seconds and XORing it to the time of the previous
run.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 129 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group