On Aug 29, 2014, at 4:38 AM, Ard Biesheuvel <[email protected]> wrote:
> There is no vector table at the start of the now 0x1000 upward shifted
> image either, so it is not a matter of putting a bunch of 'b 0x1000'
> instructions at the right offsets (depending on whether you are
> targeting ARM or AArch64). However, the first module that executes
> installs a vector table by setting VBAR in its CEntryPoint() function,
> ie. the entry point that runs immediately after setting up the
> environment in assembler, and we have already identified that
> exceptions taken before that won't nop-slide into the normal entry
> point and go unnoticed.
>
> Note that the above applies equally to all supported ARM platforms in
> Tianocore, so I think having the DATA = { } with the branches in hex
> is the most suitable solution, at least for now.
I’m not opposed to the DATA = {} solution as long as it is just a template that
anyone can use. It is not a good way to write code.
The 1st UINTN in the FV Header ZeroVector[] is a branch to _ModuleEntryPoint.
I’m wondering if we should make the 2nd UINTN the address of _ModuleEntryPoint.
Then we could make _ModuleEntryPoint the vector table. If _ModuleEntryPoint is
a vector table the branch to _ModuleEntryPoint, would just branch to the reset
code in the SEC. Thus the DATA = {} code can branch to the start of the FV for
the reset vector. For exceptions you could get the _ModuleEntryPoint address
from the start of the FV + sizeof (UINTN). You can then add the vector +
sizeof(UINTN) to that address to dispatch the exception handler in the SEC
code. The DATA = {} code would be write once, and never have to change again.
If this is useful we could update the build tools to also patch the
_ModuleEntryPoint in the 2nd entry in the FV header zero vector.
Given how simple the ARM instruction set is it may also be possible to extract
the offset from the current branch instruction and not require any tools
changes.
Thanks,
Andrew Fish------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel