On Mar 24, 2004, at 10:18 AM, Morgan Winer wrote:
My question is simply this: why remove the task_{s,g}et_emulation
functionality from the Mach kernel?
Besides the implementation penalties on "normal" traps that implementing the emulation vectors can introduce (as I mentioned in an earlier email), emulation vectors also lost favor with most implementors of system-call emulations. For instance, OSF AD/1 and MkLinux used a completely different mechanism (syscall exceptions). Why? I can tell you a few reasons: Emulating a system call within the task itself (as the emulation vector code does), it is really difficult to provide proper handing of things like EFAULT vs actually taking a fault. By implementing the handler in another task (as is better facilitated by the syscall exception mechanism), you can handle this much more correctly. The emulation vector code requires the Mach syscalls numbers to never conflict with the syscall numbers you are trying to emulate (because you're going to need to make Mach syscalls in the implementation of the emulation vector). This is well and good if you can compile your own kernel to assure these numbers are in disjoint sets. But for a binary released system like Mac OS X, this can be difficult to arrange. The syscall exception mechanism is controlled by the task_set_exception_ports() interface (EXC_MASK_SYSCALL and EXC_MASK_MACH_SYSCALL handlers). But before you get all excited, this mechanism was last used before the BSD and Mach kernels were reunited. So, the ability to override the in-kernel BSD syscall numbers is not glued up yet. But if you are looking for a mechanism that has a better chance of getting re-added to the kernel, I would put my bets on this mechanism - not the emulation vector stuff. --Jim [demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s] _______________________________________________ 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)
-
Jim Magee