Philip Blundell wrote:
> Yeah. It would be nice if someone could contribute some memory auto-sizing
> code actually. It shouldn't be that hard. One could probably assume a
> minimum of 4MB and go up from there.
linux-7110 has some, in
ftp://lrcftp.epfl.ch/pub/people/almesber/psion/boot-9.tar.gz, file findmem.S
There are a few things that make it less trivial than it may seem at first
sight:
- the minimum step width can be rather small, e.g. on the Psion, it's
just 512kB. So to scan a 4GB address space, you'd have to check 8192
addresses. No big deal, except with ...
- incomplete address decoding. This means that we need to copy all the
original contents and put them back in the right order as soon as we
find that some address doesn't point to real memory. (After all, the
spot we're testing may happen to point somewhere into the kernel or
into initrd.)
An added challenge on the 7110 is that we don't have a lot of memory to
throw at the problem (e.g. to store things we've overwritten), because
the things loaded by the boot loader (Arlo) may end up all over the
place, so we need to detect available memory and move things back to
sequence before running the kernel.
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, DI-ICA,EPFL,CH [EMAIL PROTECTED] /
/_IN_R_131__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]