43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#!/bin/zsh
|
|
|
|
d=${0:a:h:h}
|
|
cd $d
|
|
|
|
echo "=== Aios Boot Image Test ==="
|
|
|
|
# Install bootimage tool
|
|
echo "Installing bootimage tool..."
|
|
cargo install bootimage --quiet
|
|
|
|
# Build boot image
|
|
echo "Building bootable image..."
|
|
cd kernel
|
|
cargo bootimage --release
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "Build successful!"
|
|
|
|
# Find the boot image
|
|
echo "Looking for boot image..."
|
|
|
|
# Check the path shown in the build output
|
|
if [ -f "../target/x86_64-unknown-none/release/bootimage-aios-kernel.bin" ]; then
|
|
BOOT_IMAGE="../target/x86_64-unknown-none/release/bootimage-aios-kernel.bin"
|
|
else
|
|
# Search for it
|
|
BOOT_IMAGE=$(find .. -name "bootimage-*.bin" 2>/dev/null | head -1)
|
|
fi
|
|
|
|
if [ -n "$BOOT_IMAGE" ] && [ -f "$BOOT_IMAGE" ]; then
|
|
echo "Found boot image: $BOOT_IMAGE"
|
|
echo "Running in QEMU..."
|
|
qemu-system-x86_64 -drive format=raw,file="$BOOT_IMAGE"
|
|
else
|
|
echo "Boot image not found"
|
|
echo "Looking in parent directory..."
|
|
ls -la ../target/x86_64-unknown-none/release/ | grep bootimage
|
|
fi
|
|
else
|
|
echo "Build failed"
|
|
fi
|