From df57eb710a4a92db2e4cdd8779d8bbab0c005f0f Mon Sep 17 00:00:00 2001 From: Chloe M Date: Mon, 13 Jul 2026 22:02:02 -0400 Subject: [PATCH] ptos: ke: Create root process Signed-off-by: Chloe M --- service/ptos/ke/Makefile | 1 + service/ptos/ke/init.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/service/ptos/ke/Makefile b/service/ptos/ke/Makefile index 3b31665..6141dbd 100644 --- a/service/ptos/ke/Makefile +++ b/service/ptos/ke/Makefile @@ -15,6 +15,7 @@ CFILES += $(shell find ../xt -name "*.c") CFILES += $(shell find ../drivers -name "*.c") CFILES += $(shell find ../mm -name "*.c") CFILES += $(shell find ../ex -name "*.c") +CFILES += $(shell find ../ps -name "*.c") DFILES = $(CFILES:.c=.d) OFILES = $(CFILES:.c=.o) diff --git a/service/ptos/ke/init.c b/service/ptos/ke/init.c index 834a8c5..a7dbf63 100644 --- a/service/ptos/ke/init.c +++ b/service/ptos/ke/init.c @@ -8,7 +8,9 @@ #include #include +#include #include +#include #include #include #include @@ -18,6 +20,7 @@ /* Globals */ static KPCR BootstrapCore; +static PROCESS *RootProcess; /* * Display the copyright for legal reasons @@ -29,6 +32,29 @@ Copyright(VOID) TRACE("Copyright (c) 2026, Chloe M., et al\n"); } +/* + * Initialize the first process + */ +static VOID +InitializeRootProcess(VOID) +{ + PT_STATUS Status; + + /* Create the client server runtime service */ + Status = PsCreateProcess( + "csrts.sys", + 0, + &RootProcess + ); + + if (PT_ERROR(Status)) { + KeBugCheck( + BUGCHECK_MISC, + "could not create csrts.sys process\n" + ); + } +} + /* * Starting here is where the world is brought up and system * components are initialized. @@ -62,4 +88,7 @@ KiKernelInit(VOID) /* Phase 2 init of bootstrap core */ HalKpcrP2Init(&BootstrapCore); + + /* Initialize the root process */ + InitializeRootProcess(); }