From owner-freebsd-questions@freebsd.org Tue Jan 15 12:58:36 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 4D2AF148A4ED for ; Tue, 15 Jan 2019 12:58:36 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.protonmail.ch", Issuer "QuoVadis Global SSL ICA G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA4658693A for ; Tue, 15 Jan 2019 12:58:34 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Date: Tue, 15 Jan 2019 12:58:20 +0000 To: FreeBSD Questions From: Lorenzo Salvadore Reply-To: Lorenzo Salvadore Subject: Re: if userland in asm, no need for libc? Message-ID: In-Reply-To: <201901151224.x0FCOHbM016508@sdf.org> References: <201901151224.x0FCOHbM016508@sdf.org> Feedback-ID: X6az_D2smWSR8MT5MHqXnWF0upxehDyHia7Id1cbayHNBUkRu3CIeusDsZHiivIIjmaKB1_OofpALrRUYjNz3w==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch X-Rspamd-Queue-Id: BA4658693A X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.67 / 15.00]; HAS_REPLYTO(0.00)[phascolarctos@protonmail.ch]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[mailsec.protonmail.ch,mail.protonmail.ch]; DKIM_TRACE(0.00)[protonmail.ch:+]; DMARC_POLICY_ALLOW(-0.50)[protonmail.ch,quarantine]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; RCVD_COUNT_ZERO(0.00)[0]; RCVD_IN_DNSWL_LOW(-0.10)[18.40.70.185.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:19905, ipnet:185.70.40.0/24, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[protonmail.ch.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[protonmail.ch:s=default]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-3.60)[ip: (-9.12), ipnet: 185.70.40.0/24(-4.89), asn: 19905(-3.91), country: US(-0.08)]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[] 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: Tue, 15 Jan 2019 12:58:36 -0000 > in continuum to my previous mail about libc; > if the whole of userland and various other toolkits were written > in assembly language, would there be no need for libc, that is > if "c" were not needed to be supported at all? > do assembly language programs have the capacity to make kernel > calls directly? i.e., without going through any libraries? > pardon my naive questions, i don't have a background in computer > science nor enough self-training. Yes, you can make kernel calls directly. See here for example: https://www.freebsd.org/doc/en/books/developers-handbook/x86-system-calls.h= tml Still, I discourage you from using Assembly too much: it is not easy to wri= te in Assembly, don't use it if you can do what you want to do in a higher lev= el language. You should rather use Assembly only for low level interaction wit= h hardware or to optimize code when compilers do not already optimize enough for your tastes/needs. Lorenzo Salvadore.