diff --git a/src/m1x/Makefile b/src/m1x/Makefile index 9d08f0a..f8dc0e4 100644 --- a/src/m1x/Makefile +++ b/src/m1x/Makefile @@ -6,7 +6,11 @@ include ../mk/default.mk .PHONY: all -all: arch +all: kern arch + +.PHONY: kern +kern: + cd kern/; make $(PASSDOWN_ARGS) .PHONY: arch arch: diff --git a/src/m1x/arch/x86_64/cpu/locore.S b/src/m1x/arch/x86_64/cpu/locore.S index af2af37..5958a52 100644 --- a/src/m1x/arch/x86_64/cpu/locore.S +++ b/src/m1x/arch/x86_64/cpu/locore.S @@ -5,11 +5,13 @@ .text .globl _start + .extern kmain _start: cli cld xor %rbp, %rbp + call kmain 1: hlt jmp 1b diff --git a/src/m1x/kern/Makefile b/src/m1x/kern/Makefile new file mode 100644 index 0000000..d4299e0 --- /dev/null +++ b/src/m1x/kern/Makefile @@ -0,0 +1,23 @@ +# +# Copyright (c) 2026, Ian Moffett. +# Provided under the BSD-3 clause. +# + +CFILES = $(shell find . -name "*.c") +DFILES = $(CFILES:.c=.d) +OFILES = $(CFILES:.c=.o) + +CC = ../../$(SYS_CC) +CFLAGS = \ + $(SYS_CFLAGS) \ + -D_KERNEL \ + -MMD \ + -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \ + -DPRINTF_DISABLE_SUPPORT_FLOAT + +.PHONY: all +all: $(OFILES) + +-include $(DFILES) +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ diff --git a/src/m1x/kern/kern_init.c b/src/m1x/kern/kern_init.c new file mode 100644 index 0000000..993931c --- /dev/null +++ b/src/m1x/kern/kern_init.c @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2026, Mirocom Laboratories + * Provided under the BSD-3 clause + */ + +void +kmain(void) +{ + for (;;); +}