From nobody Tue May 19 14:25:13 2026 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gKcQK2lmyz6fGrW for ; Tue, 19 May 2026 14:25:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gKcQK1dW3z3pgm for ; Tue, 19 May 2026 14:25:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779200713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUKBU2OOHbB0x66WXPnjipvjwR/T++23XrXWJAr8D54=; b=u/flhoNmI9VN33S3DIZaQ/H4l8BReahQjAXVUUVcni1zitrqpylfohC9J4E0qsiNPxllvF ciOr7/UNWxu7eRKwO7lQ/CMwVT76I486BkrNqG5s6858NEboaYyMrPXhpm+ltXOGZThwCu EnvFghPL5YeN6jJZdI2XKwBwtTWZ8eUPxIvpI2/xhBNvZb5w1N4+wK/5IBiELon5e9AHVr cSHSSKvYW53cpeuFDOU3hCVDUwrncrOWPzvxmCvGAFo77pNVt+6+FJ9Dbni/ilGW88GtGe hqmtWJDNeKrs/Tb8Hm3SE3GNY/+NDQATsqOzg5EOUN6pdEffRqsLB9GC4+d2lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779200713; a=rsa-sha256; cv=none; b=S4PXAjRQVFjbpl9P2bvDhXhg3TwGqRHl05Ewx6Y/DhCg1B2elK7mWIgDWcZuGuj5w9zMlN h0Cf2V92QyHURXEkElr9xDLNhN72f27sM53CgRNUj+LUFaHzfENITNlw0xd+oK2LPMk3qW LDj/nzR9owI7IUrICBmGSXSi6hJyVMetx9xzAb9YIBzQWlQIcGkx0zZrngzr/snYjtNGVG 3znnI5kTs368XQ/SBc1LL/Jpce9DPpvobpdnKCnHvN2weHzKlquFsBHBDWOmYjuRAEp7pX Z8wgsaksO1hP3YJeSmdp914KzWnfS8T9nxmoube0HPFr22nKzgJvO2FfVGm7Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779200713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MUKBU2OOHbB0x66WXPnjipvjwR/T++23XrXWJAr8D54=; b=Hsgl9x+Y23gq1zFMWsfehw4zJ8hbqdLq2IRqzdKulYl0ZU1te0u8bhG6U1l9qP1tNB8AST ta6I5MAxQee4UO+G1NwqmohctLSsrzz4RxRYVTp2DQJbSZI+pX+52YPiCpHCxNmlL1CV1Q smu8CXdiD3r1XvVmuKxglTyxYVC8qD2UGxBBrHRCKmp6kdkCZKCVJq9/syC6HkDZOJf1rn k0MGvouy9ddIlCu4265BRUJiacvc8HNlIIv/IhM4yCDruwPz33wGyUlZVpPo6a3+mElUsy Zd154cbPuaQC3f8dA+EjXEx/BmG9E5IWLmFnDFJCfxdXq/CWIBdPTAqx2IUIbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gKcQK18Yxz3Sh for ; Tue, 19 May 2026 14:25:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e413 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 19 May 2026 14:25:13 +0000 To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Mitchell Horne Subject: git: fdab2c3455 - main - x86-assembly: generate/update .po files List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdab2c3455cbb38fecf8e506fecd71eabd1a7589 Auto-Submitted: auto-generated Date: Tue, 19 May 2026 14:25:13 +0000 Message-Id: <6a0c72c9.3e413.27097384@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/doc/commit/?id=fdab2c3455cbb38fecf8e506fecd71eabd1a7589 commit fdab2c3455cbb38fecf8e506fecd71eabd1a7589 Author: Mitchell Horne AuthorDate: 2026-05-19 14:17:02 +0000 Commit: Mitchell Horne CommitDate: 2026-05-19 14:17:02 +0000 x86-assembly: generate/update .po files Following the move of this chapter to a separate article. I ran `tools/update_translate_template.sh` and discarded the irrelevant changes. Discussed with: ziaee, carlavilla Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56430 --- .../x86 => articles/x86-assembly}/_index.po | 2405 ++++++++++---------- .../content/en/books/developers-handbook/partiv.po | 6 +- 2 files changed, 1184 insertions(+), 1227 deletions(-) diff --git a/documentation/content/en/books/developers-handbook/x86/_index.po b/documentation/content/en/articles/x86-assembly/_index.po similarity index 65% rename from documentation/content/en/books/developers-handbook/x86/_index.po rename to documentation/content/en/articles/x86-assembly/_index.po index 6adffa071b..bd310c6c2f 100644 --- a/documentation/content/en/books/developers-handbook/x86/_index.po +++ b/documentation/content/en/articles/x86-assembly/_index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" -"POT-Creation-Date: 2025-11-08 16:17+0000\n" +"POT-Creation-Date: 2026-05-19 11:05-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,159 +16,167 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. type: Title = -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:1 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:15 +#. type: YAML Front Matter: description +#: documentation/content/en/articles/x86-assembly/_index.adoc:1 #, no-wrap -msgid "x86 Assembly Language Programming" +msgid "A tutorial on writing programs for FreeBSD in x86 assembly language" msgstr "" -#. type: YAML Front Matter: title -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:1 +#. type: Title = +#: documentation/content/en/articles/x86-assembly/_index.adoc:1 +#: documentation/content/en/articles/x86-assembly/_index.adoc:11 #, no-wrap -msgid "Chapter 11. x86 Assembly Language Programming" +msgid "x86 Assembly Language Programming" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:53 -msgid "_This chapter was written by {stanislav}._" +#: documentation/content/en/articles/x86-assembly/_index.adoc:46 +msgid "" +"_This article was written by {stanislav} (2001), and adjusted by {mhorne} " +"(2026)._" +msgstr "" + +#. type: delimited block = 4 +#: documentation/content/en/articles/x86-assembly/_index.adoc:50 +msgid "The content in this article is historical." msgstr "" #. type: Title == -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:55 +#: documentation/content/en/articles/x86-assembly/_index.adoc:53 #, no-wrap msgid "Synopsis" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:59 +#: documentation/content/en/articles/x86-assembly/_index.adoc:57 msgid "" "Assembly language programming under UNIX(R) is highly undocumented. It is " -"generally assumed that no one would ever want to use it because various " -"UNIX(R) systems run on different microprocessors, so everything should be " -"written in C for portability." +"generally assumed that no one would ever want to use it because various UNIX " +"systems run on different microprocessors, so everything should be written in " +"C for portability." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:63 +#: documentation/content/en/articles/x86-assembly/_index.adoc:61 msgid "" "In reality, C portability is quite a myth. Even C programs need to be " -"modified when ported from one UNIX(R) to another, regardless of what " -"processor each runs on. Typically, such a program is full of conditional " -"statements depending on the system it is compiled for." +"modified when ported from one UNIX to another, regardless of what processor " +"each runs on. Typically, such a program is full of conditional statements " +"depending on the system it is compiled for." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:65 +#: documentation/content/en/articles/x86-assembly/_index.adoc:63 msgid "" -"Even if we believe that all of UNIX(R) software should be written in C, or " -"some other high-level language, we still need assembly language programmers: " -"Who else would write the section of C library that accesses the kernel?" +"Even if we believe that all of UNIX software should be written in C, or some " +"other high-level language, we still need assembly language programmers: Who " +"else would write the section of C library that accesses the kernel?" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:67 +#: documentation/content/en/articles/x86-assembly/_index.adoc:65 msgid "" -"In this chapter I will attempt to show you how you can use assembly language " -"writing UNIX(R) programs, specifically under FreeBSD." +"In this article I will attempt to show you how you can use assembly language " +"writing UNIX programs, specifically under FreeBSD." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:72 +#: documentation/content/en/articles/x86-assembly/_index.adoc:70 msgid "" -"This chapter does not explain the basics of assembly language. There are " +"This article does not explain the basics of assembly language. There are " "enough resources about that (for a complete online course in assembly " "language, see Randall Hyde's http://webster.cs.ucr.edu/[Art of Assembly " "Language]; or if you prefer a printed book, take a look at Jeff Duntemann's " "Assembly Language Step-by-Step (ISBN: 0471375233). However, once the " -"chapter is finished, any assembly language programmer will be able to write " +"article is finished, any assembly language programmer will be able to write " "programs for FreeBSD quickly and efficiently." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:74 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:4311 +#: documentation/content/en/articles/x86-assembly/_index.adoc:72 +#: documentation/content/en/articles/x86-assembly/_index.adoc:4287 msgid "Copyright (R) 2000-2001 G. Adam Stanislav. All rights reserved." msgstr "" #. type: Title == -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:76 +#: documentation/content/en/articles/x86-assembly/_index.adoc:74 #, no-wrap msgid "The Tools" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:79 +#: documentation/content/en/articles/x86-assembly/_index.adoc:77 #, no-wrap msgid "The Assembler" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:82 +#: documentation/content/en/articles/x86-assembly/_index.adoc:81 msgid "" "The most important tool for assembly language programming is the assembler, " -"the software that converts assembly language code into machine language." +"the software that converts assembly language code into machine language. " +"Two very different types of assemblers are available for FreeBSD." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:85 +#: documentation/content/en/articles/x86-assembly/_index.adoc:84 msgid "" -"Three very different assemblers are available for FreeBSD. Both man:llvm-" -"as[1] (included in package:devel/llvm[]) and man:as[1] (included in " -"package:devel/binutils[]) use the traditional UNIX(R) assembly language " -"syntax." +"The first is the GNU man:as[1] (package:devel/binutils[]), which uses the " +"traditional UNIX assembly language syntax. Alternatively, one can use " +"man:clang[1], which is a compatible replacement for the GNU assembler and " +"comes with the system." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:88 +#: documentation/content/en/articles/x86-assembly/_index.adoc:87 msgid "" -"On the other hand, man:nasm[1] (installed through package:devel/nasm[]) uses " -"the Intel syntax. Its main advantage is that it can assemble code for many " +"The other is man:nasm[1] (package:devel/nasm[]). This assembler uses the " +"Intel syntax, and its main advantage is that it can assemble code for many " "operating systems." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:91 +#: documentation/content/en/articles/x86-assembly/_index.adoc:90 msgid "" -"This chapter uses nasm syntax because most assembly language programmers " +"This article uses nasm syntax because most assembly language programmers " "coming to FreeBSD from other operating systems will find it easier to " "understand. And, because, quite frankly, that is what I am used to." msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:93 +#: documentation/content/en/articles/x86-assembly/_index.adoc:92 #, no-wrap msgid "The Linker" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:96 +#: documentation/content/en/articles/x86-assembly/_index.adoc:95 msgid "" "The output of the assembler, like that of any compiler, needs to be linked " "to form an executable file." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:99 +#: documentation/content/en/articles/x86-assembly/_index.adoc:98 msgid "" "The standard man:ld[1] linker comes with FreeBSD. It works with the code " "assembled with either assembler." msgstr "" #. type: Title == -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:101 +#: documentation/content/en/articles/x86-assembly/_index.adoc:100 #, no-wrap msgid "System Calls" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:104 +#: documentation/content/en/articles/x86-assembly/_index.adoc:103 #, no-wrap msgid "Default Calling Convention" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:108 +#: documentation/content/en/articles/x86-assembly/_index.adoc:107 msgid "" "By default, the FreeBSD kernel uses the C calling convention. Further, " "although the kernel is accessed using `int 80h`, it is assumed the program " @@ -177,22 +185,22 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:111 +#: documentation/content/en/articles/x86-assembly/_index.adoc:110 msgid "" "This convention is very convenient, and quite superior to the Microsoft(R) " -"convention used by MS-DOS(R). Why? Because the UNIX(R) convention allows " -"any program written in any language to access the kernel." +"convention used by MS-DOS(R). Why? Because the UNIX convention allows any " +"program written in any language to access the kernel." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:114 +#: documentation/content/en/articles/x86-assembly/_index.adoc:113 msgid "" "An assembly language program can do that as well. For example, we could " "open a file:" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:120 +#: documentation/content/en/articles/x86-assembly/_index.adoc:119 #, no-wrap msgid "" "kernel:\n" @@ -201,7 +209,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:129 +#: documentation/content/en/articles/x86-assembly/_index.adoc:128 #, no-wrap msgid "" "open:\n" @@ -215,15 +223,15 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:133 +#: documentation/content/en/articles/x86-assembly/_index.adoc:132 msgid "" "This is a very clean and portable way of coding. If you need to port the " -"code to a UNIX(R) system which uses a different interrupt, or a different " -"way of passing parameters, all you need to change is the kernel procedure." +"code to a UNIX system which uses a different interrupt, or a different way " +"of passing parameters, all you need to change is the kernel procedure." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:137 +#: documentation/content/en/articles/x86-assembly/_index.adoc:136 msgid "" "But assembly language programmers like to shave off cycles. The above " "example requires a `call/ret` combination. We can eliminate it by " @@ -231,7 +239,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:148 +#: documentation/content/en/articles/x86-assembly/_index.adoc:147 #, no-wrap msgid "" "open:\n" @@ -245,38 +253,37 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:151 +#: documentation/content/en/articles/x86-assembly/_index.adoc:150 msgid "" "The `5` that we have placed in `EAX` identifies the kernel function, in this " "case `open`." msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:153 +#: documentation/content/en/articles/x86-assembly/_index.adoc:152 #, no-wrap msgid "Alternate Calling Convention" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:158 +#: documentation/content/en/articles/x86-assembly/_index.adoc:157 msgid "" "FreeBSD is an extremely flexible system. It offers other ways of calling " -"the kernel. For it to work, however, the system must have Linux emulation " -"installed." +"the kernel. For it to work, however, the system must have Linux(R) " +"emulation installed." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:163 +#: documentation/content/en/articles/x86-assembly/_index.adoc:162 msgid "" -"Linux is a UNIX(R) like system. However, its kernel uses the same system-" -"call convention of passing parameters in registers MS-DOS(R) does. As with " -"the UNIX(R) convention, the function number is placed in `EAX`. The " -"parameters, however, are not passed on the stack but in `EBX, ECX, EDX, ESI, " -"EDI, EBP`:" +"Linux is a UNIX-like system. However, its kernel uses the same system-call " +"convention of passing parameters in registers MS-DOS does. As with the UNIX " +"convention, the function number is placed in `EAX`. The parameters, " +"however, are not passed on the stack but in `EBX, ECX, EDX, ESI, EDI, EBP`:" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:172 +#: documentation/content/en/articles/x86-assembly/_index.adoc:171 #, no-wrap msgid "" "open:\n" @@ -288,7 +295,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:178 +#: documentation/content/en/articles/x86-assembly/_index.adoc:177 msgid "" "This convention has a great disadvantage over the UNIX(R) way, at least as " "far as assembly language programming is concerned: Every time you make a " @@ -298,7 +305,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:181 +#: documentation/content/en/articles/x86-assembly/_index.adoc:180 msgid "" "If you do choose the Linux convention, you must let the system know about " "it. After your program is assembled and linked, you need to brand the " @@ -306,28 +313,28 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:185 +#: documentation/content/en/articles/x86-assembly/_index.adoc:184 #, no-wrap msgid "% brandelf -t Linux filename\n" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:188 +#: documentation/content/en/articles/x86-assembly/_index.adoc:187 #, no-wrap msgid "Which Convention Should You Use?" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:193 +#: documentation/content/en/articles/x86-assembly/_index.adoc:192 msgid "" -"If you are coding specifically for FreeBSD, you should always use the " -"UNIX(R) convention: It is faster, you can store global variables in " -"registers, you do not have to brand the executable, and you do not impose " -"the installation of the Linux emulation package on the target system." +"If you are coding specifically for FreeBSD, you should always use the UNIX " +"convention: It is faster, you can store global variables in registers, you " +"do not have to brand the executable, and you do not impose the installation " +"of the Linux emulation package on the target system." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:196 +#: documentation/content/en/articles/x86-assembly/_index.adoc:195 msgid "" "If you want to create portable code that can also run on Linux, you will " "probably still want to give the FreeBSD users as efficient a code as " @@ -336,26 +343,26 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:198 +#: documentation/content/en/articles/x86-assembly/_index.adoc:197 #, no-wrap msgid "Call Numbers" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:202 +#: documentation/content/en/articles/x86-assembly/_index.adoc:201 msgid "" "To tell the kernel which system service you are calling, place its number in " "`EAX`. Of course, you need to know what the number is." msgstr "" #. type: Title ==== -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:204 +#: documentation/content/en/articles/x86-assembly/_index.adoc:203 #, no-wrap msgid "The [.filename]#syscalls# File" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:208 +#: documentation/content/en/articles/x86-assembly/_index.adoc:207 msgid "" "The numbers are listed in [.filename]#syscalls#. `locate syscalls` finds " "this file in several different formats, all produced automatically from " @@ -363,28 +370,28 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:211 +#: documentation/content/en/articles/x86-assembly/_index.adoc:210 msgid "" -"You can find the master file for the default UNIX(R) calling convention in " +"You can find the master file for the default UNIX calling convention in " "[.filename]#/usr/src/sys/kern/syscalls.master#. If you need to use the " "other convention implemented in the Linux emulation mode, read [.filename]#/" "usr/src/sys/i386/linux/syscalls.master#." msgstr "" #. type: delimited block = 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:215 +#: documentation/content/en/articles/x86-assembly/_index.adoc:214 msgid "" "Not only do FreeBSD and Linux use different calling conventions, they " "sometimes use different numbers for the same functions." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:218 +#: documentation/content/en/articles/x86-assembly/_index.adoc:217 msgid "[.filename]#syscalls.master# describes how the call is to be made:" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:229 +#: documentation/content/en/articles/x86-assembly/_index.adoc:228 #, no-wrap msgid "" "0\tSTD\tNOHIDE\t{ int nosys(void); } syscall nosys_args int\n" @@ -398,32 +405,32 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:232 +#: documentation/content/en/articles/x86-assembly/_index.adoc:231 msgid "It is the leftmost column that tells us the number to place in `EAX`." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:235 +#: documentation/content/en/articles/x86-assembly/_index.adoc:234 msgid "" "The rightmost column tells us what parameters to `push`. They are " "``push``ed _from right to left_." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:237 +#: documentation/content/en/articles/x86-assembly/_index.adoc:236 msgid "" "For example, to `open` a file, we need to `push` the `mode` first, then " "`flags`, then the address at which the `path` is stored." msgstr "" #. type: Title == -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:239 +#: documentation/content/en/articles/x86-assembly/_index.adoc:238 #, no-wrap msgid "Return Values" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:243 +#: documentation/content/en/articles/x86-assembly/_index.adoc:242 msgid "" "A system call would not be useful most of the time if it did not return some " "kind of a value: The file descriptor of an open file, the number of bytes " @@ -431,7 +438,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:246 +#: documentation/content/en/articles/x86-assembly/_index.adoc:245 msgid "" "Additionally, the system needs to inform us if an error occurs: A file does " "not exist, system resources are exhausted, we passed an invalid parameter, " @@ -439,26 +446,26 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:248 +#: documentation/content/en/articles/x86-assembly/_index.adoc:247 #, no-wrap msgid "Man Pages" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:252 +#: documentation/content/en/articles/x86-assembly/_index.adoc:251 msgid "" "The traditional place to look for information about various system calls " -"under UNIX(R) systems are the manual pages. FreeBSD describes its system " -"calls in section 2, sometimes in section 3." +"under UNIX systems are the manual pages. FreeBSD describes its system calls " +"in section 2, sometimes in section 3." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:254 +#: documentation/content/en/articles/x86-assembly/_index.adoc:253 msgid "For example, man:open[2] says:" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:258 +#: documentation/content/en/articles/x86-assembly/_index.adoc:257 msgid "" "If successful, `open()` returns a non-negative integer, termed a file " "descriptor. It returns `-1` on failure, and sets `errno` to indicate the " @@ -466,27 +473,27 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:260 +#: documentation/content/en/articles/x86-assembly/_index.adoc:259 msgid "" -"The assembly language programmer new to UNIX(R) and FreeBSD will immediately " +"The assembly language programmer new to UNIX and FreeBSD will immediately " "ask the puzzling question: Where is `errno` and how do I get to it?" msgstr "" #. type: delimited block = 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:265 +#: documentation/content/en/articles/x86-assembly/_index.adoc:264 msgid "" "The information presented in the manual pages applies to C programs. The " "assembly language programmer needs additional information." msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:268 +#: documentation/content/en/articles/x86-assembly/_index.adoc:267 #, no-wrap msgid "Where Are the Return Values?" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:273 +#: documentation/content/en/articles/x86-assembly/_index.adoc:272 msgid "" "Unfortunately, it depends... For most system calls it is in `EAX`, but not " "for all. A good rule of thumb, when working with a system call for the " @@ -495,7 +502,7 @@ msgid "" msgstr "" #. type: delimited block = 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:279 +#: documentation/content/en/articles/x86-assembly/_index.adoc:278 msgid "" "I am aware of one system call that returns the value in `EDX`: `SYS_fork`. " "All others I have worked with use `EAX`. But I have not worked with them " @@ -503,33 +510,33 @@ msgid "" msgstr "" #. type: delimited block = 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:284 +#: documentation/content/en/articles/x86-assembly/_index.adoc:283 msgid "" "If you cannot find the answer here or anywhere else, study libc source code " "and see how it interfaces with the kernel." msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:287 +#: documentation/content/en/articles/x86-assembly/_index.adoc:286 #, no-wrap msgid "Where Is `errno`?" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:290 +#: documentation/content/en/articles/x86-assembly/_index.adoc:289 msgid "Actually, nowhere..." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:293 +#: documentation/content/en/articles/x86-assembly/_index.adoc:292 msgid "" -"`errno` is part of the C language, not the UNIX(R) kernel. When accessing " +"`errno` is part of the C language, not the UNIX kernel. When accessing " "kernel services directly, the error code is returned in `EAX`, the same " "register the proper return value generally ends up in." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:297 +#: documentation/content/en/articles/x86-assembly/_index.adoc:296 msgid "" "This makes perfect sense. If there is no error, there is no error code. If " "there is an error, there is no return value. One register can contain " @@ -537,20 +544,20 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:299 +#: documentation/content/en/articles/x86-assembly/_index.adoc:298 #, no-wrap msgid "Determining an Error Occurred" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:302 +#: documentation/content/en/articles/x86-assembly/_index.adoc:301 msgid "" "When using the standard FreeBSD calling convention, the `carry flag` is " "cleared upon success, set upon failure." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:305 +#: documentation/content/en/articles/x86-assembly/_index.adoc:304 msgid "" "When using the Linux emulation mode, the signed value in `EAX` is non-" "negative upon success, and contains the return value. In case of an error, " @@ -558,13 +565,13 @@ msgid "" msgstr "" #. type: Title == -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:307 +#: documentation/content/en/articles/x86-assembly/_index.adoc:306 #, no-wrap msgid "Creating Portable Code" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:312 +#: documentation/content/en/articles/x86-assembly/_index.adoc:311 msgid "" "Portability is generally not one of the strengths of assembly language. " "Yet, writing assembly language programs for different platforms is possible, " @@ -573,29 +580,29 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:314 +#: documentation/content/en/articles/x86-assembly/_index.adoc:313 msgid "" "It is all the more possible when you want your code to run on two platforms " "which, while different, are based on similar architectures." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:318 +#: documentation/content/en/articles/x86-assembly/_index.adoc:317 msgid "" -"For example, FreeBSD is UNIX(R), Linux is UNIX(R) like. I only mentioned " -"three differences between them (from an assembly language programmer's " +"For example, FreeBSD is UNIX, Linux is UNIX-like. I only mentioned three " +"differences between them (from an assembly language programmer's " "perspective): The calling convention, the function numbers, and the way of " "returning values." msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:320 +#: documentation/content/en/articles/x86-assembly/_index.adoc:319 #, no-wrap msgid "Dealing with Function Numbers" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:325 +#: documentation/content/en/articles/x86-assembly/_index.adoc:324 msgid "" "In many cases the function numbers are the same. However, even when they " "are not, the problem is easy to deal with: Instead of using numbers in your " @@ -604,7 +611,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:333 +#: documentation/content/en/articles/x86-assembly/_index.adoc:332 #, no-wrap msgid "" "%ifdef\tLINUX\n" @@ -615,26 +622,26 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:336 +#: documentation/content/en/articles/x86-assembly/_index.adoc:335 #, no-wrap msgid "Dealing with Conventions" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:339 +#: documentation/content/en/articles/x86-assembly/_index.adoc:338 msgid "" "Both, the calling convention, and the return value (the `errno` problem) can " "be resolved with macros:" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:343 +#: documentation/content/en/articles/x86-assembly/_index.adoc:342 #, no-wrap msgid "%ifdef\tLINUX\n" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:347 +#: documentation/content/en/articles/x86-assembly/_index.adoc:346 #, no-wrap msgid "" "%macro\tsystem\t0\n" @@ -643,7 +650,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:356 +#: documentation/content/en/articles/x86-assembly/_index.adoc:355 #, no-wrap msgid "" "align 4\n" @@ -657,7 +664,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:363 +#: documentation/content/en/articles/x86-assembly/_index.adoc:362 #, no-wrap msgid "" "\tmov\tebx, [esp+32]\n" @@ -669,7 +676,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:370 +#: documentation/content/en/articles/x86-assembly/_index.adoc:369 #, no-wrap msgid "" "\tpop\tebp\n" @@ -681,7 +688,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:375 +#: documentation/content/en/articles/x86-assembly/_index.adoc:374 #, no-wrap msgid "" "\tor\teax, eax\n" @@ -691,7 +698,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:380 +#: documentation/content/en/articles/x86-assembly/_index.adoc:379 #, no-wrap msgid "" ".errno:\n" @@ -701,13 +708,13 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:382 +#: documentation/content/en/articles/x86-assembly/_index.adoc:381 #, no-wrap msgid "%else\n" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:386 +#: documentation/content/en/articles/x86-assembly/_index.adoc:385 #, no-wrap msgid "" "%macro\tsystem\t0\n" @@ -716,19 +723,19 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:388 +#: documentation/content/en/articles/x86-assembly/_index.adoc:387 #, no-wrap msgid "%endif\n" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:391 +#: documentation/content/en/articles/x86-assembly/_index.adoc:390 #, no-wrap msgid "Dealing with Other Portability Issues" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:395 +#: documentation/content/en/articles/x86-assembly/_index.adoc:394 msgid "" "The above solutions can handle most cases of writing code portable between " "FreeBSD and Linux. Nevertheless, with some kernel services the differences " @@ -736,7 +743,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:398 +#: documentation/content/en/articles/x86-assembly/_index.adoc:397 msgid "" "In that case, you need to write two different handlers for those particular " "system calls, and use conditional assembly. Luckily, most of your code does " @@ -745,13 +752,13 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:400 +#: documentation/content/en/articles/x86-assembly/_index.adoc:399 #, no-wrap msgid "Using a Library" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:404 +#: documentation/content/en/articles/x86-assembly/_index.adoc:403 msgid "" "You can avoid portability issues in your main code altogether by writing a " "library of system calls. Create a separate library for FreeBSD, a different " @@ -759,7 +766,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:409 +#: documentation/content/en/articles/x86-assembly/_index.adoc:408 msgid "" "In your library, write a separate function (or procedure, if you prefer the " "traditional assembly language terminology) for each system call. Use the C " @@ -769,7 +776,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:417 +#: documentation/content/en/articles/x86-assembly/_index.adoc:416 #, no-wrap msgid "" "sys.open:\n" @@ -780,14 +787,14 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:421 +#: documentation/content/en/articles/x86-assembly/_index.adoc:420 msgid "" "Your Linux library will require more different functions. But even here you " "can group system calls using the same number of parameters:" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:432 +#: documentation/content/en/articles/x86-assembly/_index.adoc:431 #, no-wrap msgid "" "sys.exit:\n" @@ -801,13 +808,13 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:434 +#: documentation/content/en/articles/x86-assembly/_index.adoc:433 #, no-wrap msgid "...\n" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:440 +#: documentation/content/en/articles/x86-assembly/_index.adoc:439 #, no-wrap msgid "" "sys.return:\n" @@ -818,7 +825,7 @@ msgid "" msgstr "" #. type: delimited block . 4 -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:445 +#: documentation/content/en/articles/x86-assembly/_index.adoc:444 #, no-wrap msgid "" "sys.err:\n" @@ -828,7 +835,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:452 +#: documentation/content/en/articles/x86-assembly/_index.adoc:451 msgid "" "The library approach may seem inconvenient at first because it requires you " "to produce a separate file your code depends on. But it has many " @@ -841,7 +848,7 @@ msgid "" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:454 +#: documentation/content/en/articles/x86-assembly/_index.adoc:453 msgid "" "If you do not like the idea of having a library, you can at least place all " "your system calls in a separate assembly language file and link it with your " @@ -850,20 +857,20 @@ msgid "" msgstr "" #. type: Title === -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:456 +#: documentation/content/en/articles/x86-assembly/_index.adoc:455 #, no-wrap msgid "Using an Include File" msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:459 +#: documentation/content/en/articles/x86-assembly/_index.adoc:458 msgid "" "If you are releasing your software as (or with) source code, you can use " "macros and place them in a separate file, which you include in your code." msgstr "" #. type: Plain text -#: documentation/content/en/books/developers-handbook/x86/_index.adoc:462 +#: documentation/content/en/articles/x86-assembly/_index.adoc:461 msgid "" "Porters of your software will simply write a new include file. No library " "or external object file is necessary, yet your code is portable without any " @@ -871,22 +878,22 @@ msgid "" msgstr "" *** 7210 LINES SKIPPED ***