good luck! i tried to call your code from a test program and to disassemble, here is the symbol to use: _ZN3idt16undefinedHandlerEv
you certainly already know that g++ modifies quit a bit the names!!
there is an option to prevent g++ from mangling the names, it is to use extern "C" before the function declaration, the big problem is that the following code won't compile:
Code: Select all
#include <iostream>
using namespace std;
namespace idt
{
extern "C" void undefinedHandler()
{
cout<<"idt";
}
}
namespace isr
{
extern "C" void undefinedHandler()
{
cout<<"isr";
}
}
int main()
{
cout << "Hello world!" << endl;
idt::undefinedHandler();
return 0;
}
because the symbol undefinedHandler already exists!
my own solution is to use a function written in C, declared as extern and callable from nasm, the function the calls the CPP on in class.
have fun!