'Exophase' said:
GP2X's real time clock isn't powered, so it starts at the same value every time you power it on (the common seed you're seeing). The system may not be indeterministic enough such that there's any noticeable variation in time of events. I'd go with vimacs idea to store a file persistently retaining the seed.
Yeah, I know. But there's a lot to "settle" in the first few seconds of boot up that can give you a few bits, at least, of entropy - SD card read times, boot times, battery charge, clock stablisation, etc. It doesn't need *much* but even a microsecond here or there is enough to provide a bit of entropy enough for something like this - with time() you won't pick up on that, with gettimeofday() you will. I'm not saying I'd use it to generate my SSH keys, but it should be enough to pick a random song in a menu or similar.
If all else failed, /dev/random would probably have a few bits of entropy by the time the programs loaded too and you could use that as a seed value. The Linux kernel pulls in entropy from surprising sources and even when you don't press any buttons at all, there's always some slight mis-timings in interrupts and external devices that can be used - especially in any machine where there is more than one chip at work.
Seed-preservation is probably the best solution for "real" randomness, e.g. SSH keys etc. but if you can pull anything out of a fairly-random source (battery life, the number of interrupts to have fired in /proc/interrupts, etc.), that should be fine for other such purposes. The GP2X's problem is not so much the lack of an RTC, but a very-deterministic boot time, solid-state storage, lack of built-in networking etc. which are the normal sources of early-boot entropy.
I have tried to use a number of seeds in games on the GP2X in the past, including the time since boot up and the time since SDL initialisation in as high res as I can get and, to be honest, they aren't much better than just using /dev/random even when you are auto-running on boot.