From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 2 10:11:47 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 DC0DC16A41C for ; Sat, 2 Jul 2005 10:11:47 +0000 (GMT) (envelope-from sebastien.b@swissinfo.org) Received: from md1.swissinfo.org (md1.swissinfo.org [146.159.4.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60A8643D1D for ; Sat, 2 Jul 2005 10:11:46 +0000 (GMT) (envelope-from sebastien.b@swissinfo.org) Received: from mail.swissinfo.org ([194.6.181.33]) by md1.swissinfo.org (phad1.swissinfo.org [146.159.6.9]) (MDaemon.PRO.v7.2.1.R) with ESMTP id 03-md50000552320.msg for ; Sat, 02 Jul 2005 12:11:43 +0200 Received: from AAmiens-152-1-18-135.w83-192.abo.wanadoo.fr (83.192.199.135) by mail.swissinfo.org (7.0.020) (authenticated as sebastien.b) id 41539420044EA7C9 for freebsd-hackers@freebsd.org; Sat, 2 Jul 2005 12:11:43 +0200 From: Seb To: freebsd-hackers@freebsd.org Date: Sat, 2 Jul 2005 12:12:04 +0200 User-Agent: KMail/1.8 References: <200506251203.13569.sebastien.b@swissinfo.org> <200506291155.50929.sebastien.b@swissinfo.org> <20050629134029.GA220@pm514-9.comsys.ntu-kpi.kiev.ua> In-Reply-To: <20050629134029.GA220@pm514-9.comsys.ntu-kpi.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200507021212.05048.sebastien.b@swissinfo.org> X-Spam-Processed: phad1.swissinfo.org, Sat, 02 Jul 2005 12:11:43 +0200 (not processed: message from valid local sender) X-MDRemoteIP: 194.6.181.33 X-Return-Path: sebastien.b@swissinfo.org X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org X-MDAV-Processed: phad1.swissinfo.org, Sat, 02 Jul 2005 12:11:43 +0200 Subject: Re: Accessing filesystem from a KLD 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: Sat, 02 Jul 2005 10:11:48 -0000 Andrey Simonenko wrote=A0: > You got page fault from namei(), which is called from vn_open() to lookup > a path name. namei() tries to obtain a reference on current directory for > the current thread. This current directory (fd_cdir field) is NULL in > your kthread. At this point a page fault in kernel address space is > generated. You were right :) It works now. > Can you change fd_cdir in kthread to rootvnode I don't know, haven't > checked this yet. =20 It works - and that's what NDISulator does. You also need to set fd_rdir. Thanks ! Mike Silbersack wrote : > Ask damien.bergamini@free.fr for his code that does exactly what you're=20 > asking for. :) I've looked at Damien's source, but AFAIK in his driver, the firmware is=20 loaded from userspace through an ioctl call on the network interface.