m1x: Add initial kernel C files
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
.extern kmain
|
||||
_start:
|
||||
cli
|
||||
cld
|
||||
|
||||
xor %rbp, %rbp
|
||||
call kmain
|
||||
|
||||
1: hlt
|
||||
jmp 1b
|
||||
|
||||
23
src/m1x/kern/Makefile
Normal file
23
src/m1x/kern/Makefile
Normal file
@@ -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 $@
|
||||
10
src/m1x/kern/kern_init.c
Normal file
10
src/m1x/kern/kern_init.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Mirocom Laboratories
|
||||
* Provided under the BSD-3 clause
|
||||
*/
|
||||
|
||||
void
|
||||
kmain(void)
|
||||
{
|
||||
for (;;);
|
||||
}
|
||||
Reference in New Issue
Block a user