site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Jul 19, 2007, at 10:00 PM, Jevin Sweval wrote: 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! = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... You don't. MSRs are owned by the kernel and should not be touched by extensions. Kexts are not and cannot be sufficiently well informed about the state of the system to be trusted to generate most exceptions (certain pagefault and other exceptions may be generated in an invisible fashion as part of supporting the execution model). This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Smith