Kext ring level

6 views
Skip to first unread message

José Cornado

unread,
Dec 27, 2011, 4:49:22 PM12/27/11
to darwin...@lists.apple.com
Prelude:

*) Literature sates that task switching is performed by software instead of hardware in most modern OS. 

In which ring level does a kext run?  As far as I have researched the cpu will not allow a task switch from outside the GDT. Does GDT is memory protected? If so would a kext have access to it?

I have several avenues to take and I would like to explore all. 


Thanks a lot in advance and happy holidays!

--
José Cornado

--

home: http://www.efekctive.com
blog:   http://blogging.efekctive.com
----------------------

Everything has been said before, but since nobody listens we have to keep going back and beginning all over again.

Andre Gide

Quinn "The Eskimo!"

unread,
Jan 3, 2012, 7:00:16 AM1/3/12
to darwin-kernel@lists.apple.com Kernel

On 27 Dec 2011, at 21:49, José Cornado wrote:

> In which ring level does a kext run?

The Darwin kernel does not use the concept of rings. All kernel code runs in supervisor mode, and all user processes run in user mode. On x86 CPUs these map to rings 0 and 3, respectively, but to some extent that's an implementation detail. The kernel has and continues to run on a variety of different CPU architectures, most of which aren't based on rings.

> Does GDT is memory protected? If so would a kext have access to it?

What are you planning to do with the GDT? In most cases a KEXT can achieve its memory management goals without having to access the GDT directly, and accessing the GDT directly is likely to result in long-term binary compatibility problems.

Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (Darwin...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/darwin-kernel-garchive-95844%40googlegroups.com

This email sent to darwin-kernel-...@googlegroups.com

Shantonu Sen

unread,
Jan 3, 2012, 12:56:48 PM1/3/12
to darwin-kernel@lists.apple.com Kernel
The kernel is open source, you can build it yourself and add instrumentation to determine these things.

None of these things are considered KPI or stable interfaces. Perhaps the Linux kernel might be more interesting for your research.

Shantonu

> http://lists.apple.com/mailman/options/darwin-kernel/ssen%40apple.com
>
> This email sent to ss...@apple.com

José Cornado

unread,
Jan 3, 2012, 1:32:11 PM1/3/12
to Shantonu Sen, darwin-kernel@lists.apple.com Kernel
Thanks, it would be a little overkill for now. I can stay out of kernel space. I will minimize the noise though :-}

Thanks anyway for the help!

Reply all
Reply to author
Forward
0 new messages