From patchwork Sat Jan 9 15:51:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 26292 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 93E8627BC10; Sat, 9 Jan 2021 15:52:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 225AA27BC0F for ; Sat, 9 Jan 2021 15:52:27 +0000 (GMT) Received: from localhost ([::1]:55632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyGXS-0004SA-9n for patchwork@mira.cbaines.net; Sat, 09 Jan 2021 10:52:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyGX4-0004QE-ER for guix-patches@gnu.org; Sat, 09 Jan 2021 10:52:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyGX4-0000W5-6t for guix-patches@gnu.org; Sat, 09 Jan 2021 10:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyGX4-0000go-6I for guix-patches@gnu.org; Sat, 09 Jan 2021 10:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45742] [PATCH] gnu: Add x86emu. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Jan 2021 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45742 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vincent Legoll X-Debbugs-Original-Cc: 45742@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16102074832602 (code B ref -1); Sat, 09 Jan 2021 15:52:02 +0000 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; 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45742@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: Tobias Geerinckx-Rice X-getmail-retrieved-from-mailbox: Patches Tobias Geerinckx-Rice 写道: > the attached patch From 6a74a2447e0e1f624903d468376542d785558986 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 --- 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 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2019 David Wilson ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Christopher Howard +;;; Copyright © 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 ‘os’ target with kernel & BIOS 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 from a +simulated floppy disk drive without DMA support and operate it with the mouse +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 --- 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) -- 2.30.0