/* syscall-hello.c * A simple system call, printk and return hard coded into the * kernel. * * We'll use an existing syscall entry (futex) and replace it * * Include file locations * is /usr/src/linux/include/linux * is /usr/src/linux/include/asm-i386 * is part of standard gcc include for making a * general syscall, see man syscall. * * Source file locations * sys_call_table[] /usr/src/linux/arch/i386/kernel/entry.S * system_call /usr/src/linux/arch/i386/kernel/entry.S */ /* kernel programming */ #ifndef LINUX #define LINUX #endif #ifndef __KERNEL__ #define __KERNEL__ #endif #include /* needed for KERN_ALERT */ /* Not used yet */ /* #include the list of system calls and syscall function */ /* #include pre-defined system call number constants */ /* #include user space memory access functions */ /* prototypes */ asmlinkage void my_syscall_hello(void); /* My hello world system call */ asmlinkage void my_syscall_hello(void) { printk(KERN_ALERT "my_syscall_hello: entering.\n"); printk(KERN_ALERT "my_syscall_hello: leaving.\n"); }