summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rwxr-xr-xkernel/build.sh10
-rw-r--r--kernel/shell.nix3
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/build.sh b/kernel/build.sh
index bf8c971..9d48229 100755
--- a/kernel/build.sh
+++ b/kernel/build.sh
@@ -9,7 +9,8 @@ GRUB_CFG_PATH="src/grub.cfg"
ARCH="x86_64"
TARGET="$ARCH-uff"
RUST_BIN="$TARGET_PATH/$TARGET/debug/libkernel.a"
-QUEMU="qemu-system-x86_64 -cdrom $TARGET_PATH/uff.iso"
+QEMU="qemu-system-x86_64 -cdrom $TARGET_PATH/uff.iso"
+GRUB_i386="${GRUB_i386:-/usr/lib/grub/i386-pc}"
cleanup_target() {
rm -f $TARGET_PATH/uff.iso &> /dev/null
@@ -48,7 +49,8 @@ build_kernel_iso() {
mkdir $TMP_PATH/isofiles/boot/grub &> /dev/null
cp $TARGET_PATH/kernel.bin $TMP_PATH/isofiles/boot &> /dev/null
cp $GRUB_CFG_PATH $TMP_PATH/isofiles/boot/grub/grub.cfg &> /dev/null
- grub-mkrescue -d /usr/lib/grub/i386-pc -o $TARGET_PATH/uff.iso $TMP_PATH/isofiles
+ [ -d "$GRUB_i386" ] || { echo "Grub img $GRUB_i386 does not exist!"; exit 1; }
+ grub-mkrescue -d "$GRUB_i386" -o $TARGET_PATH/uff.iso $TMP_PATH/isofiles
cleanup_temp
}
@@ -57,11 +59,11 @@ build_init() {
}
build_launch() {
- $QUEMU
+ $QEMU
}
build_launch_serial() {
- $QUEMU -device isa-debug-exit,iobase=0xf4,iosize=0x04 -serial stdio #-display none
+ $QEMU -device isa-debug-exit,iobase=0xf4,iosize=0x04 -serial stdio #-display none
}
build_run() {
diff --git a/kernel/shell.nix b/kernel/shell.nix
index ba2647a..4fc72af 100644
--- a/kernel/shell.nix
+++ b/kernel/shell.nix
@@ -2,4 +2,7 @@ with import <nixpkgs> { };
mkShell {
name = "uff-os";
buildInputs = [ rustup nasm grub2 cargo-xbuild gcc xorriso ];
+ shellHook = ''
+ export GRUB_i386="${grub2}/lib/grub/i386-pc"
+ '';
}