From: Tulio A M Mendes Date: Thu, 12 Feb 2026 08:13:01 +0000 (-0300) Subject: feat: include doom.elf in initrd when built X-Git-Url: https://projects.tadryanom.me/docs/POSIX_ROADMAP.md?a=commitdiff_plain;h=67f02241b0af4268e89555dc06badc0bc4e0062a;p=AdrOS.git feat: include doom.elf in initrd when built The Makefile now conditionally includes user/doom/doom.elf in the initrd as bin/doom.elf if it exists. This allows DOOM to be launched from the AdrOS shell via: /bin/doom.elf -iwad /path/to/doom1.wad The DOOM build is optional — the main kernel build is unaffected if doomgeneric has not been cloned. --- diff --git a/Makefile b/Makefile index 76d1edc..ab26401 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ ifeq ($(ARCH),x86) MKDIR_ELF := user/mkdir.elf RM_ELF := user/rm.elf LDSO_ELF := user/ld.so + DOOM_ELF := user/doom/doom.elf INITRD_IMG := initrd.img MKINITRD := tools/mkinitrd endif @@ -174,8 +175,17 @@ $(RM_ELF): user/rm.c user/linker.ld $(LDSO_ELF): user/ldso.c user/linker.ld @i686-elf-gcc -m32 -I include -ffreestanding -fno-pie -no-pie -nostdlib -Wl,-T,user/linker.ld -o $(LDSO_ELF) user/ldso.c -$(INITRD_IMG): $(MKINITRD) $(USER_ELF) $(ECHO_ELF) $(SH_ELF) $(CAT_ELF) $(LS_ELF) $(MKDIR_ELF) $(RM_ELF) $(LDSO_ELF) - @./$(MKINITRD) $(INITRD_IMG) $(USER_ELF):bin/init.elf $(ECHO_ELF):bin/echo.elf $(SH_ELF):bin/sh $(CAT_ELF):bin/cat $(LS_ELF):bin/ls $(MKDIR_ELF):bin/mkdir $(RM_ELF):bin/rm $(LDSO_ELF):lib/ld.so +INITRD_FILES := $(USER_ELF):bin/init.elf $(ECHO_ELF):bin/echo.elf $(SH_ELF):bin/sh $(CAT_ELF):bin/cat $(LS_ELF):bin/ls $(MKDIR_ELF):bin/mkdir $(RM_ELF):bin/rm $(LDSO_ELF):lib/ld.so +INITRD_DEPS := $(MKINITRD) $(USER_ELF) $(ECHO_ELF) $(SH_ELF) $(CAT_ELF) $(LS_ELF) $(MKDIR_ELF) $(RM_ELF) $(LDSO_ELF) + +# Include doom.elf if it has been built +ifneq ($(wildcard $(DOOM_ELF)),) +INITRD_FILES += $(DOOM_ELF):bin/doom.elf +INITRD_DEPS += $(DOOM_ELF) +endif + +$(INITRD_IMG): $(INITRD_DEPS) + @./$(MKINITRD) $(INITRD_IMG) $(INITRD_FILES) run: iso @rm -f serial.log qemu.log