Exception trapping from a kernel extension
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=uM1k/SIL4HKfFJS+CAymMFroWfC3krYdnA3KgUBxcUy8KQlpm60Gr1akoRUOK/h134SW07Xka3asBymI++NnUy2ntOxcMLhGhF+RLpeulJF4OImI7n+7pQ/Ft8Ckox/Y8DLyXix8oG84j0kcxwFsndae6Vd1pOQ04oO8++kVULU= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=e+q3nJ/iho7WPS7/hPhCkdzeqJeByb52SD5c1MfWxyPMrgZuJFFu9n8A+vvNUtYIc3v8rE7LFpWfYSsVlMqbJN2WI0hkaTTs3cftWuOl2RCfSmsxsROllaQS/zWeo8fKhycYxqvNKYvDtbp2pKr7Eub1ZnP96o4ToTvZmnTAFdg= 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jevin Sweval