feat(loader, kernel): impl part of loader and initialize kernel structure

This commit is contained in:
2026-04-11 09:42:09 +08:00
parent 1233ae9e9b
commit 34ccf69569
53 changed files with 1743 additions and 777 deletions

View File

@@ -1,11 +1,12 @@
#!/usr/bin/env bash
set -e
zig build
IMG=disk.img
IMG=zig-out/disk.img
SIZE=256M
MNT=/tmp/$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 16)
LIMINE_DIR=$HOME/Limine
KERNEL=./yukiImage
KERNEL=zig-out/yukiImage
echo "[*] Creating disk image..."
rm -f "$IMG"
@@ -43,8 +44,9 @@ sudo tee "$MNT/boot/limine.conf" > /dev/null << 'EOF'
timeout: 1
/Yuki OS
protocol: efi
protocol: multiboot2
path: boot():/boot/yukiImage
cmdline: earlyprintk=serial,ttyS0,115200
EOF
echo "[*] Syncing..."
@@ -53,5 +55,6 @@ sync
echo "[*] Unmounting..."
sudo umount "$MNT"
sudo losetup -d "$LOOP"
echo "[+] Done: $IMG created successfully"
sudo chown $USER:$USER "$IMG"
rmdir "$MNT"
echo "[+] Done: $IMG created successfully"

7
tools/run_qemu.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
qemu-system-x86_64 \
-enable-kvm -cpu host \
-drive file=zig-out/disk.img,format=raw \
-drive if=pflash,readonly=on,file=/usr/share/edk2/ovmf/OVMF_CODE.fd \
-serial stdio
# -s -S