Here is a few basic kernel library functions that might be useful. Refer to "man" pages for a detailed information. Note that you should use care to use cli() and sti(), since misuse of them can freeze your kernel with no error messages.
printk()
NAME
printk - print messages to console log
SYNOPSIS
include <linux/kernel.h>
int printk(const char*fmt, ...)
_kmalloc(),
kfree() _
NAME
kmalloc, kfree - allocate and free pieces of memory
_cli(),
sti() _
NAME
cli, sti - disable/enable interrupts
SYNOPSIS
include <asm/system.h>
extern void cli()
extern void sti()
get_user(),
put_user(),
copy_from_user(),
copy_to_user()
NAME
get_user, put_user, copy_from_user, copy_to_user - copy
data between kernel space and user space
SYNOPSIS
include <asm/uaccess.h>
err = get_user ( x, addr );
err = put_user ( x, addr );
bytes_left = copy_from_user(void*to, const void *from,
unsigned long n );
bytes_left = copy_to_user(void*to, const void *from,
unsigned long n );
http://www.csee.umbc.edu/courses/undergraduate/CMSC421/fall02/burt/projects/howto_add_systemcall.html
Here is a few basic kernel library functions that might be useful. Refer to "man" pages for a detailed information. Note that you should use care to use cli() and sti(), since misuse of them can freeze your kernel with no error messages.
printk() NAME printk - print messages to console log
SYNOPSIS
include <linux/kernel.h>
_kmalloc(), kfree() _ NAME kmalloc, kfree - allocate and free pieces of memory
SYNOPSIS
include <linux/malloc.h>
_cli(), sti() _ NAME cli, sti - disable/enable interrupts
SYNOPSIS
include <asm/system.h>
get_user(), put_user(), copy_from_user(), copy_to_user()
NAME get_user, put_user, copy_from_user, copy_to_user - copy data between kernel space and user space
SYNOPSIS
include <asm/uaccess.h>