Re: Wish to add an API function to my instance of Darwin (kernel)
Re: Wish to add an API function to my instance of Darwin (kernel)
- Subject: Re: Wish to add an API function to my instance of Darwin (kernel)
- From: "Manu ." <email@hidden>
- Date: Mon, 28 Dec 2015 08:15:31 -0800
Exactly.
You could create a new function and add it to the kernel (you need to add it to the syscall export file). But then only your machine would have that functionality since any product would clearly not change the kernel of end user machines.
Emmanuel
On Dec 28, 2015 07:35, Damien DeVille <email@hidden> wrote:
If you only wish to send a short value to the kernel, I’d suggest using a sysctl (adding a syscall is a much trickier task and probably not necessary in your situation).
It’s pretty simple to register one in a kext (but would also work in your own version of the kernel). Amit Singh’s "Mac OS X Internals” book has a very good section explaining how to do that but you can also find all you need in bsd/sys/sysctl.h.
From user space, you can use the `syscl` and `sysctlbyname` functions to set or get the value.
Thanks,
Damien
> On Dec 28, 2015, at 3:18 PM, Gordo Cath <email@hidden> wrote:
>
> Hi,
> I have my own instance of darwin kernel. I'd like to add a one way function to the kernel where from user space a user function can push a short value to kernel. I don't need to get any data back from the kernel.
>
> What steps do I need to do to accomplish this feat. I tried going through the obvious steps by mimicking the obvious of looking at the pattern of another push pattern api and the linker on the user side wasn't able to see the kernel's side api.
>
> when I re-examined the differences I discovered there are additional files
>
> there is a .def file and a task_codes file
>
> the def file appears to specify some sort of prototype
>
> the task_codes file has some sort of hex number and the api name in it.
>
> what do these two files do?
>
> Is there any sort of documentation that defines what needs to be done to add an api to the kernel?
>
> Alternatively, is there a generic way to post a message to the kernel where I can respond to it in the kernel and act accordingly?
>
> Thanks,
>
> Gordo
> _______________________________________________
> 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
_______________________________________________
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
_______________________________________________
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