ptos: ke: Add kernel C groundwork
Signed-off-by: Chloe M. <chloe@yiffware.org>
This commit is contained in:
@@ -9,7 +9,11 @@
|
|||||||
include ../mk/ptos.mk
|
include ../mk/ptos.mk
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: machine
|
all: ke machine
|
||||||
|
|
||||||
|
.PHONY: ke
|
||||||
|
ke:
|
||||||
|
cd ke/; $(MAKE) $(PASSDOWN_ARGS)
|
||||||
|
|
||||||
.PHONY: machine
|
.PHONY: machine
|
||||||
machine:
|
machine:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ MdBspEntry:
|
|||||||
|
|
||||||
lea g_GDTR(%rip), %rdi
|
lea g_GDTR(%rip), %rdi
|
||||||
call MdGdtLoad
|
call MdGdtLoad
|
||||||
|
call KiKernelInit /* Kick off system init */
|
||||||
1: hlt
|
1: hlt
|
||||||
jmp 1b
|
jmp 1b
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2026, Chloe M.
|
||||||
|
# Provided under the BSD-3 clause
|
||||||
|
#
|
||||||
|
# Description: Kernel executive build script
|
||||||
|
# Author: Chloe M.
|
||||||
|
#
|
||||||
|
|
||||||
|
.SILENT:
|
||||||
|
include ../../mk/ptos.mk
|
||||||
|
|
||||||
|
CFILES = $(shell find . -name "*.c")
|
||||||
|
DFILES = $(CFILES:.c=.d)
|
||||||
|
OFILES = $(CFILES:.c=.o)
|
||||||
|
|
||||||
|
CFLAGS = \
|
||||||
|
$(SYS_CFLAGS) \
|
||||||
|
-MMD \
|
||||||
|
-D_KERNEL \
|
||||||
|
-DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \
|
||||||
|
-DPRINTF_DISABLE_SUPPORT_FLOAT \
|
||||||
|
-I../xt/flanterm/src \
|
||||||
|
-I../head \
|
||||||
|
-I../target \
|
||||||
|
-I$(PT_PROJECT_ROOT)/sdk/head
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: $(OFILES)
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(PROMPT) "CC" $<
|
||||||
|
$(SYS_CC) -c $(CFLAGS) $< -o $@
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026, Chloe M., et al
|
||||||
|
* Provided under the BSD-3 clause.
|
||||||
|
*
|
||||||
|
* Description: System bringup core
|
||||||
|
* Author: Chloe M.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ptdef.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Starting here is where the world is brought up and system
|
||||||
|
* components are initialized.
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
KiKernelInit(VOID)
|
||||||
|
{
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user