Hi,

Assuming I didn't forget to commit anything -- and there were quite a 
lot of small fixes that went into various places -- you can now run 
NetBSD PCI device drivers in userspace on Linux.

        http://repo.rumpkernel.org/pci-userspace-linux

The most obvious use case is driver development.  So if we're talking 
about NetBSD driver development, why support running on Linux?  That's 
because Linux readily provided a framework for accessing PCI devices 
from userspace.  I'm sure e.g. NetBSD could be supported, but that would 
require investing a few days in developing a kernel module to expose a 
generic PCI device to userspace.

A less obvious use case is one of those newfangled "userspace makes it 
fast" thingies which are popular especially for networking.  Some 
adjustments would be needed for that, though, especially for handling 
interrupts.

Anyway, driver iteration is nice and fast and panics are not a problem. 
  Probing a device takes a fraction of a second.  See (*) for an example 
run.

It's also quite safe even without one of the fabled IOMMU's, at least as 
long as you don't misprogram addresses; even though I did misprogram 
several times during development, my host is completely fin32$(@*!!@.

*)

root@watou:~/src/pci-userspace-linux/examples/if_wm# time ./example
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
     The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

NetBSD 6.99.40 (RUMP-ROAST) #0: Tue Apr 15 14:33:21 UTC 2014
        pooka@watou:/home/pooka/src/buildrump.sh/obj/lib/librump
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
pci0 at mainbus0 bus 0
pci0: memory space enabled, rd/line, rd/mult, wr/inv ok
wm0 at pci0 dev 0 function 0: 82801I mobile (AMT) LAN Controller (rev. 0x03)
wm0: WARNING: unable to map I/O space
wm0: interrupting at pausebreak
wm0: PCI-Express bus
wm0: FLASH
wm0: Ethernet address xx:xx:xx:xx:xx:xx
ukphy0 at wm0 phy 2: OUI 0x000ac2, model 0x000b, rev. 1
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto
panic: just a fun demo panic I added to the end of wm_attach
rump kernel halting...
halted
Aborted (core dumped)

real    0m0.678s
user    0m0.016s
sys     0m0.495s
root@watou:~/src/pci-userspace-linux/examples/if_wm#

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
rumpkernel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rumpkernel-users

Reply via email to