From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 09 10:51:23 2021 Received: (at submit) by debbugs.gnu.org; 9 Jan 2021 15:51:23 +0000 Received: from localhost ([127.0.0.1]:52471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGWR-0000ft-3Q for submit@debbugs.gnu.org; Sat, 09 Jan 2021 10:51:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:48070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGWP-0000fm-OJ for submit@debbugs.gnu.org; Sat, 09 Jan 2021 10:51:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyGWP-0003ik-GF for guix-patches@gnu.org; Sat, 09 Jan 2021 10:51:21 -0500 Received: from tobias.gr ([2a02:c205:2020:6054::1]:60752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyGWN-0000Bg-Bn for guix-patches@gnu.org; Sat, 09 Jan 2021 10:51:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobias.gr; s=2018; bh=7KzMxwOHNnrD1LFu810QZJNwYxPkcR53iIi/W/eovLY=; h=date:in-reply-to: references:subject:cc:to:from; b=XW6N3C3RVhe3YZrvkYannRfxRxvBjOzLumtwQ kUKXaoA3sRcoIrQFSbmwQB1sSg6emaJVO0+KSgU+KziVE1sCLjsA+oIOFyw+3xFBrZRoOz KkJkpG2k1imHAppgdSS+b3udoMEJZ7girWGF0TNb1Zca6GGCKwSqLGHlYD18OOqqPlZx1w EcKb/Ntl1Kybh/QAP/7j2/Qrhu+z/ZBTFWAE4wHBoa5QEjsV+ZGxMpJ1IClJ0qrnzovz/3 tpUtoTa4wZedLxZ3d3IYXYTmPSiBXMSeUfv8XMw4AzusDLvhypJRJCv3p3aqqU35GkLC2j 6JP1Fk5svN8zS49aM1UHsXuZA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 7dcc8a3f (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO); Sat, 9 Jan 2021 15:51:48 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; From: Tobias Geerinckx-Rice To: Vincent Legoll Subject: Re: [bug#45742] [PATCH] gnu: Add x86emu. References: <20210109143038.1918-1-vincent.legoll@gmail.com> <874kjq6rgb.fsf@nckx> In-reply-to: <874kjq6rgb.fsf@nckx> Date: Sat, 09 Jan 2021 16:51:21 +0100 Message-ID: <871reu6rd2.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: 45742@debbugs.gnu.org, guix-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: base64 VG9iaWFzIEdlZXJpbmNreC1SaWNlIOWGmemBk++8mg0KPiB0aGUgYXR0YWNoZWQgcGF0Y2gNCg0K --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-x86emu.patch Content-Transfer-Encoding: quoted-printable From=206a74a2447e0e1f624903d468376542d785558986 Mon Sep 17 00:00:00 2001 From: Vincent Legoll Date: Sat, 9 Jan 2021 15:30:38 +0100 Subject: [PATCH] gnu: Add x86emu. * gnu/packages/emulators.scm (x86emu): New variable. Signed-off-by: Tobias Geerinckx-Rice =2D-- gnu/packages/emulators.scm | 62 ++++++++++++++++++++++++++++++++++++++ gnu/packages/linux.scm | 2 ++ 2 files changed, 64 insertions(+) diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 1d94090f48..785d464273 100644 =2D-- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -13,6 +13,7 @@ ;;; Copyright =C2=A9 2019 David Wilson ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka ;;; Copyright =C2=A9 2020 Christopher Howard +;;; Copyright =C2=A9 2021 Vincent Legoll ;;; ;;; This file is part of GNU Guix. ;;; @@ -2236,3 +2237,64 @@ framework based on QEMU.") "PPSSPP is a ``high-level'' emulator simulating the PSP operating system.") (license license:gpl2+))) + +(define-public x86emu + (let ((revision "0") + (commit "cbc65a99d0f7d291b7c72444b8afa71649d214c4")) + (package + (name "x86emu") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/shift-crops/x86emu") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "16q69m5zb71pgwsw5w0ilkd0vqh0hrmgq10fqba3x604chb90a87"))= )) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'set-image-file-names + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (os (string-append out "/share/x86emu"))) + (substitute* "main.cpp" + (("sample/kernel\\.img|bios/(bios|crt0)\\.bin" file) + (string-append os "/" file))) + #t))) + (delete 'configure) ; no configure script + (replace 'build + ;; Also build the =E2=80=98os=E2=80=99 target with kernel & BIO= S images. + (lambda* (#:key inputs outputs #:allow-other-keys) + (invoke "make" "all"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (os (string-append out "/share/x86emu"))) + (invoke "find") + (install-file "x86emu" bin) + (copy-recursively "include" (string-append out "/include")) + (for-each (lambda (file) + (install-file file (string-append os "/bios"))) + (find-files "bios" "\\.bin$")) + (for-each (lambda (file) + (install-file file (string-append os "/sample")= )) + (find-files "sample" "\\.img$")) + #t)))))) + (native-inputs + `(("nasm" ,nasm))) + (inputs + `(("glfw" ,glfw))) + (home-page "https://github.com/shift-crops/x86emu") + (synopsis "Simple x86 emulator") + (description + "x86emu is an emulator of the x86 architecture. It supports multiple= CPU +modes (16- and 32-bit, real/protected) and some devices. You can boot fro= m a +simulated floppy disk drive without DMA support and operate it with the mo= use +and keyboard. The package includes a light-weight BIOS and kernel image.") + (license license:expat)))) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 6c2556e91a..449258ad50 100644 =2D-- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -74,6 +74,7 @@ #:use-module (gnu packages acl) #:use-module (gnu packages admin) #:use-module (gnu packages algebra) + #:use-module (gnu packages assembly) #:use-module (gnu packages audio) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) @@ -98,6 +99,7 @@ #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) + #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages golang) #:use-module (gnu packages gperf) =2D-=20 2.30.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX/nQ+Q0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15YGABANvFCvALbxXSEvi6PmX+0q7EerENnXqXC7Gc2ghj XEGxAP9jrgV7NMVYfQRP2F82PDXs6e7eo5wGrQqt8puD0gJsDQ== =9xh/ -----END PGP SIGNATURE----- --==-=-=--