Exception trapping from a kernel extension
Exception trapping from a kernel extension
- Subject: Exception trapping from a kernel extension
- From: "Jevin Sweval" <email@hidden>
- Date: Fri, 20 Jul 2007 01:00:18 -0400
I'm writing a kext that will let me access the MSRs on my CPU using
rdmsr and wrmsr. The problem is, if you make a booboo with what
register you read or write and what you write to the register, you get
a general protection fault. Linux has methods to catch the GPFs and
not panic (rdmsr_safe and wrmsr_safe) and it appears that Mach has a
rdmsr_carefully. The Mach method seems to be accessible only from the
kernel? Regardless, in osfmk/i386/trap.c line 551, that a thread can
set its own exception handler. I would like to do that, but it seems
that the thread_t that a kext uses does not have the recover member.
How should I go about trapping these exceptions in my kext? Thanks!
-Jevin Sweval
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden