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: Allocating an LDT entry / calling a kernel function from user code



Alexei Kosut wrote:

I don't believe thread_set_user_ldt is exposed via any user-callable function. If you need this functionality via a supported API, I'd suggest filing a bug at <http://bugreport.apple.com/> or contacting DTS.

Thanks - I've just logged Radar #4155117.


Just FYI, this, or a similar function is available in every other x86 UNIX variant that I'm aware of.

It looks like the function goes through the machdep call table defined in osfmk/i386/machdep_call.c, and there's an exported kernel symbol for this table - but again, the table doesn't appear to be accessible from libSystem, so I'm not sure how user code can access it. Also, is there any assurance that the machdep call table order will remain the same across different versions of darwin?


Absolutely none. There is no guarantee of compatibility at the syscall level between versions of Darwin.

If you want to try calling an unsupported machdep call, you can find examples of how to do it by looking for callers of the other functions defined in machdep_call.c. For example, the x86 implementation of pthread_set_self (in Libc) invokes the thread_fast_set_cthread_self call.

On the off chance that this isn't added as a feature of future releases, would it be possible as an alternative to call the function via a KEXT somehow?


Thanks,
-Gav

--
Gavriel State
email@hidden



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

This email sent to email@hidden
References: 
 >Re: Allocating an LDT entry / calling a kernel function from user code (From: Alexei Kosut <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.