summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-10 18:10:38 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-10 18:10:38 +0100
commit9097561c8754c5e9f49a8b0f346de081b3c3bd94 (patch)
tree9c5f8b326852820629dc18ae5003a8a747ad3450
parent825830590663c363b32c7b9caae8db5f3a5c913f (diff)
[CHORE] Add DDK testing, AsciiUtils tweaks, proof organization.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--proofs/Memory/HeapMgr.v (renamed from proofs/Kernel/HeapMgr.v)0
-rw-r--r--src/kernel/src/AsciiUtils.cpp9
-rw-r--r--src/libDDK/src/Allocator.cpp10
-rw-r--r--src/libSoundSystem/SoundSystemKit/VirtualMixer.h8
-rw-r--r--test/kernel_tests/libddk_tests/Makefile22
-rwxr-xr-xtools/kconf.py3
6 files changed, 38 insertions, 14 deletions
diff --git a/proofs/Kernel/HeapMgr.v b/proofs/Memory/HeapMgr.v
index a709888e..a709888e 100644
--- a/proofs/Kernel/HeapMgr.v
+++ b/proofs/Memory/HeapMgr.v
diff --git a/src/kernel/src/AsciiUtils.cpp b/src/kernel/src/AsciiUtils.cpp
index 697739a5..c063ef11 100644
--- a/src/kernel/src/AsciiUtils.cpp
+++ b/src/kernel/src/AsciiUtils.cpp
@@ -1,4 +1,4 @@
-// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
@@ -27,8 +27,11 @@ Size rt_string_len(const Char* ptr) {
const Char* rt_alloc_string(const Char* src) {
SizeT slen = rt_string_len(src);
Char* buffer = new Char[slen + 1];
+
if (!buffer) return nullptr;
+ rt_set_memory(buffer, 0, slen);
+
if (rt_copy_memory_safe(reinterpret_cast<voidPtr>(const_cast<Char*>(src)),
reinterpret_cast<voidPtr>(buffer), slen, slen + 1) < 0) {
delete[] buffer;
@@ -100,7 +103,9 @@ Int32 rt_to_lower(Int ch) {
}
Int32 rt_is_alnum(Int ch) {
- return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9');
+ return (ch >= 'a' && ch <= 'z') ||
+ (ch >= 'A' && ch <= 'Z') ||
+ (ch >= '0' && ch <= '9');
}
Boolean rt_is_space(Int ch) {
diff --git a/src/libDDK/src/Allocator.cpp b/src/libDDK/src/Allocator.cpp
index b8bc6b4c..1122e310 100644
--- a/src/libDDK/src/Allocator.cpp
+++ b/src/libDDK/src/Allocator.cpp
@@ -1,10 +1,6 @@
-/* ========================================
-
- Copyright Amlal El Mahrouss.
-
- Purpose: DDK allocator.
-
-======================================== */
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
+// Licensed under the Apache License, Version 2.0 (see LICENSE file)
+// Official repository: https://github.com/ne-foss-org/nekernel
#include <DriverKit/DriverKit.h>
diff --git a/src/libSoundSystem/SoundSystemKit/VirtualMixer.h b/src/libSoundSystem/SoundSystemKit/VirtualMixer.h
index e57ff29b..b6918f5a 100644
--- a/src/libSoundSystem/SoundSystemKit/VirtualMixer.h
+++ b/src/libSoundSystem/SoundSystemKit/VirtualMixer.h
@@ -9,9 +9,9 @@
#include <libSystem/SystemKit/System.h>
namespace SoundSystem {
- struct VirtualMixer;
- struct VirtualSource;
- struct VirtualVolume;
-}
+struct VirtualMixer;
+struct VirtualSource;
+struct VirtualVolume;
+} // namespace SoundSystem
#endif
diff --git a/test/kernel_tests/libddk_tests/Makefile b/test/kernel_tests/libddk_tests/Makefile
new file mode 100644
index 00000000..a2bb9d4f
--- /dev/null
+++ b/test/kernel_tests/libddk_tests/Makefile
@@ -0,0 +1,22 @@
+##################################################
+# (c) Amlal El Mahrouss and NeKernel Authors, licensed under the Apache 2.0 license.
+# This file is for libsystem testing.
+##################################################
+
+GCC=x86_64-w64-mingw32-g++ -Wl,-subsystem=17
+LIB=-L../../src/libSystem -lSystem
+STD=-std=c++20 -DKT_TESTING_ENABLED
+INCLUDE=-I../../src -I../../public -I../../public/frameworks/ -I../../
+
+OBJ_FILES = \
+ thread.test.exe \
+ memory.test.exe \
+ io.test.exe
+
+.PHONY: all
+all: $(OBJ_FILES)
+
+%.exe: %.cc
+ @echo "==> Building test: $@"
+ $(GCC) $(LIB) $< \
+ $(STD) $(INCLUDE) -o $(basename $<).exe \ No newline at end of file
diff --git a/tools/kconf.py b/tools/kconf.py
index f6403aee..910c7287 100755
--- a/tools/kconf.py
+++ b/tools/kconf.py
@@ -4,7 +4,8 @@
import os, json, sys
if __name__ == '__main__':
- print("kconf: running config script...")
+ print("kconf: running kernel as standalone...")
+ os.system("../script/debug_ahci_x64.sh")
sys.exit(0)