Subject: Re: Kernel API question 2
To: Bill Studenmund <wrstuden@NetBSD.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 03/24/2006 18:38:47
Bill Studenmund wrote:
> On Fri, Mar 24, 2006 at 10:42:46AM +0100, Filka Michal wrote:
>   
>> Yes, this seems like thing I was looking for. 
>>
>> I have one more question. The last parameter of NDINIT is described as
>> "the calling process.". However, if I call it from my driver I needn't
>> to be in any process context ... So, is NULL allowed or should I use any
>> "kernel process identifier"?
>>     
>
> I'd recommend not doing it that way. I think you'll do better to either
> move to a newer version of NetBSD, back-port the firmware(9) changes to
> your version, or write a little program to call an ioctl on your driver
> that does the load. You can have the program open the file and then either 
> pass the file descriptor into the kernel or read the firmware and pass the 
> address of the memory into the kernel.
>
> It's a lot easier to change the file name if you pass it to a program than 
> if it's hard-coded in the kernel. :-)
>
> Take care,
>
> Bill
>   

Another approach, is to simply *compile* the firmware into a a data
object and handle it that way.  Its a little wasteful of kernel memory,
but it wouldn't be the first time this has happened.  See wi(4) for an
example....

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191