2003-06-28 23:05:12

by Luca T.

[permalink] [raw]
Subject: /dev/random broken?

Hello,
i am not sure if this is a kernel/module problem but so it seems to me.
My computer is an AMD 2000+ with an ABIT motherboard, my kernel version
is 2.4.21-0.13mdk (but i tried it with 2.4.21-0.18mdk too and it doesn't
work either).

If i give this command:
dd if=/dev/zero of=./xxx bs=1024 count=100
it will work perfectly. But if i try to do the same reading from
/dev/random with this command:
dd if=/dev/random of=./xxx bs=1024 count=100
it will just sit there and stare at me until i move the mouse... and
then the program will exit without any error message (i checked in
/var/log/messages too and there is no message there either about this).

Is this a bug? If yes... do you have any idea that would help me fix it?

Thank you,
Luca


2003-06-28 23:12:46

by Rudolf Thomas

[permalink] [raw]
Subject: Re: /dev/random broken?

> Is this a bug?

No, it is not. If there's not enough random data available, reading from
/dev/random will block. Moving the mouse around will generate some interrupts
(or other stuff) that contribute to the entropy...

Rudo.

2003-06-28 23:16:05

by Tom Vier

[permalink] [raw]
Subject: Re: /dev/random broken?

On Sun, Jun 29, 2003 at 01:18:09AM +0200, Luca T. wrote:
> dd if=/dev/random of=./xxx bs=1024 count=100
> it will just sit there and stare at me until i move the mouse... and
> Is this a bug? If yes... do you have any idea that would help me fix it?

no, use /dev/urandom. man urandom. read drivers/char/random.c.

--
Tom Vier <[email protected]>
DSA Key ID 0xE6CB97DA