Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KUNCExecute problems



I have done a little research on this issue and it isn't as easy as I'd hoped. Their is currently no clean way of getting into launchd. launchd is the replacement for our KUNC apis and it is more robust.

There are 3 main mechanisms to use.

1> mach_init: This is controlled through the /etc/mach_init.d and mach_init_per_user.d directories. The general model is that mach_init is configured with a set of 'named' ports that you can get access to through the bootstrap name space. mach_init starts listening on a port and if it finds a message it arranges for your process to launch with the message still in its queue. As you can see this is pretty cool, the problem is that you have to get the port name into the kernel. The easiest way I can think of doing this is to use the client daemon to do a io_async_method_scalarI_scalarO which passes in a send right. There is a little bit of research that has to be done about how you are going to keep a port reference once the user client shutsdown.

2> inetd: Standard tricks here. Just so a so_send from inside a kernel. I'm sure you are familar with this mechanism.

3> Dedicate a process to act as a helper for your driver using a dedicated user client.

Godfrey



On 05/16/2005, at 12:43 , Mike Smith wrote:


On May 13, 2005, at 1:15 PM, Andrew Gallatin wrote:


You ought to be able to register a service with launchd against a
'known'
port, and then simply message the port to have your service launched.


This is probably the easiest way to get launch/message-on-demand
semantics out of the kernel at this point.



Thank you, but I think you've just totally confused me. All that I
know about mach ipc could be written on the head of a pin, with plenty
of room for dancing angels. So please take pity.


What's a known port? How is it reserved so somebody else won't get
stomped on? How do I send a message to this port from my driver? Can
you point me at an example which does this?



Not off the top of my head, but this is well within the domain of the new
launchd. I'd start by looking for examples there.



It sounds like this could essentially be used like a mach version of
FreeBSD's devd, where I can send a message to devd from my driver via
devctl_notify().  This message then causes my user level daemon to be
started...


Yes, although with considerably wider scope.

 = Mike



_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden
References: 
 >Re: KUNCExecute problems (From: Andrew Gallatin <email@hidden>)
 >Re: KUNCExecute problems (From: Andrew Gallatin <email@hidden>)
 >Re: KUNCExecute problems (From: Mike Smith <email@hidden>)
 >Re: KUNCExecute problems (From: Andrew Gallatin <email@hidden>)
 >Re: KUNCExecute problems (From: Mike Smith <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.