summaryrefslogtreecommitdiff
path: root/nix/pkgs/bootler.nix
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-03-06 20:33:51 +0100
committerandromeda <andromeda@lenovo>2026-03-06 20:33:51 +0100
commit9c65697dd8119ec9cee13f57f870b07e305d27ec (patch)
tree27b61bd7a27df6e25db8b21dc0ee3daed01d79fb /nix/pkgs/bootler.nix
parentfdf5bb9daf8574b7f993e2e38e400c35aedc3b96 (diff)
bunch of stuff idek
Diffstat (limited to 'nix/pkgs/bootler.nix')
-rw-r--r--nix/pkgs/bootler.nix49
1 files changed, 0 insertions, 49 deletions
diff --git a/nix/pkgs/bootler.nix b/nix/pkgs/bootler.nix
deleted file mode 100644
index 3e5d2e4..0000000
--- a/nix/pkgs/bootler.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- stdenv,
- nasm,
- qemu,
- ...
-}: let
- bootImg = "boot";
-in
- stdenv.mkDerivation {
- pname = "bootler";
- version = "0.1.0";
- src = ../../.;
- buildPhase = ''
- ${nasm}/bin/nasm asm/boot.asm -o boot.bin
- ${nasm}/bin/nasm asm/kernel.asm -o dummy.bin
-
- dd if=/dev/zero of=${bootImg} bs=512 count=2
- dd if=boot.bin of=${bootImg} conv=notrunc
- dd if=dummy.bin of=${bootImg} bs=512 seek=1 conv=notrunc
- '';
- installPhase = ''
- mkdir -p $out/bin
- cp boot.bin $out/bin
- cp dummy.bin $out/bin
- cp ${bootImg} $out/bin
-
- # create emulation binary
- cat<<EOF>$out/bin/bootler
- #!/usr/bin/env bash
-
- # create temp dir
- mkdir -p ./.bootler
- cp $(echo $out)/bin/${bootImg} ./.bootler/${bootImg}
- chmod a+w ./.bootler/${bootImg}
-
- # run image
- ${qemu}/bin/qemu-system-x86_64 \
- -nographic \
- -drive file=./.bootler/${bootImg},format=raw,index=0,media=disk
-
- # clean up
- rm ./.bootler -r
-
- EOF
-
- chmod +x $out/bin/${bootImg}
- chmod +x $out/bin/bootler
- '';
- }