From owner-freebsd-fs@FreeBSD.ORG Mon Sep 5 06:44:36 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B33116A41F for ; Mon, 5 Sep 2005 06:44:36 +0000 (GMT) (envelope-from jebc@c4solutions.net) Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id 119BB43D45 for ; Mon, 5 Sep 2005 06:44:35 +0000 (GMT) (envelope-from jebc@c4solutions.net) Received: from pcp0012210017pcs.blairblvd.tn.nash.comcast.net ([69.245.61.169] helo=ares.c4solutions.net) by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.51) id 1ECAiZ-0002AJ-Dg for freebsd-fs@freebsd.org; Mon, 05 Sep 2005 02:44:35 -0400 Received: from [10.10.1.115] (jeb-64.internal.c4solutions.net [10.10.1.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ares.c4solutions.net (Postfix) with ESMTP id 6E008ADAF7 for ; Mon, 5 Sep 2005 01:44:31 -0500 (CDT) X-Mail-Handler: MailHop Outbound by DynDNS.org X-Originating-IP: 69.245.61.169 X-Report-Abuse-To: abuse@dyndns.org (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: jebutk Message-ID: <431BE951.4070101@c4solutions.net> Date: Mon, 05 Sep 2005 01:44:33 -0500 From: Jeb Campbell User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050816) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: kernel newb -- read/write to a local file from in kernel X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2005 06:44:36 -0000 I'm trying to learn about kernel programming and as a weekend project I've started writing a Netgraph to file/dev module. The Netgraph stuff was pretty easy, but I'm at a loss on the file access part as I've never done anything in-kernel. After much searching (most of it not knowing what I was looking for), I think that I'm looking for something like "Vnode interface mechanics, write to a local file" as taught in Mr. McKusick's "FreeBSD Kernel Internals: An Intensive Code Walkthrough". I've looked at nullfs/null_vnops.c, but I think that is more of a pass-through example. Does anyone know of any online code that shows the process of opening a file/device for read/write? Thanks in advance if someone has any tips or more info. (and sorry to bother the kernel hackers with such a newbie question) -- Jeb Campbell jeb@c4solutions.net