From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 28 09:48:20 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1E2716A41F for ; Wed, 28 Sep 2005 09:48:20 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from stella.fs.ei.tum.de (stella.fs.ei.tum.de [129.187.54.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EEB743D49 for ; Wed, 28 Sep 2005 09:48:15 +0000 (GMT) (envelope-from corecode@fs.ei.tum.de) Received: from localhost (localhost [127.0.0.1]) by localhost.fs.ei.tum.de (Postfix) with ESMTP id 183CA8DDA5; Wed, 28 Sep 2005 11:48:14 +0200 (CEST) Received: from stella.fs.ei.tum.de ([127.0.0.1]) by localhost (stella [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28600-01-3; Wed, 28 Sep 2005 11:48:13 +0200 (CEST) Received: from [10.150.180.180] (r180180.olydorf.swh.mhn.de [10.150.180.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by stella.fs.ei.tum.de (Postfix) with ESMTP id A777D8DD8C; Wed, 28 Sep 2005 11:48:13 +0200 (CEST) Message-ID: <433A66DD.7010305@fs.ei.tum.de> Date: Wed, 28 Sep 2005 11:48:13 +0200 From: Simon 'corecode' Schubert User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050912) X-Accept-Language: en-us, en MIME-Version: 1.0 To: rashmi ns References: <9f999316050928011010542946@mail.gmail.com> In-Reply-To: <9f999316050928011010542946@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at fs.ei.tum.de Cc: freebsd-hackers@freebsd.org, bugi@lists.redbrick.dcu.ie Subject: Re: IOCTL :Facing problems while acccessing data from kernel space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 09:48:21 -0000 rashmi ns wrote: >>#define HDLCMODE _IOR('6',0xF,int) >>when i trying to uprintf the data which was sent from the user-space in >>the device-driver-ioctl-routine i'll get a different value than which was >>passed. Can anybody please tell me why this is happening . I pass the >>address of an integer where data is stored from the user space as third arg >>to the ioctl call . maybe you should show how you do it in kernel. I suspect you try to access it as an int* as well, which is wrong. The kernel already does take care of this for you. Just write the integer you want to pass into the data area and you're done. cheers simon -- Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\ Work - Mac +++ space for low $$$ NOW!1 +++ Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \