On Wed, Mar 21, 2001 at 06:33:44PM -0500, [EMAIL PROTECTED] wrote:
> I currenlty need to load things into SDRAM from a paged flash that is
> larger than the 1Meg window available.

I'm in exactly the same situation- I use a 4MB flash that's paged (using a
PLD) into the chipset's 1MB window.

> I see two options:
> 
> - Copy the functions the are needed into SDRAM
> - Copy all of Linuxbios into SDRAM and run all of it from there.

I'm not sure what "all of linuxbios" means (because you're clearly going
to have to initialize the northbridge and SDRAM before you can go
farther), but here's what I do:

assembly:
  initialize chipset, cache, northbridge, southbridge
  turn on dram
  copy all c code, data to ram
C:
  superio, pci, interrupt, timer, etc. setup
  decompress kernel to ram
  copy compressed initrd (ramdisk) image to ram
  start kernel
 
> Questions:
> 
> - What will bite me if I try the second option?  The only absolute jump
>   that I know about is when switching to protected mode.

Can't think of anything really big- the memory mapping and ldscript get
messier because you have to run the code from someplace other than where
it's loaded.  If you can view post codes you should be able to debug
anything that comes up.

> - How relocatable is the code?

I didn't have any problems.

> - What about references to static contants?

All code and data addresses should be ok as long as you tell the linker
about the "VMA" address (location in DRAM) as well as the "LMA" address.
See "info ld" for details.  Also read my ldscript for an example.

> - Do I need to create a special linker segment for this?

I don't remember what a "linker segment" is, sorry.

> - Should I compile linuxbios to be located someplace else from the start
>   and copy it there before doing much of anything?

As opposed to what?  Running half of it from ROM and the rest from RAM?  I
think it's easier, but only because I didn't want to wrestle with the
linker- I think you would have to specify, file by file, which bits of
code are supposed to be run from where, and I didn't want the hassle so I
run _everything_ from RAM.  I even saw a big speed increase, which I've
never been able to explain.  Perhaps on my system ROM wasn't getting
cached for some reason?  

Eric

Reply via email to