kernel's timer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux