hi at all,
i have a problem with kernel's timer. I
creat one module that it creat a file risc.txt and wrote in this file "hello
world" but when i link module then system's block, why?
this is a chunk of my module, thanks
all:
.....
struct timer_list timer;
struct file *f;
mm_segment_t oldfs;
char *buf="hello world";
void write(){
f->f_op->write(f,buf,11,&f->f_pos);
}
init_module:
oldfs=get_fs();
set_fs(KERNEL_DS);
f=filp_open("risc.txt",O_CREAT | O_WRONLY,0644);
init_timer(&timer);
timer.expires=jiffies+HZ
timer.function=write(
);
add_timer(&timer);
set_fs(oldfs);
#init_module
thanks
R!SC
|