From owner-freebsd-drivers@FreeBSD.ORG Tue May 18 08:49:35 2010 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8F36106564A for ; Tue, 18 May 2010 08:49:35 +0000 (UTC) (envelope-from indranil@virident.com) Received: from caexchgw.virident.com (caexchgw.virident.com [209.31.25.116]) by mx1.freebsd.org (Postfix) with ESMTP id 865508FC1A for ; Tue, 18 May 2010 08:49:35 +0000 (UTC) Received: from caexch1.virident.info ([172.16.32.15]) by caexchgw.virident.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 18 May 2010 01:49:29 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Tue, 18 May 2010 01:49:26 -0700 Message-ID: <28631E6913C8074E95A698E8AC93D09101B5C093@caexch1.virident.info> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Storage driver design question Thread-Index: Acr2ZwVszeFegUKXQJi2HRY2mOrGpA== From: "Indranil Bhattacharya" To: X-OriginalArrivalTime: 18 May 2010 08:49:29.0870 (UTC) FILETIME=[075732E0:01CAF667] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Storage driver design question X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2010 08:49:35 -0000 Hi, =20 I am writing the driver for a storage device on the latest freebsd kernel. The device will sit on the PCIe bus.=20 As a starting point; I have written a very simple memory-disk driver that implements a geom-class. It implements the init() method by writing & reading from memory (that it has earlier allocated) as part of BIO_WRITE & BIO_READ respectively. I am able to create a filesystem on this driver & read/write files on this filesystem. I am also writing a PCI driver for the actual hardware device. Once that is done, I will modify the memory-disk driver to talk to this PCI driver instead of just operating from memory. Does this look like a correct design ? Or should the entry point to my driver sit somewhere else in the I/O stack ? =20 Thanks in advance, Indranil=20 =20 =20