Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 May 2001 16:53:33 +0200
From:      Robert Suetterlin <sutter@robert2.mpe-garching.mpg.de>
To:        freebsd-hackers@freebsd.org
Subject:   Q: porting a driver from linux to freebsd.
Message-ID:  <200105031453.f43ErXS31356@robert2.mpe-garching.mpg.de>

next in thread | raw e-mail | index | archive | help
Hello!

I asked this already on freebsd-questions and was suggested to ask on this list, too.

	I have a linux driver for a video grabber card (dfg/bw1 from 'the imaging source').  This card does not use a well bt848 or similar chip.  I would like to transfer this driver to freebsd.

I do understand how the driver works under linux and I will explain below.  I have also read articles on newbus, some netbsd docs, several freebsd manpages and the sources of meteor.c.  I know in principle how to do a driver under freebsd.  But I never did it before and wanted to get some expertise on how to do it best.

Under Linux the driver is just an empty shell that links into the kernel, then allocates some memory and provides rather general access to the pci-bus and the allocated memory using ioctl and mmap.
	There is a 'lowlevel' library that translates the ioctl and mmap calls to a struct based API.
	This API is then used by a binary only library to do all the work.  I.e. find the hardware on the pci-bus.  Read and write the device memory.  Transfer data to main memory.  Set grabbing specifics, etc.

The reasons for this implementation are not mine to discuss, but in pricipal I do understand the idea, as it separates the OS/hardware specific part from a more general library.  And it allows to distribute the library in binary format and evade some copyright problems.

A driver as described above would not really be a PCI-device-driver as it would not allocate (attach to) a pci-device during configuration.  My feeling is, that this is some kind of PCI-interface, or PCI-bus abstraction, more like an API, not like a real device.  I think it is more like a new system call then a real device.

My question:  If you (as very experienced driver / kernel programmer) would face this task.  And if You were not allowed to question /sidestep the task itself.  Haw would You implement this under Freebsd?
	I even do not know enough keywords to ask more specific.  I could ask: Would You do a pseudo device?  But I do not know if this could be done by a pseudeo device.  Etc. ...


Sincerely,

	Robert S.  Haw would You implement this under Freebsd?
	I even do not know enough keywords to ask more specific.  I could ask: Would You do a pseudo device?  But I do not know if this could be done by a pseudeo device.  Etc. ...


Sincerely,

	Robert S.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105031453.f43ErXS31356>