feat: add support for aarch64 timer/interrupts, port MontaukOS userspace

This commit is contained in:
daniel committed 2026-10-25 08:27:09 +01:00
1 parent 8b6379fb7e
commit 8c09ccef66
101 files changed
+1720 -629

No files matched your search

+24 -14
View File
@@ -10,12 +10,15 @@ QEMUFLAGS := -smp 4 -m 2G -d int -D qemu.log -no-reboot
override IMAGE_NAME := montauk-$(ARCH)
# Userspace exists only for x86_64 so far: other architectures get a
# ramdisk holding just the boot files.
# KERNEL_ONLY=1 builds a ramdisk holding just the boot files (no
# userspace), for bringing up a kernel on a new architecture.
KERNEL_ONLY ?= 0
# programs/ builds x86_64 into bin/, other architectures into bin-<arch>/.
ifeq ($(ARCH),x86_64)
KERNEL_ONLY ?= 0
PROGRAMS_BIN := programs/bin
else
KERNEL_ONLY ?= 1
PROGRAMS_BIN := programs/bin-$(ARCH)
endif
override EFI_LOADER_x86_64 := BOOTX64.EFI
@@ -23,6 +26,13 @@ override EFI_LOADER_aarch64 := BOOTAA64.EFI
override EFI_LOADER_riscv64 := BOOTRISCV64.EFI
override EFI_LOADER_loongarch64 := BOOTLOONGARCH64.EFI
# The host strip handles x86_64 images; other targets use their toolchain's.
ifeq ($(ARCH),x86_64)
STRIP := strip
else
STRIP := toolchain/local/bin/$(ARCH)-montauk-strip
endif
# AArch64 UEFI firmware for QEMU (Debian/Ubuntu: qemu-efi-aarch64).
AARCH64_EFI_FIRMWARE ?= /usr/share/qemu-efi-aarch64/QEMU_EFI.fd
@@ -227,12 +237,12 @@ ramdisk: limine/limine kernel
rm -rf .kernel-only-root
else
ramdisk: limine/limine kernel programs
mkdir -p programs/bin/boot/limine
cp -v limine/$(EFI_LOADER_$(ARCH)) programs/bin/boot/limine/
cp -v limine.conf programs/bin/boot/limine/
cp -v kernel/bin-$(ARCH)/kernel programs/bin/boot/
rm -f programs/bin/boot/ramdisk.tar
./scripts/mkramdisk.sh programs/bin ramdisk.tar
mkdir -p $(PROGRAMS_BIN)/boot/limine
cp -v limine/$(EFI_LOADER_$(ARCH)) $(PROGRAMS_BIN)/boot/limine/
cp -v limine.conf $(PROGRAMS_BIN)/boot/limine/
cp -v kernel/bin-$(ARCH)/kernel $(PROGRAMS_BIN)/boot/
rm -f $(PROGRAMS_BIN)/boot/ramdisk.tar
./scripts/mkramdisk.sh $(PROGRAMS_BIN) ramdisk.tar
endif
$(IMAGE_NAME).iso: limine/limine kernel ramdisk
@@ -292,8 +302,8 @@ release: limine/limine kernel ramdisk
rm -rf iso_root .release-tmp
mkdir -p iso_root/boot
cp kernel/bin-$(ARCH)/kernel iso_root/boot/
strip iso_root/boot/kernel
cp -r programs/bin .release-tmp
$(STRIP) iso_root/boot/kernel
cp -r $(PROGRAMS_BIN) .release-tmp
# A release ISO ships only in-tree apps, so drop any out-of-tree port bundles
# that happen to be staged in programs/bin/apps (each carries a .port marker).
# Pass RELEASE_WITH_PORTS=1 to deliberately cut a ports-included image.
@@ -317,11 +327,11 @@ ifeq ($(RELEASE_WITHOUT_SDK),1)
.release-tmp/sdk/libexec .release-tmp/sdk/x86_64-montauk
endif
rm -f $(addprefix .release-tmp/os/,$(RELEASE_EXCLUDE_PROGRAMS))
find .release-tmp -name '*.elf' -exec strip {} +
find .release-tmp -name '*.elf' -exec $(STRIP) {} +
# The ramdisk carries its own copy of the kernel at 0:/boot/kernel -- that is
# the image the Installer lays down on the target disk -- and it is not named
# *.elf, so the find above misses it. Unstripped it is ~6 MB against ~0.7 MB.
strip .release-tmp/boot/kernel
$(STRIP) .release-tmp/boot/kernel
./scripts/mkramdisk.sh .release-tmp iso_root/boot/ramdisk.tar
rm -rf .release-tmp
mkdir -p iso_root/boot/limine