Hi, a question about "struct sysentvc"

Konstantin Belousov kostikbel at gmail.com
Wed Mar 16 00:25:30 UTC 2016


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.



More information about the freebsd-arch mailing list