Subject: Re: Porting FreeBSD kernel module (driver)?
To: Thomas Klausner <wiz@NetBSD.org>
From: None <firstname.lastname@example.org>
Date: 11/02/2004 17:31:00
On Tue, Nov 02, 2004 at 05:10:03PM +0100, Thomas Klausner wrote:
> How much work is it to port a FreeBSD kernel module (driver) 
> to NetBSD? Has someone done that and could give me some hints
> and/or pointers?
Most of it will be rather mechanical: converting data types,
a few parameters in the usual routines, etc.
The meta-routines (attachment and so on) are a bit different, but
still close enough so it is not too difficult to adapt them.
It gets slightly more difficult when you have to convert from one
API to the other. It might be the case here for the I2C layer.
However, I2C being I2C, it simply _can't_ be difficult to go from
one to the other. FreeBSD also had bus_space(9) API drift a bit,
too, so there will be a bit of work with those but it still works
the same way, so it more about passing the correct arguments.
As for the rest, it appears to be a private interface to the
device, so you won't have to change the semantics of it, which is
FWIW, it took me 4 or 5 weeks to port the NVidia graphic driver
to a usable state in NetBSD, and I think I've spent most of it at
understanding how I should convert the contig_malloc() stuff. It
was nearly my first look at kernel code at that point.