summaryrefslogtreecommitdiff
path: root/Meta/run.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-18 14:47:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-18 17:31:13 +0200
commit7e94b090fed491f3ca9c0957e7ed2af8ed2e8468 (patch)
tree1ca195269e74ef7fa879229db362a47290d67eba /Meta/run.sh
parent357ddd393ebd38321f8bc02274942fcad29a1ac9 (diff)
downloadserenity-7e94b090fed491f3ca9c0957e7ed2af8ed2e8468.zip
Kernel: Introduce basic pre-kernel environment
This implements a simple bootloader that is capable of loading ELF64 kernel images. It does this by using QEMU/GRUB to load the kernel image from disk and pass it to our bootloader as a Multiboot module. The bootloader then parses the ELF image and sets it up appropriately. The kernel's entry point is a C++ function with architecture-native code. Co-authored-by: Liav A <liavalb@gmail.com>
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-xMeta/run.sh28
1 files changed, 23 insertions, 5 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index 48398a25f0..1da7bc6020 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -204,7 +204,8 @@ elif [ "$SERENITY_RUN" = "qn" ]; then
"$SERENITY_QEMU_BIN" \
$SERENITY_COMMON_QEMU_ARGS \
-device e1000 \
- -kernel Kernel/Kernel \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
-append "${SERENITY_KERNEL_CMDLINE}"
elif [ "$SERENITY_RUN" = "qtap" ]; then
# Meta/run.sh qtap: qemu with tap
@@ -216,7 +217,8 @@ elif [ "$SERENITY_RUN" = "qtap" ]; then
$SERENITY_PACKET_LOGGING_ARG \
-netdev tap,ifname=tap0,id=br0 \
-device e1000,netdev=br0 \
- -kernel Kernel/Kernel \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
-append "${SERENITY_KERNEL_CMDLINE}"
sudo ip tuntap del dev tap0 mode tap
elif [ "$SERENITY_RUN" = "qgrub" ]; then
@@ -235,8 +237,22 @@ elif [ "$SERENITY_RUN" = "q35" ]; then
$SERENITY_VIRT_TECH_ARG \
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
-device e1000,netdev=breh \
- -kernel Kernel/Kernel \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
-append "${SERENITY_KERNEL_CMDLINE}"
+elif [ "$SERENITY_RUN" = "bootloader_test" ]; then
+ # Meta/run.sh q35: qemu (q35 chipset) with SerenityOS
+ echo "Starting SerenityOS with QEMU Q35 machine, Commandline: ${SERENITY_KERNEL_CMDLINE}"
+ "$SERENITY_QEMU_BIN" \
+ $SERENITY_COMMON_QEMU_Q35_ARGS \
+ $SERENITY_VIRT_TECH_ARG \
+ -netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23 \
+ -device e1000,netdev=breh \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
+ -append "${SERENITY_KERNEL_CMDLINE}" \
+ -no-reboot \
+ -no-shutdown
elif [ "$SERENITY_RUN" = "ci" ]; then
# Meta/run.sh ci: qemu in text mode
echo "Running QEMU in CI"
@@ -252,7 +268,8 @@ elif [ "$SERENITY_RUN" = "ci" ]; then
-nographic \
-display none \
-debugcon file:debug.log \
- -kernel Kernel/Kernel \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
-append "${SERENITY_KERNEL_CMDLINE}"
else
# Meta/run.sh: qemu with user networking
@@ -262,6 +279,7 @@ else
$SERENITY_PACKET_LOGGING_ARG \
-netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-10.0.2.15:8888,hostfwd=tcp:127.0.0.1:8823-10.0.2.15:23,hostfwd=tcp:127.0.0.1:8000-10.0.2.15:8000,hostfwd=tcp:127.0.0.1:2222-10.0.2.15:22 \
-device e1000,netdev=breh \
- -kernel Kernel/Kernel \
+ -kernel Kernel/Prekernel/Prekernel \
+ -initrd Kernel/Kernel \
-append "${SERENITY_KERNEL_CMDLINE}"
fi