actually jump to 'kernel'
This commit is contained in:
12
package.nix
12
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
|
||||
|
||||
Reference in New Issue
Block a user