1 QEMU_ARGS
= -cpu qemu64
-M q35
-m
3G
-cdrom Qnixx.iso
-boot d
-smp
4 -rtc base
=localtime
-audiodev pa
,id
=audio0
-machine pcspk-audiodev
=audio0
3 CFLAGS
= @KERNEL_CFLAGS@
4 CC
= cross
/bin
/x86_64-elf-gcc
5 LD
= cross
/bin
/x86_64-elf-ld
9 rwildcard
=$(foreach d
,$(wildcard $(1:=/*)),$(call rwildcard
,$d,$2) $(filter $(subst *,%,$2),$d))
12 SRC
= $(call rwildcard
,$(SRCDIR
),*.c
)
13 OBJS
= $(patsubst $(SRCDIR
)/%.c
, $(OBJDIR
)/%.o
, $(SRC
))
16 all: $(OBJS
) asmfiles limine link iso
20 @echo
"Generating ISO..."
22 @mkdir
-p iso_root
/boot
24 limine
/limine.sys limine
/limine-cd.bin limine
/limine-cd-efi.bin iso_root
/
25 @cp sys
/kernel.sys meta
/*.bmp meta
/termfont.F16 iso_root
/boot
/
26 @xorriso
-as mkisofs
-b limine-cd.bin \
27 -no-emul-boot
-boot-load-size
4 -boot-info-table \
28 --efi-boot limine-cd-efi.bin \
29 -efi-boot-part
--efi-boot-image
--protective-msdos-label \
31 @echo
"Deploying Limine..."
32 @limine
/limine-deploy Qnixx.iso
36 @echo
"Fetching Limine binaries..."
37 @git clone https
://github.com
/limine-bootloader
/limine.git
--branch
=v4.0
-binary
--depth
=1
40 $(OBJDIR
)/%.o
: $(SRCDIR
)/%.c
41 mkdir
-p
$(shell dirname
$@
)
42 $(CC
) $(CFLAGS
) -c
$^
-o
$@
46 @echo
"Compiling assembly sources..."
47 @for source in
$$(find sys
/src
/ -name
"*.asm"); do nasm
-felf64
$$source; done
52 @mv
$(shell find sys
/src
/ -name
"*.o") asmobj
/
53 @echo
"Linking object files..."
54 @
$(LD
) $(shell find obj
/ -name
"*.o") asmobj
/* -nostdlib
-zmax-page-size
=0x1000 -static
-Tsys
/link.
ld -o sys
/kernel.sys
58 qemu-system-x86_64
--enable-kvm
$(QEMU_ARGS
) -serial stdio
66 rm -rf configure autom4te.cache config.status config.log install-sh Makefile