From 13abee9986b2e21b735dde8817d90aaf0d11830b Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 6 Jun 2020 02:35:31 -0300 Subject: tiny8086: update source and build script --- .../virtualization/8086tiny/builder.sh | 8 +++-- .../virtualization/8086tiny/default.nix | 34 ++++++++++++---------- 2 files changed, 24 insertions(+), 18 deletions(-) (limited to 'pkgs/applications/virtualization') diff --git a/pkgs/applications/virtualization/8086tiny/builder.sh b/pkgs/applications/virtualization/8086tiny/builder.sh index 7cff2589abe0..210f11e1328d 100644 --- a/pkgs/applications/virtualization/8086tiny/builder.sh +++ b/pkgs/applications/virtualization/8086tiny/builder.sh @@ -1,17 +1,19 @@ source $stdenv/setup -mkdir -p ./$name $out/bin $out/share/$name $out/share/doc/$name/images +unpackPhase +cd $sourceRoot -cd $name -tar xf $src make 8086tiny + if [ $bios ]; then cd bios_source nasm -f bin bios.asm -o bios cd .. fi +mkdir -p $out/bin $out/share/$name $out/share/doc/$name/images + install -m 755 8086tiny $out/bin install -m 644 fd.img $out/share/$name/8086tiny-floppy.img install -m 644 bios_source/bios.asm $out/share/$name/8086tiny-bios-src.asm diff --git a/pkgs/applications/virtualization/8086tiny/default.nix b/pkgs/applications/virtualization/8086tiny/default.nix index 464ea053cc4f..96ccc2558815 100644 --- a/pkgs/applications/virtualization/8086tiny/default.nix +++ b/pkgs/applications/virtualization/8086tiny/default.nix @@ -1,17 +1,19 @@ -{ stdenv, fetchurl +{ stdenv, fetchFromGitHub , localBios ? true, nasm ? null , sdlSupport ? true, SDL ? null }: assert sdlSupport -> (SDL != null); -stdenv.mkDerivation { +stdenv.mkDerivation rec{ pname = "8086tiny"; version = "1.25"; - src = fetchurl { - url ="http://www.megalith.co.uk/8086tiny/downloads/8086tiny_125.tar.bz2"; - sha256 = "0kmq4iiwhi2grjwq43ljjk1b1f1v1x9gzrgrgq2fzfsj7m7s6ris"; + src = fetchFromGitHub { + owner = "adriancable"; + repo = pname; + rev = "c79ca2a34d96931d55ef724c815b289d0767ae3a"; + sha256 = "00aydg8f28sgy8l3rd2a7jvp56lx3b63hhak43p7g7vjdikv495w"; }; buildInputs = with stdenv.lib; @@ -22,18 +24,20 @@ stdenv.mkDerivation { builder = ./builder.sh; - meta = { - description = "An open-source 8086 emulator"; + meta = with stdenv.lib; { + description = "An open-source small 8086 emulator"; longDescription = '' - 8086tiny is a tiny, open-source (MIT), portable (little-endian hosts) Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny emulates a "late 80's era" PC XT-type machine. + 8086tiny is a tiny, open-source (MIT), portable (little-endian hosts) + Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS + Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny + emulates a "late 80's era" PC XT-type machine. - 8086tiny is based on an IOCCC 2013 winning entry. In fact that is the "unobfuscated" version :) + 8086tiny is based on an IOCCC 2013 winning entry. In fact that is the + "unobfuscated" version :) ''; - homepage = "http://www.megalith.co.uk/8086tiny/index.html"; - license = stdenv.lib.licenses.mit; - maintainers = [ stdenv.lib.maintainers.AndersonTorres ]; - platforms = stdenv.lib.platforms.linux; + homepage = "https://github.com/adriancable/8086tiny"; + license = licenses.mit; + maintainers = [ maintainers.AndersonTorres ]; + platforms = platforms.linux; }; } - -# TODO: add support for a locally made BIOS -- cgit 1.4.1 From 55912f3535217910b12e81f07fb10d70511a471b Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Fri, 22 May 2020 15:15:32 +1200 Subject: nixos/qemu-vm: add option to use a non-standard BIOS I'd like to change the default on x86 platforms to qboot at some point, since it saves a fair bit of startup time. --- nixos/modules/virtualisation/qemu-vm.nix | 15 +++++++++++++++ nixos/tests/all-tests.nix | 1 + nixos/tests/qboot.nix | 13 +++++++++++++ pkgs/applications/virtualization/qboot/default.nix | 4 +++- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/qboot.nix (limited to 'pkgs/applications/virtualization') diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index ac86330c098b..42776e80ffef 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -441,6 +441,18 @@ in ''; }; + virtualisation.bios = + mkOption { + default = null; + type = types.nullOr types.package; + description = + '' + An alternate BIOS (such as qboot) with which to start the VM. + Should containin a file named bios.bin. + If null, QEMU's builtin SeaBIOS will be used. + ''; + }; + }; config = { @@ -521,6 +533,9 @@ in (mkIf cfg.useEFIBoot [ "-pflash $TMPDIR/bios.bin" ]) + (mkIf (cfg.bios != null) [ + "-bios ${cfg.bios}/bios.bin" + ]) (mkIf (!cfg.graphics) [ "-nographic" ]) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 796c626f3dde..8e262d8eee7d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -273,6 +273,7 @@ in prosody = handleTest ./xmpp/prosody.nix {}; prosodyMysql = handleTest ./xmpp/prosody-mysql.nix {}; proxy = handleTest ./proxy.nix {}; + qboot = handleTestOn ["x86_64-linux" "i686-linux"] ./qboot.nix {}; quagga = handleTest ./quagga.nix {}; quorum = handleTest ./quorum.nix {}; rabbitmq = handleTest ./rabbitmq.nix {}; diff --git a/nixos/tests/qboot.nix b/nixos/tests/qboot.nix new file mode 100644 index 000000000000..12aef6decfae --- /dev/null +++ b/nixos/tests/qboot.nix @@ -0,0 +1,13 @@ +import ./make-test-python.nix ({ pkgs, ...} : { + name = "qboot"; + + machine = { ... }: { + virtualisation.bios = pkgs.qboot; + }; + + testScript = + '' + start_all() + machine.wait_for_unit("multi-user.target") + ''; +}) diff --git a/pkgs/applications/virtualization/qboot/default.nix b/pkgs/applications/virtualization/qboot/default.nix index 800d601c76e6..8d1f9dac2e51 100644 --- a/pkgs/applications/virtualization/qboot/default.nix +++ b/pkgs/applications/virtualization/qboot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, meson, ninja, fetchFromGitHub }: +{ stdenv, meson, ninja, fetchFromGitHub, nixosTests }: stdenv.mkDerivation { name = "qboot-20200423"; @@ -19,6 +19,8 @@ stdenv.mkDerivation { hardeningDisable = [ "stackprotector" "pic" ]; + passthru.tests = { qboot = nixosTests.qboot; }; + meta = { description = "A simple x86 firmware for booting Linux"; homepage = "https://github.com/bonzini/qboot"; -- cgit 1.4.1