Hi, a question about "struct sysentvc"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hi, a question about "struct sysentvc"

mokhi
Hi guys.
I was reading/studying code of Elf image activator to see how binary
stars on FreeBSD.
On included file (sysent.h), I saw 3 declarations:
extern struct sysentvec aout_sysvec;
extern struct sysentvec elf_freebsd_sysvec;
extern struct sysentvec null_sysvec;

I looked at their definitions too (though i couldn't find
elf_freebsd_sysvec, where's it ?).
I have some (maybe simple, so sorry for it :D) questions.

1) what's sysentvec for, basically ? and in which concept it connects
to image-activators (such as ELF image activator [or a.out's])

2) is there any reference/guide to see how should/can we define a
"struct sysentvec" for new format ?

FWIW, I'm also a little familiar with NetBSD way of binary
running/compat layer devel.

Thanks and thousands of regards, Mokhi.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Hi, a question about "struct sysentvc"

Konstantin Belousov
On Wed, Mar 16, 2016 at 01:16:56AM +0330, mokhi wrote:

> Hi guys.
> I was reading/studying code of Elf image activator to see how binary
> stars on FreeBSD.
> On included file (sysent.h), I saw 3 declarations:
> extern struct sysentvec aout_sysvec;
> extern struct sysentvec elf_freebsd_sysvec;
> extern struct sysentvec null_sysvec;
>
> I looked at their definitions too (though i couldn't find
> elf_freebsd_sysvec, where's it ?).
It is in sys/<arch>/<arch>/elf_machdep.c.  Grep would find it to you.

> I have some (maybe simple, so sorry for it :D) questions.
>
> 1) what's sysentvec for, basically ? and in which concept it connects
> to image-activators (such as ELF image activator [or a.out's])
The structure describes an ABI to kernel.  Consider it the object
in C++ sense which provides implementations of the ABI-specific
operations from the kernel side.  Image activator sets curproc->p_sysent
for the process at exec(2) time according to the information specified
in the binary, which effectively determines the kernel-side of the ABI
for the process.

>
> 2) is there any reference/guide to see how should/can we define a
> "struct sysentvec" for new format ?
There is no guide, read the code.

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Hi, a question about "struct sysentvc"

mokhi
Thanks for your answer :D

On 3/16/16, Konstantin Belousov <[hidden email]> wrote:
> There is no guide, read the code.

Elf code is better in help ? or aout ?

Regards, Mokhi.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Hi, a question about "struct sysentvc"

Konstantin Belousov
On Wed, Mar 16, 2016 at 03:48:13PM +0330, mokhi wrote:
> Thanks for your answer :D
>
> On 3/16/16, Konstantin Belousov <[hidden email]> wrote:
> > There is no guide, read the code.
>
> Elf code is better in help ? or aout ?

You need to read all the involved code to understand the interface.
You could start with a.out part since it is easier, but the point is
that you must read the callers code to see what for are the sysent
methods.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"