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

parameters passing problem in driver module


In application program ,code for call to write system call is given
below...
      #include<fcntl.h>
    main()
	 { 
	  int count,fd;
	 fd=open("/dev/pseudo",O_RDWR);
	  write(fd,buff,5);
	  }
	  
In driver module code for getting the buffer and count 

    #include<all related header files...>
     
    int psuedo_write(struct inode*in,struct file*fp,char *buf,int count)
    {
      kprintf("<1>pseudo_write routine called \n");
      kprintf("<1>count=%d \n",count);
      kprintf("<1>buffer=%s \n",buff);
      return 0;
    } 
/******so here after inserting the module into the kernel using insmod 
pseudo.o and executing the application cc -c pseudo_app.c, the o/p on
console is *****/

"pseudo_write routine called" 
"count=9988345352" /*garbage*/
"buffer=@#%h" .   /*garbage*/
 
/*** but neither the  buffer is carried from user space to kernel space nor
the count, why?***/Please help me
out.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
Follow-Ups: