summaryrefslogtreecommitdiff
path: root/package.nix
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-03-03 15:57:17 +0100
committerandromeda <andromeda@lenovo>2026-03-03 15:57:17 +0100
commit31c486acda6abf195a9a50709455e7f66a680324 (patch)
tree0c00f09d958e1a2d8c28f70cc07befc2324ebe58 /package.nix
parent8dee59b744bfa88bb4f946fa773a64ae7ac1e181 (diff)
actually jump to 'kernel'
Diffstat (limited to 'package.nix')
-rw-r--r--package.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/package.nix b/package.nix
index 150b46b..1cef31a 100644
--- a/package.nix
+++ b/package.nix
@@ -11,7 +11,12 @@ in
version = "0.1.0";
src = ./.;
buildPhase = ''
- ${nasm}/bin/nasm boot.asm -o ${bootImg}
+ ${nasm}/bin/nasm boot.asm -o boot.bin
+ ${nasm}/bin/nasm kernel.asm -o kernel.bin
+
+ dd if=/dev/zero of=${bootImg} bs=512 count=2
+ dd if=boot.bin of=${bootImg} conv=notrunc
+ dd if=kernel.bin of=${bootImg} bs=512 seek=1 conv=notrunc
'';
installPhase = ''
mkdir -p $out/bin
@@ -26,13 +31,10 @@ in
cp $(echo $out)/bin/${bootImg} ./.bootler/${bootImg}
chmod a+w ./.bootler/${bootImg}
- echo "press any key to continue. Qemu will clear the screen..."
- read -s -n 1
-
# run image
${qemu}/bin/qemu-system-x86_64 \
-nographic \
- -hda ./.bootler/${bootImg}
+ -drive file=./.bootler/${bootImg},format=raw,index=0,media=disk
# clean up
rm ./.bootler -r