From owner-freebsd-questions@freebsd.org Wed Jun 19 21:03:51 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7272F15CA3B5 for ; Wed, 19 Jun 2019 21:03:51 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E92583058 for ; Wed, 19 Jun 2019 21:03:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.8.39.224]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1Mj8a5-1iIYeP0oJp-00f821; Wed, 19 Jun 2019 22:58:28 +0200 Date: Wed, 19 Jun 2019 22:58:28 +0200 From: Polytropon To: Alexandru Goia Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD kernel system call Message-Id: <20190619225828.e5a78fdf.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:0ufVRlYKRscZx3NXSQ4JH8ieiivs7zIGopo80rQKd2Chx9PwY7z Lc/tsLMgTIhFv6+YLXCz6ZM5A1fXAlLocLec0I21cmBBXAmtQd6yQt1oTZVPMVB1p6t1HpL 73JAPeKBxoZcPpzmJRlDGgf6CmlpOOc2c9+F9remD8Nu6HnGQO70Cfx/T1DVTivPBtOkDke S23x4FdK3xH9dz7DbbTIQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gjby7R3wwXw=:NX9Wjeo3KY9PX2VPi5xtpf VGJzQNyDTbyVKDO1iQIckAPIgBgS45367cXWNeeNufFTjZu1SjgEu8QKiFGXcZA6QKsuUxpd7 71VSWp+GtcqsyqFAxOFLVLIO9O2I/mmK65u4yAZSeEUVe/f6pZXalNuURC5SfRGa6XHuhcS7X 7qZ5I5J9ktSxPG+GiTBps3ZCCGQ/rKP3ziu2A646Nkq+2yrlifwfjaNIBa+r7ca0dyjZNa8NH Tu9o3n1Iks6TVf/UcqbTDmKK0TD7liA82DP5KwEGwTa7YfJcFg+AE9eef/VrP6YeqXKyjp8vs J/O5cBnrk1Qq1XWlmEfsPw6hmlfx696HS5IC8EaNik1Vpj1Hd1h0epoYwuVEjDtp65R7hDelu o1UWYec9EYkekIrw1b+VDJR4sXxbIpuB5K8kfw2yFcphoJWtAQmkND+WuEytengN5iWBsXy7r CPONicQUvHb+BdVdaGhMheVaoQ1Ue8CJIXD8Wo0p4Y17bWbvUgaFKWj74m9rMBGXSQUh3QNEa S7pYvRUaoezraI5GzZglVL+rOg2PprOMcXchPBA1U7kMvgjV/1rvP2K3ZdU8vSFUY7rxl8YHk VU5acOPBEWHSA5GD7rsf3N+3Nuvp4wnXeT/1cubba/qF28h51b318piTwzgeCXeQugpt5+hF3 So6LVQJs6Q+OBkGfJaUuZ+eF6rhqxr6mLiju9yJpIsGvt+V0gHq/95ScG8ox9UK1D3hqiS4u0 keieNSOgyQXaq2E+tLM3c7sd+U/FuEpeMGEjvzuvCDcVrTwOWuR88DmAkeE= X-Rspamd-Queue-Id: 1E92583058 X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [6.08 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.01)[mx01.schlund.de,mx00.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[224.39.8.178.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.96)[0.961,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.90)[0.904,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[133.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.83)[ip: (3.06), ipnet: 212.227.0.0/16(-1.42), asn: 8560(2.50), country: DE(-0.01)] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 21:03:51 -0000 On Wed, 19 Jun 2019 16:12:51 +0300, Alexandru Goia wrote: > I am trying to write the code to a Unix system call, on the > FreeBSD 12.0 system. I managed to do that on Linux : > > http://romania-acknowledges-stars.blogspot.com/2018/10/angel-call-in-kernel.html > > but I find hard, without proper documentation, to implement it > on FreeBSD. There is documentation available: https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86-system-calls.html https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86-first-program.html Maybe this is a better entry point: https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html > I am in trouble understanding the presence of SYSCALL_MODULE(9), and > its meaning and usage. Does the command "man 9 SYSCALL_MODULE" provide any help? From the description: The SYSCALL_MODULE() macro declares a new syscall. SYSCALL_MODULE() expands into a kernel module declaration named as name. If you have obtained the FreeBSD sources, also have a look at the file /usr/share/examples/kld/syscall/module/syscall.c where you can find an illustration of how a kernel module can be created to provide an additional system call. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...