Re: Register a task's exception port from a kext
Re: Register a task's exception port from a kext
- Subject: Re: Register a task's exception port from a kext
- From: "nicolas vide" <email@hidden>
- Date: Tue, 14 Oct 2008 12:12:04 +1100
On Sat, Oct 4, 2008 at 2:52 AM, Quinn <email@hidden> wrote:
> If you don't care about creating a real product, you have more options.
> Specifically, if you link against the entire kernel you should have access
> to task_set_special_port, which is a necessary first step. You will also
> need to use MIG (in kernel mode!) to generate a demux routine. Make sure
> you don't export your catch_xxx routines, lest they collide with the kernel
> routines of the same name.
Hello guys,
I am definitely stuck with this.
Basically, I just tried to set the exception port of a specific task
with a fresh new created port (inside my kext).
Here is my code:
kern_return_t ret = KERN_SUCCESS;
ret = ipc_port_alloc(get_task_ipcspace(current_task()),
&exception_port_name, &exception_port);
IOLog("ipc_port_alloc() ret=%d", ret);
if (ret) return kIOReturnError;
ret = task_set_exception_ports(target, EXC_MASK_ALL,
ipc_port_make_send(exception_port), EXCEPTION_DEFAULT,
THREAD_STATE_NONE);
IOLog("task_set_exception_ports() ret=%d", ret);
if (ret) return kIOReturnError;
/* create exception handler thread
*/
(void) kernel_thread(kernel_task, exception_handler);
Unfortunately, this code freeze inside the task_set_exception_ports call.
I have no idea on what's going on...
Thank you in advance for your help,
Nicolas
_______________________________________________
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