paw: spkg: Add support package groundwork

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-22 01:24:57 +00:00
parent 6d53d19b2d
commit 3ad06ac1f8
7 changed files with 106 additions and 1 deletions
+4
View File
@@ -63,6 +63,10 @@ make_build() {
build() { build() {
mkdir -p artifacts/ mkdir -p artifacts/
make_build \
paw/ \
"Building world..."
make_build \ make_build \
paw/host \ paw/host \
"Building host utils..." "Building host utils..."
+16
View File
@@ -0,0 +1,16 @@
#
# Copyright (c) 2026, Chloe M.
# Provided under the BSD-3 clause
#
# Description: OS world build script
# Author: Chloe M.
#
include mk/stos.mk
.PHONY: all
all: spkg
.PHONY: spkg
spkg:
cd spkg/; $(MAKE) $(PASSDOWN_ARGS)
+25
View File
@@ -0,0 +1,25 @@
#
# Copyright (c) 2026, Chloe M.
# Provided under the BSD-3 clause
#
# Description: Support package build script
# Author: Chloe M.
#
.SILENT:
include ../mk/stos.mk
CFILES = $(shell find . -name "*.c")
OFILES = $(CFILES:.c=.o)
CFLAGS = \
$(SYS_CFLAGS) \
-Ihead \
-I$(ST_PROJECT_ROOT)/sdk/head
.PHONY: all
all: $(OFILES)
%.o: %.c
$(PROMPT) "CC" $<
$(SYS_CC) -c $(CFLAGS) $< -o $@
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: String helpers
* Author: Chloe M.
*/
#ifndef _SPKG_STRING_H_
#define _SPKG_STRING_H_ 1
#include <stdef.h>
/*
* Compare the differences between two strings
*
* @Buffer1: First buffer to compare
* @Buffer2: Second buffer to compare
* @Length: Number of bytes to compare
*
* Returns the differences
*/
LONG RtlMemCmp(const VOID *Buffer1, const VOID *Buffer2, USIZE Length);
#endif /* !_SPKG_STRING_H_ */
+32
View File
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: RtlMemCmp() implementation
* Author: Chloe M.
*/
#include <string.h>
LONG
RtlMemCmp(const VOID *Buffer1, const VOID *Buffer2, USIZE Length)
{
const UCHAR *Ptr1 = Buffer1;
const UCHAR *Ptr2 = Buffer2;
if (Buffer1 == NULL || Buffer2 == NULL) {
return 0;
}
if (Length == 0) {
return 0;
}
do {
if (*Ptr1++ != *Ptr2++) {
return (*--Ptr1 - *--Ptr2);
}
} while (--Length != 0);
return 0;
}
+1
View File
@@ -13,6 +13,7 @@ ASMFILES = $(shell find . -name "*.S")
ASMOFILES = $(ASMFILES:.S=.S.o) ASMOFILES = $(ASMFILES:.S=.S.o)
MISC_OFILES = $(ASMOFILES) MISC_OFILES = $(ASMOFILES)
MISC_OFILES += $(shell find $(ST_PROJECT_ROOT)/paw/spkg/ -name "*.o")
MISC_OFILES += $(shell find $(ST_PROJECT_ROOT)/paw/stos/ -name "*.o" | grep -v "arch") MISC_OFILES += $(shell find $(ST_PROJECT_ROOT)/paw/stos/ -name "*.o" | grep -v "arch")
KERNEL_PATH = \ KERNEL_PATH = \
+3 -1
View File
@@ -23,7 +23,9 @@ CFLAGS = \
-DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \ -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \
-DPRINTF_DISABLE_SUPPORT_FLOAT \ -DPRINTF_DISABLE_SUPPORT_FLOAT \
-I../head \ -I../head \
-I$(ST_PROJECT_ROOT)/sdk/head -I$(ST_PROJECT_ROOT)/paw/spkg/head \
-I$(ST_PROJECT_ROOT)/sdk/head \
-D_BOOT_PROTO="\"$(ST_BOOT_PROTOCOL)\""
.PHONY: all .PHONY: all
all: $(OFILES) all: $(OFILES)