#include #include #include /* The _syscall0 macro, defined in the unistd.h you put in /usr/include/asm, * creates the wrapper function you need to invoke your system call. * The "jondich" here needs to be whatever name you used after "sys_" * when you modified entry.S (e.g. I added the line ".long sys_jondich" * to entry.S). */ _syscall0(int,jondich) int main() { printf( "Hello from main\n" ); /* Here, I'm invoking the wrapper function created above * via the _syscall0 macro. */ int result = jondich(); /* If an error occurs, result will be -1, and the global * variable errno will get set to an appropriate value. * Then perror consults errno to determine what error * message to print. One common error message is something * like "function not implemented." That message will occur, * for example, if you neglected to do "make install" after * building your new kernel, or if you booted up into the * default kernel rather than your new one. */ if( result == -1 ) perror( "Trouble in paradise" ); return 0; }