On 03/04/14 12:55, Andrew Fish wrote:
> Seems folks are always trying to be creative in this area …..
> 
> For X64 Xcode does not support relocations. So you need to write RIP relative 
> code. 
> 
> .asm
> REPEAT  32
>     db      6ah        ; push  #VectorNum
>     db      ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegin) 
> / 32) ; VectorNum
>     push    rax
>     mov     rax, CommonInterruptEntry
>     jmp     rax
> ENDM
> 
> .S
> Exception0Handle:
>     .byte   0x6a    #  push #VectorNum
>     .byte   0
>     pushq   %rax
>     .byte   0x48, 0xB8
>     .quad   ASM_PFX(CommonInterruptEntry)
>     jmp     *%rax
> 
> .Andrew get you started idea, I’ve not test this. 
> 
> Exception0Handle:
>     pushb   0      // The .asm macro needs to repeat so I’m guessing that is 
> driving the db/.byte
>     pushq   %rax
>     leaq    ASM_PFX(CommonInterruptEntry)(%rip), %rax // 7 byte instruction. 
>     jmp     *%rax
>     nop              // I’m not sure if it safe to change the size of these 
> entries. 
>     nop
>     nop
> 
thanks! I played around some more with this, and with the other sections. but
I just finally gave up, and built a crosscompiler instead.

i think a crosscompiler tut in the guide would make thing MUUUUUCH easier for
people developing on osx.

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to