I'm having some trouble with getting outb implemented.
This is outb:
Code: Select all
void outb( unsigned short port, unsigned char val )
{
asm volatile("outb %0, %1" : : "a"(val), "Nd"(port) );
}
Now, this project is primarily in C++, and the C++ code needs to reference outb.
Now you might be wondering "Why doesn't he just put the code in a C++ file?".
Good question! Putting the code in C++ gives the error
Code: Select all
Error: operand type mismatch for `out'
Now back to our friend outb, Compiling the c file gives no errors, yet when linked to the kernel, it gives
Code: Select all
undefined reference to `outb(unsigned short, unsigned char)'
Also, the object file is being referenced by the linker.
Help Please?
PS:I searched on Google, and on google again with the site:osdev.org tag, none of them worked or applied.