Page 1 of 1
Assembly Function
Posted: Sat Dec 20, 2003 9:42 am
by chris
I am having trouble with my assembly function for changing ISR's. It is called "change_isr", and when I link my kernel it says:
undefined reference to 'change_isr'
I've got the prototype in a header file and it is included. I've also tryed putting it directly in the C file, but it shows no difference.
Re:Assembly Function
Posted: Sat Dec 20, 2003 10:16 am
by Therx
C Functions need a leading underscore so in the assembly source rename the function to _change_isr. Like wise if you try to call a C function from asm then prefix an underscore to the function name eg
ASM
Code: Select all
global _sharethis
extern _getthis
_sharethis: jmp _getthis
C
Code: Select all
extern void sharethis();
void gethis();
...
sharethis();
...
void getthis()
{
...
}
pete
Re:Assembly Function
Posted: Sat Dec 20, 2003 10:34 am
by chris
Thanks I got it working now
Re:Assembly Function
Posted: Sat Dec 20, 2003 11:59 am
by Candy
This (afaik) doesn't work under linux, as GCC does not prepend the _'s.
Re:Assembly Function
Posted: Sat Dec 20, 2003 1:01 pm
by chris
Yeah, it wasn't the _'s, I messed up the [global <func>].