This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -- time access


On Thu, Feb 05, 2004 at 02:17:48PM +0530, Aravind B wrote:
> hi,
> i want to generate a random number for which i am using system time
> value to updata seed value. but it is not working with sid.
> is there any solution for these
> if so please send me the solution.

Generating random numbers is difficult in embedded systems. The system
time is not random. You program will always take the same amount of
time for it to reach the call to read the time. So this is in fact a
constant. So you are seeding the random number generator with a
constant. 

You need something external for the seed. The time between two
ethernet packets, the time you receive something from the serial port
etc.

        Andrew


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]