Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2016 02:25:24 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        mokhi <mokhi64@gmail.com>
Cc:        freebsd-arch@freebsd.org, freebsd-emulation@freebsd.org
Subject:   Re: Hi, a question about "struct sysentvc"
Message-ID:  <20160316002524.GA1741@kib.kiev.ua>
In-Reply-To: <CAByVWPUY0TzYUdjXfWkkUAjYCPCC5irEkHj-ixhVUQsx7T-mrg@mail.gmail.com>
References:  <CAByVWPUY0TzYUdjXfWkkUAjYCPCC5irEkHj-ixhVUQsx7T-mrg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160316002524.GA1741>