feat: working bootloader and basic kernel (just dyes screen green)

This commit is contained in:
karina
2026-04-20 08:30:08 +04:00
parent 9b549d4184
commit 1ee5dcbd0b
9 changed files with 258 additions and 16 deletions
+12 -7
View File
@@ -28,21 +28,24 @@ CPU := if ARCH_NAME == "aarch64" { "host" } else { "max" }
export BUILD_DIR := justfile_directory() + "/.build"
export TEMP_DIR := BUILD_DIR + "/temp"
export BOOT_BIN := BUILD_DIR + "/bootloader/BOOTAA64.EFI"
export BOOT_BIN := BUILD_DIR + "/Bootloader/BOOTAA64.EFI"
export IMG_FILE := BUILD_DIR + "/ksOS.img"
mod Bootloader
mod Kernel
_default:
just --list
_prep:
@mkdir -p {{BUILD_DIR}}/bootloader
@mkdir -p {{TEMP_DIR}}/bootloader
@mkdir -p {{BUILD_DIR}}/Bootloader
@mkdir -p {{TEMP_DIR}}/Bootloader
@mkdir -p {{BUILD_DIR}}/Kernel
@build: _prep
@echo "🛠️ Building everything..."
just Bootloader build
just Kernel build
@_image: build
@echo "💾 Creating image..."
@@ -50,19 +53,21 @@ _prep:
@mkfs.fat -F 32 {{IMG_FILE}} > /dev/null
@mmd -i {{IMG_FILE}} ::/EFI ::/EFI/BOOT
@mcopy -i {{IMG_FILE}} {{BOOT_BIN}} ::/EFI/BOOT/BOOTAA64.EFI
@mcopy -i {{IMG_FILE}} {{BUILD_DIR}}/Kernel/ksOSKernel.bin ::/ksOSKernel.bin
@run: _image
@echo "🚀 Launching..."
qemu-system-aarch64 {{ACCEL}} \
-machine virt \
-machine virt,acpi=off \
-cpu {{CPU}} \
-m 512M \
-device virtio-gpu-pci \
-device ramfb \
-display cocoa,show-cursor=on \
-drive if=pflash,format=raw,readonly=on,file={{OVMF_ARM}} \
-drive file={{IMG_FILE}},format=raw,if=none,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-serial mon:stdio
-serial stdio \
-monitor telnet:127.0.0.1:5555,server,nowait
@clean:
rm -rf {{BUILD_DIR}}