Netgraph <-> disk module

John-Mark Gurney gurney_j at resnet.uoregon.edu
Mon Sep 5 18:20:55 PDT 2005


Jeb Campbell wrote this message on Sun, Sep 04, 2005 at 21:59 -0500:
> First let me say that I'm in way over my head on this one (but you have 
> to start somewhere I guess).
> 
> Anyway, I'm trying to implement ata-over-ethernet (aoe) as a netgraph 
> module -- see http://www.coraid.com for specs and freebsd drivers, or 
> http://aoetools.sf.net for user space code (linux only).
> 
> As my first kernel programming experience I have completed a netgraph 
> node that splits incoming packets off based off ethernet type and then 
> sorts them based on aoe shelf/slot to the appropriate hook.
> 
> Now I need to write a node that performs aoe on a device.  The disk 
> access is where I'm stuck.  Archie mentioned in "All About Netgraph" 
> that netgraph could be used to talk to disks -- well here is the chance.
> 
> Can anyone point me in the right direction for opening and read/writing 
> a device (/dev/ad0s1a, /dev/gvinum/disk1, etc) from kernel code?  I 
> think Google is going to ban my ip from all the searching ;) .

This really should go to -hackers or something, since you aren't
asking how to write a netgraph node really, as you are asking how
to make a disk device...  what you want/need to look at is to look
at the disk(9) api, and work from there...

once you have implemented disk(9) as part of your netgraph module,
the rest of the disk slicing like fdisk and disklabel will work fine..

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-net mailing list