From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2DfgKLPQ+V9cFAAA0tVLHw (envelope-from ) for ; Sat, 09 Jan 2021 15:50:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cGjQJLPQ+V9hTQAAB5/wlQ (envelope-from ) for ; Sat, 09 Jan 2021 15:50:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 67CC79403A9 for ; Sat, 9 Jan 2021 15:50:11 +0000 (UTC) Received: from localhost ([::1]:53400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyGVG-0003MI-Do for larch@yhetil.org; Sat, 09 Jan 2021 10:50:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyGV8-0003Lf-Dv for guix-patches@gnu.org; Sat, 09 Jan 2021 10:50:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyGV8-0008Ch-6r for guix-patches@gnu.org; Sat, 09 Jan 2021 10:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyGV8-0000dU-5d for guix-patches@gnu.org; Sat, 09 Jan 2021 10:50: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:50: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 45742-submit@debbugs.gnu.org id=B45742.16102073682378 (code B ref 45742); Sat, 09 Jan 2021 15:50:02 +0000 Received: (at 45742) by debbugs.gnu.org; 9 Jan 2021 15:49:28 +0000 Received: from localhost ([127.0.0.1]:52460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGUa-0000cG-3L for submit@debbugs.gnu.org; Sat, 09 Jan 2021 10:49:28 -0500 Received: from tobias.gr ([80.241.217.52]:50696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyGUW-0000c1-FR for 45742@debbugs.gnu.org; Sat, 09 Jan 2021 10:49:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobias.gr; s=2018; bh=7r7f+LDzlKWvBtjXGjW1AjiHEZ/cqVYKdKx37qMFbiE=; h=date:in-reply-to: references:subject:cc:to:from; b=HsiXArgTyRjnKx9fT4WH/mYYHfTirVfzkAplu agBN/2LuIwdx+tZ91CU+a4oSVzHV52bjBMEhLNsr7HmuzkWGDwgS5Fbr3Xplgb2Z/fUtxN 3RTkkQtFmR55rdYSljCSu1m9aqCmYxrzD5SBLrGObfP23FO5cXO7Da7j026i9zHzdPDeuC wI4zhSjHAgpEHhh4WlRMaRIY+IYWPCs16yzr3QsQV6YSswR9He3NZzTroue36x12avZNV1 WVxwjWwZ5jE3rkXP0FS73+9FFM3cGDBecycH8oZra2UcVh+5c87p85fHsSk35wm4QrJsKL zQ5CtXtwkkc0lbnjNV7szwSxA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id a0653c70 (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO); Sat, 9 Jan 2021 15:49:53 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; References: <20210109143038.1918-1-vincent.legoll@gmail.com> In-reply-to: <20210109143038.1918-1-vincent.legoll@gmail.com> Date: Sat, 09 Jan 2021 16:49:24 +0100 Message-ID: <874kjq6rgb.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.45 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=tobias.gr header.s=2018 header.b=HsiXArgT; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 67CC79403A9 X-Spam-Score: -4.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: 80MQm47h5jNW --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Vincent, Vincent Legoll =E5=86=99=E9=81=93=EF=BC=9A > * gnu/packages/linux.scm (x86emu): New variable. I don't see the connection to Linux. How about emulators.scm? > +(define-public x86emu There's at least one other x86emu (declared obsolete upstream[0])=20 and I wouldn't be surprised if there were twenty. But if (this)=20 upstream insists on such a generic name, so be it. What's your use case for this package? Is it a fun hack, or more? > + (replace 'build > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (invoke "make" "all"))) The =E2=80=98all=E2=80=99 is presumably to build the =E2=80=98os=E2=80=99 (= bios + sample kernel)=20 images, but they aren't installed below. Is that intentional? The emulator is useless without them: $ x86emu [WARN] run_emulator (main.cpp:141) cannot load image 'sample/kernel.img' Segmentation fault $ x86emu .../sample/kernel.img [hangs] $ strace x86emu .../sample/kernel.img [...] openat(AT_FDCWD, "bios/bios.bin", O_RDONLY) =3D -1 ENOENT openat(AT_FDCWD, "bios/crt0.bin", O_RDONLY) =3D -1 ENOENT [hangs] Put them in a separate :os output if you like[1]. > + (replace 'install > + (lambda* (#:key inputs outputs #:allow-other-keys) =E2=80=98inputs=E2=80=99 is unused. > + (let* ((out (assoc-ref outputs "out")) > + (outbin (string-append out "/bin"))) Subjective nitpick: please just call this =E2=80=98bin=E2=80=99 :-) > + (mkdir-p outbin) > + (copy-file "x86emu" (string-append outbin=20 > "/x86emu")) These two lines can be replaced with the simpler: (install-file "x86emu" bin) > + (copy-recursively "include" (string-append out=20 > "/include")) > + #t)))))) > + (native-inputs > + `(("nasm" ,nasm))) > + (inputs > + `(("glfw" ,glfw))) > + (home-page "https://github.com/shift-crops/x86emu") > + (synopsis "simple x86 emulator") Running =E2=80=98guix lint x86emu=E2=80=99 will point out possible issues, = like=20 this lowercase s. > + (description "x86emu is an emulator of the x86=20 > architecture. It supports > +multiple CPU modes (16bit/32bit, Real/Protected), and some=20 > devices. You can > +boot via FDD simulator (DMA not supported), and operate with=20 > mouse and keyboard.") > + (license license:x11)))) This should be =E2=80=98expat=E2=80=99. The X11 variant is extremely rare. I made these changes (and a few more) in the attached patch and=20 the emulator starts, but hangs on a black screen with [WARN] hundle_interrupt (interrupt.cpp:40) exception interrupt=20 11 (!idt.P) looped on stderr. I didn't look into it. Thanks! T G-R [0]:=20 https://web.archive.org/web/20090218022239/http://www.scitechsoft.com/produ= cts/dev/x86_emulator.html [1]: I'm not sure where they belong. They're x86 but=20 =E2=80=98architecture independent=E2=80=99 from the host's point of view so= I put=20 them in /share nonetheless. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX/nQhA0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15afUBAKulQsFC9qusD3mi+rjfJIcJ7NdxvUXlFrRxQulo RpYWAP0ams9j57Qofc/VAhLb5an3Bxiu29l1VOClJoipcVo0CQ== =GLsK -----END PGP SIGNATURE----- --=-=-=--