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: Gordo Cath <email@hidden>
- Date: Mon, 28 Dec 2015 11:26:47 -0500
Thanks for your help. Having never heard of the syscall export file... I'll probably back out my changes and move to the sysctl and sysctlbyname. the thing i'm wanting to do is for my own use and wasn't intended to get released to anyone else as it was just an experiment. however the sysctl stuff does look interesting. I'll take a look and see where it leads.
Gordo
> -------Original Message-------
> From: Manu . <email@hidden>
> To: Damien DeVille <email@hidden>
> Cc: Gordo Cath <email@hidden>, email@hidden
> Subject: Re: Wish to add an API function to my instance of Darwin (kernel)
> Sent: Dec 28 '15 11:15
>
> 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