From 6c7e5ebc003a0bc4f98c23a8f9754b273a6e3a28 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 2 Apr 2025 08:10:08 +0200 Subject: boot/net: rename Boot.S files, clarify EEPROM implication, and prep UDP read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Renamed Boot.S → BootNetStartup.S and SysChk/Boot.S → SysChkStartup.S for clarity - Replaced BOOTNET_INTERNET_HEADER.ImpliesEEPROM with ImpliesProgram to better reflect the generic reprogramming intent - Introduced `bootnet_read_udp_packet()` stub for future UDP packet parsing from bootnet.json - Minor alignment and comment fixes in various headers (CoreBoot, EPM, Json) - Updated HalPagingMgr to use PageStore instead of NE_PAGE_STORE - Boot time now prints cycles since start; triggered fs_init_nefs() earlier during HAL init - Prep for extended MBCI and master structure support in COREBOOT_LINEAR_EXEC - Numerous cleanups across DMA, NewKit, and Json parsing to prep for extended patching and block-level bootstrap This lays groundwork for richer NetBoot infrastructure in NeKernel and aligns naming and structure conventions across subsystems. Signed-off-by: Amlal El Mahrouss --- dev/kernel/NewKit/Json.h | 30 ++++++++++++++++++++++-------- dev/kernel/NewKit/Macros.h | 8 ++++---- dev/kernel/NewKit/OwnPtr.h | 5 +++-- 3 files changed, 29 insertions(+), 14 deletions(-) (limited to 'dev/kernel/NewKit') diff --git a/dev/kernel/NewKit/Json.h b/dev/kernel/NewKit/Json.h index d159d915..5f979ceb 100644 --- a/dev/kernel/NewKit/Json.h +++ b/dev/kernel/NewKit/Json.h @@ -7,7 +7,7 @@ #pragma once -// last-rev: 30/01/24 +// last-rev: 02/04/25 #include #include @@ -15,9 +15,10 @@ #include #include -#define kMaxJsonPath 8196 -#define kJSONLen 256 -#define kJSONNull "[]" +#define kJSONMaxLen (8196) +#define kJSONLen (256) +#define kJSONNullArr "[]" +#define kJSONNullObj "{}" namespace Kernel { @@ -27,9 +28,9 @@ namespace Kernel public: explicit Json() { - auto len = kJSONLen; + auto len = kJSONMaxLen; KString key = KString(len); - key += kJSONNull; + key += kJSONNullObj; this->AsKey() = key; this->AsValue() = key; @@ -97,7 +98,7 @@ namespace Kernel SizeT key_len = 0; SizeT value_len = 0; - Json type(kMaxJsonPath, kMaxJsonPath); + Json type(kJSONMaxLen, kJSONMaxLen); for (SizeT i = 1; i < len; ++i) { @@ -116,6 +117,12 @@ namespace Kernel } else { + if (full_array[i] == '\'') + { + type.AsValue().Data()[value_len] = 0; + break; + } + type.AsValue().Data()[value_len] = full_array[i]; ++value_len; @@ -128,9 +135,16 @@ namespace Kernel if (full_array[i] == ':') { - probe_value = true; type.AsKey().Data()[key_len] = 0; ++key_len; + + ++i; + + while (full_array[i] == ' ' || + full_array[i] == '\t') + ++i; + + probe_value = true; } else { diff --git a/dev/kernel/NewKit/Macros.h b/dev/kernel/NewKit/Macros.h index 264d74d7..eda454f9 100644 --- a/dev/kernel/NewKit/Macros.h +++ b/dev/kernel/NewKit/Macros.h @@ -147,8 +147,8 @@ #define BOOL Kernel::Boolean -#ifdef RTL_INIT_OBJECT -#undef RTL_INIT_OBJECT -#endif // ifdef RTL_INIT_OBJECT +#ifdef rtl_init_object +#undef rtl_init_object +#endif // ifdef rtl_init_object -#define RTL_INIT_OBJECT(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) +#define rtl_init_object(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) diff --git a/dev/kernel/NewKit/OwnPtr.h b/dev/kernel/NewKit/OwnPtr.h index b292aafc..f15bc339 100644 --- a/dev/kernel/NewKit/OwnPtr.h +++ b/dev/kernel/NewKit/OwnPtr.h @@ -58,7 +58,8 @@ namespace Kernel T* operator->() const { return fCls; - }; + } + T* Raw() { return fCls; @@ -83,7 +84,7 @@ namespace Kernel }; template - OwnPtr make_ptr(Args... args) + inline OwnPtr mm_make_own_ptr(Args... args) { OwnPtr ret; ret.template New(forward(args)...); -- cgit v1.2.3