Re: Passing parameters to a kext on load
Re: Passing parameters to a kext on load
- Subject: Re: Passing parameters to a kext on load
- From: Nathan Toone <email@hidden>
- Date: Mon, 28 May 2007 16:31:41 -0600
Will this work as well for an NKE? Most of where I see documentation
for this is for IO kit drivers...
I know that using the kernel control mechanisms are the "approved"
way of getting parameters to an NKE, but I'd like to set a couple of
parameters which can be used in a failure condition - when the
userspace application is *not* available.
-Nathan
On May 25, 2007, at 11:34 PM, Jim Guyton wrote:
Your dictionary is passed in with the init() call, then you can
do things like
const OSNumber *numObject = OSDynamicCast(OSNumber, dict->getObject
("parameterName"));
if (numObject)
value = numObject->unsigned32BitValue();
I suspect most of the drivers in the darwin source have some set
of parameters they look for.
Cheers,
-- Jim
On May 25, 2007, at 9:54 PM, Nathan Toone wrote:
That's exactly what I was wondering! Perfect!
Does anyone have sample code which reads from the registry? (I'm
pretty new at kernel development...)
-Nathan
On May 25, 2007, at 9:15 PM, Jim Guyton wrote:
The usual way to pass info to a driver on load is via the dictionary
stored in the Info.plist file. The kext loader will copy the data
items to the registry and the driver can read it from there.
For debugging you can look at the registry with ioreg and/or the
developer tools applicatio IORegistryExplorer.
-- Jim Guyton
On May 25, 2007, at 8:04 PM, Nathan Toone wrote:
I have noticed that kernel modules (I'm specifically working on
a socket filter NKE) have parameters passed to their
MODULE_START and MODULE_STOP functions. a kmod_info_t *
structure and a void *.
What do these parameters represent? Is there a way for me to
specify data that gets passed to my module on load? If so, how
do I set that up?
Pointers to documentation would be appreciated as well. I
wasn't able to find what I was looking for.
Thanks!
-Nathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden