actually jump to 'kernel'

This commit is contained in:
andromeda
2026-03-03 15:57:17 +01:00
parent 8dee59b744
commit 31c486acda
4 changed files with 197 additions and 21 deletions

View File

@@ -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