From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 25 18:01:19 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AFAB1065676 for ; Fri, 25 Jun 2010 18:01:19 +0000 (UTC) (envelope-from crb@chrisbowman.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4354E8FC15 for ; Fri, 25 Jun 2010 18:01:18 +0000 (UTC) Received: by gxk26 with SMTP id 26so327425gxk.13 for ; Fri, 25 Jun 2010 11:01:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.221.134 with SMTP id ic6mr713604qcb.65.1277487111314; Fri, 25 Jun 2010 10:31:51 -0700 (PDT) Received: by 10.229.225.142 with HTTP; Fri, 25 Jun 2010 10:31:51 -0700 (PDT) X-Originating-IP: [139.181.0.34] Date: Fri, 25 Jun 2010 10:31:51 -0700 Message-ID: From: Christopher Bowman To: freebsd-hackers@freebsd.org X-Mailman-Approved-At: Fri, 25 Jun 2010 18:35:14 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: PCI Express and drivers 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: Fri, 25 Jun 2010 18:01:19 -0000 I have a Xilinx PCI Express board that has an on board PCIe interface macro. I intend to have an address space with memory and another with my devices control registers. I wish to program this board under FreeBSD. It would seem to me that the way to do this would be to write a driver that would allow me to map these two address spaces into a user process which could then directly interact with the device. In my case my board doesn't really support multiple users, and it doesn't really seem to make sense to me to put a lot of code in the kernel to create some sort of interface to allow multiple processes to interact with my device via some sort of syscall which would impose a lot of overhead in any case. By mapping the address ranges into a user process I can write user programs to drive the board without having to recompile and reboot the kernel each time I make a change, plus if I do something stupid and crash my user space process it shouldn't bring down the whole kernel. Am I thinking about this wrong? Is there some place I can go to read up on what I should be doing? If I am thinking about this correctly, then how does one map device memory into a user space process? How does one make sure that only one process has such a mapping? Thanks Christopher