Re: [Etherboot-developers] Retiring RELOC
Brought to you by:
marty_connor,
stefanhajnoczi
From: <ke...@et...> - 2003-12-31 07:15:14
|
>>Since we don't have a heap (except in high memory), I think that >>allocating (_end-_start from .img file)+(size of "unnrv2b.bin")+(size of >>start16.bin) bytes should be sufficient for all circumstances. This is a >>value that would have to be poked in by makerom. > >Well, not makerom because makerom is only invoked on .rom images, >whereas you want it to work on all images. More likely it should be >computed by the linker and deposited in an accessible location. At least >the _end-_start part, the others two might have to be defines and added >at runtime to it. Here's a proposal: Do the move to 40:13 memory in start16.S, then it will apply to all image types (.z?rom, .z?lilo, .z?dsk, .z?pxe, .com). Notice that all these image types are headed by start16. Instead of file concatenation to combine start16 with .z?img, use the linker. This will allow you to import the symbols _start and _end from payload and compute the size of the image. You'll have to create an intermediate file type, say .z?bin. Then in all the rules that use start16 and *.z?img, replace with *.z?bin. At the moment there will probably be no overlap between the source regions and the region that will be allocated by 40:13, but just in case, the code should be prepared to do either a forwards or a backwards move. This is not perfect though, because there is still the code in the prefix that may be returned to and this could have been wiped out by further loading in the interim (except perhaps the ROM prefix). Perhaps two regions should be copied to 40:13 memory, a trampoline out of the prefix, and later the body of the code. Perhaps too loader.S should be renamed to romprefix.S because that's what it is now. |