From owner-freebsd-arch@freebsd.org Wed Mar 16 00:25:30 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5620AD15A4; Wed, 16 Mar 2016 00:25:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5846416F; Wed, 16 Mar 2016 00:25:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2G0POi3051278 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 16 Mar 2016 02:25:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2G0POi3051278 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2G0POq4051274; Wed, 16 Mar 2016 02:25:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Mar 2016 02:25:24 +0200 From: Konstantin Belousov To: mokhi Cc: freebsd-arch@freebsd.org, freebsd-emulation@freebsd.org Subject: Re: Hi, a question about "struct sysentvc" Message-ID: <20160316002524.GA1741@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 00:25:30 -0000 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///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.