I have a big problem with calls from asm code to c code.
If calls are from c code everything is ok.
That is my start.asm:
Code: Select all
bits 32
section .text
align 4
global Start
Start:
cli
extern _kernel_main
call _kernel_main
nop
jmp $
Code: Select all
seg000:00010000 cli
seg000:00010001 call near ptr unk_1000A ;<---------------------- This is a invalid call address
seg000:00010006 nop
seg000:00010007
seg000:00010007 loc_10007: ; CODE XREF: seg000:loc_10007j
seg000:00010007 jmp short loc_10007
seg000:00010007 ; ---------------------------------------------------------------------------
seg000:00010009 db 0
seg000:0001000A unk_1000A db 0 ; CODE XREF: seg000:00010001p
seg000:0001000B db 0
seg000:0001000C db 0
seg000:0001000D db 0
seg000:0001000E db 0
seg000:0001000F db 0
seg000:00010010 ; ---------------------------------------------------------------------------
seg000:00010010 sub esp, 0Ch ;<-----------------------_kernel_main start here
seg000:00010013 call sub_101E0
I have the same problem with irq's. Assembler handler fails to call c handler.
i'm using nasm and cygwin.
Thank you in advance.
Sorry for mistakes, i'm not very good at English.