From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:5c01:: with SMTP id q1-v6mr98499jab.31.1531359149058; Wed, 11 Jul 2018 18:32:29 -0700 (PDT) X-Received: by 2002:aca:c6ca:: with SMTP id w193-v6mr63471oif.1.1531359148862; Wed, 11 Jul 2018 18:32:28 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder4.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g2-v6no1113458itf.0!news-out.google.com!l67-v6ni1303itl.0!nntp.google.com!d7-v6no1126790itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 11 Jul 2018 18:32:28 -0700 (PDT) In-Reply-To: <2048d6d6-04e2-4e2c-9483-e3769da59781@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.195.62; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.195.62 References: <2048d6d6-04e2-4e2c-9483-e3769da59781@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Kernel Syscall from Ada? From: "Dan'l Miller" Injection-Date: Thu, 12 Jul 2018 01:32:29 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2815 X-Received-Body-CRC: 2605668114 Xref: reader02.eternal-september.org comp.lang.ada:53772 Date: 2018-07-11T18:32:28-07:00 List-Id: On Thursday, June 23, 2016 at 3:36:21 AM UTC-5, Diogenes wrote: > Is there a simple way to make a direct (Linux)Kernel syscall from Ada wit= hout using the system C library? i.e. Make a direct call as in Assembler? >=20 > I'm asking because I've found a way to strip about 80k from a statically = linked executable by not including Interfaces.C in the runtime. >=20 > I've gotten my code to work reasonably well (no segfaults or memory error= s) using inline Assembler. But it seems like there should be an Abstract or= Generic "syscall" feature as part of the System library that we could use = for doing our own Kernel calls. Same thing for the vDSO. >=20 > Any tips? >=20 > Diogenes Well, coming at the topic top down from the momentum of ISO/IEEE standardiz= ation, for system calls in POSIX.2 (C API) there does exist an analogous PO= SIX.5 (Ada API). Whenever possible this should be utilized (and extended/m= aintained where stale). front-matter preview: https://webstore.iec.ch/preview/info_isoiec14519%7Bed2.0%7Den.pdf available for purchase in each major national standards body, such as for $= 232 in the USA: https://webstore.ansi.org/RecordDetail.aspx?sku=3DISO%2FIEC%2014519:2001&so= urce=3Dpreview Coming at the topic bottom up from Linux kernel space, the C-language syste= m calls could be augmented with a wholesale rethink of all the system calls= into Ada-speak as a new Ada-centric distribution of Linux. https://www.kernel.org/doc/html/v4.10/process/adding-syscalls.html