From owner-freebsd-fs@FreeBSD.ORG Mon Sep 5 15:58:26 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 19EFF16A41F for ; Mon, 5 Sep 2005 15:58:26 +0000 (GMT) (envelope-from stas@core.310.ru) Received: from core.310.ru (core.310.ru [83.97.105.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 917D543D75 for ; Mon, 5 Sep 2005 15:58:13 +0000 (GMT) (envelope-from stas@core.310.ru) Received: from core.310.ru (localhost [127.0.0.1]) by core.310.ru (8.13.3/8.12.11) with ESMTP id j85FrcRM012928; Mon, 5 Sep 2005 19:53:38 +0400 (MSD) (envelope-from stas@core.310.ru) Received: (from stas@localhost) by core.310.ru (8.13.3/8.12.11/Submit) id j85FrcdF012927; Mon, 5 Sep 2005 19:53:38 +0400 (MSD) (envelope-from stas) Date: Mon, 5 Sep 2005 19:53:38 +0400 From: Stanislav Sedov To: Jeb Campbell Message-ID: <20050905155338.GB9283@core.310.ru> References: <431BE951.4070101@c4solutions.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <431BE951.4070101@c4solutions.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-fs@freebsd.org Subject: Re: 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 15:58:26 -0000 On Mon, Sep 05, 2005 at 01:44:33AM -0500, Jeb Campbell wrote: > 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 > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > > Look throgh md(4) driver source (/sys/dev/md) - it is a good example.