Re: Various questions from someone starting out Kern development
On Saturday, February 28, 2004, at 09:24 PM, Rob Ballantyne wrote: Hi All, This is my first time posting on the list. Hello everyone. I've looked at some of the doc and read some of the list looking for various things. I can't find em. This has been discussed on this list, or the darwin-development list, several times in the past. Look specifically for mail from Jim Magee, who has explained a lot of what Mach is and does for Darwin. I hope the questions are not too obvious and that I haven't missed finding them somewhere. I'd greatly appreciate any answers and/or pointers to doc I haven't found yet. There is some documentation available on the Apple developer web site (<http://developer.apple.com>). I don't know how much of it pertains to your line of questioning, though (or how deep it goes). If you have a Mac OS X system, with Developer tools installed, you should have a fair amount of it in <file://Developer/Documentation>. 1. As I recall Mach based systems are usually a collection of communicating Mach tasks/servers but it appears that the Darwin/Mac OS X kernel must be a single monolithic Mach Task. Although there is no netname server at all, the bootstrap server subsumes these responsibilities I've read, not even the bootstrap server is available to the Kernel task(s). So the questions here are: is the BSD kernel a single Mach task? Are there any other Mach tasks (doing Mach IPC) within the kernel boundry? The Darwin kernel is a monolithic kernel. There really is no "BSD Kernel". Instead, there is a kernel that uses Mach for messaging, memory management, and process/task/thread management ('process' is really specific to BSD, while 'task' is specific to Mach); IOKit for device support; and BSD for the rest of the OS services, including the process-management stuff that Mach does not handle. It's all one big happy family down there. Mach IPC is primarily used for user/kernel and user/user communication. Perhaps some is used 'intra-Mach', but I'm not sure. 2. I've also read in the list that the way to do kernel/userland boundry crossings with Mach is to somehow pass the required port rights from userland into the kernel. How is this usually done? Are there realtivly simple examples of services (Mach servers if that's possible) living in kernel land that are in the kernel that someone can point me to? If you want to interact specifically with Mach, you do have to use Mach calls. These are compiled in when the kernel and user libraries are built. I don't know that Mach in Darwin can really support 'Mach servers' at this point; someone with a bit more understanding that I have will have to clarify that. Interacting with the BSD-based services (file system, networking, standard Unix system calls) is done as usual. Look for sysent.c in the xnu/bsd tree. As for examples, the source is available. Look for the 'xnu' project on the Darwin web site <http://developer.apple.com/darwin>. The top-level directories in that project deal with the three major components (Mach, BSD, IOKit), together with some support pieces. The dynamic pager is one piece that uses Mach messaging. Also, direct communication with IOKit device drivers is done with something called the UserClient interface, which, I think, is Mach-based. 3. Older Mach documentation pretty explicitly states that MachIPC is a wire protocol in addition to an in kernel IPC mechanism. Are the hooks still in Darwin/Mac OS X to do IPC between distributed processes? Not that I'm aware of. There may be vestigial code in there, but it's atrophied... Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | "Weaseling out of things is what | separates us from the animals. | Well, except the weasel." | - Homer J Simpson *--------------------------------------*-------------------------------* _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Justin Walker