summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-04-02 08:10:08 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-04-02 08:10:08 +0200
commit6c7e5ebc003a0bc4f98c23a8f9754b273a6e3a28 (patch)
tree2fde230004e377f734983484f8e12fb0414a1668
parente2b41947cde11c870d96970712dcfb3aa76eb0cf (diff)
boot/net: rename Boot.S files, clarify EEPROM implication, and prep UDP read
- 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 <amlal@nekernel.org>
-rw-r--r--dev/boot/BootKit/BootKit.h2
-rw-r--r--dev/boot/modules/BootNet/BootNet.cc10
-rw-r--r--dev/boot/modules/BootNet/BootNet.h2
-rw-r--r--dev/boot/modules/BootNet/BootNetStartup.S (renamed from dev/boot/modules/BootNet/Boot.S)0
-rw-r--r--dev/boot/modules/SysChk/SysChkStartup.S (renamed from dev/boot/modules/SysChk/Boot.S)0
-rw-r--r--dev/boot/src/HEL/AMD64/BootEFI.cc6
-rw-r--r--dev/boot/src/HEL/ARM64/BootEFI.cc4
-rw-r--r--dev/boot/src/New+Delete.cc2
-rw-r--r--dev/kernel/CFKit/GUIDWrapper.h4
-rw-r--r--dev/kernel/CFKit/Utils.h1
-rw-r--r--dev/kernel/FirmwareKit/CoreBoot/BootNet.h2
-rw-r--r--dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h11
-rw-r--r--dev/kernel/FirmwareKit/EPM.h4
-rw-r--r--dev/kernel/HALKit/AMD64/HalKernelMain.cc2
-rw-r--r--dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc12
-rw-r--r--dev/kernel/HALKit/AMD64/PCI/DMA.cc22
-rw-r--r--dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc2
-rw-r--r--dev/kernel/NewKit/Json.h30
-rw-r--r--dev/kernel/NewKit/Macros.h8
-rw-r--r--dev/kernel/NewKit/OwnPtr.h5
-rw-r--r--dev/kernel/StorageKit/ATA.h7
-rw-r--r--dev/kernel/src/Json.cc2
-rw-r--r--dev/kernel/src/KernelProcessScheduler.cc12
-rw-r--r--public/frameworks/KernelTest.fwrk/headers/KernelTest.h24
24 files changed, 107 insertions, 67 deletions
diff --git a/dev/boot/BootKit/BootKit.h b/dev/boot/BootKit/BootKit.h
index 759b0d94..3fed8944 100644
--- a/dev/boot/BootKit/BootKit.h
+++ b/dev/boot/BootKit/BootKit.h
@@ -381,7 +381,7 @@ namespace Boot
epm_boot.LbaStart = kNeFSRootCatalogStartAddress;
epm_boot.LbaEnd = fDiskDev.GetDiskSize();
epm_boot.SectorSz = part.SectorSize;
- epm_boot.Kind = kEPMNeOS;
+ epm_boot.Kind = kEPMNeKernel;
epm_boot.NumBlocks = part.CatalogCount;
CopyMem(epm_boot.Name, reinterpret_cast<VoidPtr>(const_cast<Char*>(kBlockName)), StrLen(kBlockName));
diff --git a/dev/boot/modules/BootNet/BootNet.cc b/dev/boot/modules/BootNet/BootNet.cc
index 2396852f..a877b9a1 100644
--- a/dev/boot/modules/BootNet/BootNet.cc
+++ b/dev/boot/modules/BootNet/BootNet.cc
@@ -13,10 +13,14 @@
EfiGUID kEfiIP4ProtoGUID;
+STATIC Void bootnet_read_udp_packet(BOOTNET_INTERNET_HEADER&);
+
EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover)
{
BOOTNET_INTERNET_HEADER inet{};
+ bootnet_read_udp_packet(inet);
+
memset(&inet, 0, sizeof(BOOTNET_INTERNET_HEADER));
/// TODO: Read packet from JSON file 'bootnet.json'
@@ -29,7 +33,7 @@ EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover)
return kEfiFail;
}
- if (!inet.ImpliesEEPROM)
+ if (!inet.ImpliesProgram)
{
Boot::BootThread thread(inet.Data);
@@ -50,3 +54,7 @@ EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover)
return kEfiFail;
}
+
+STATIC Void bootnet_read_udp_packet(BOOTNET_INTERNET_HEADER&)
+{
+} \ No newline at end of file
diff --git a/dev/boot/modules/BootNet/BootNet.h b/dev/boot/modules/BootNet/BootNet.h
index 2bf330df..aba7924f 100644
--- a/dev/boot/modules/BootNet/BootNet.h
+++ b/dev/boot/modules/BootNet/BootNet.h
@@ -27,7 +27,7 @@ typedef struct BOOTNET_INTERNET_HEADER
Kernel::Char Name[kBootNetNameLen]; /// example: Modjo
Kernel::Int32 Length; /// the patch length.
Kernel::Char Target[kBootNetNameLen]; /// the target file.
- Kernel::Boolean ImpliesEEPROM : 1; /// does it imply an EEPROM reprogram?
+ Kernel::Boolean ImpliesProgram : 1; /// does it imply an EEPROM reprogram?
Kernel::Boolean Preflight : 1; /// is it a preflight packet.
Kernel::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget**
} ATTRIBUTE(packed) BOOTNET_INTERNET_HEADER;
diff --git a/dev/boot/modules/BootNet/Boot.S b/dev/boot/modules/BootNet/BootNetStartup.S
index 976c5e88..976c5e88 100644
--- a/dev/boot/modules/BootNet/Boot.S
+++ b/dev/boot/modules/BootNet/BootNetStartup.S
diff --git a/dev/boot/modules/SysChk/Boot.S b/dev/boot/modules/SysChk/SysChkStartup.S
index 976c5e88..976c5e88 100644
--- a/dev/boot/modules/SysChk/Boot.S
+++ b/dev/boot/modules/SysChk/SysChkStartup.S
diff --git a/dev/boot/src/HEL/AMD64/BootEFI.cc b/dev/boot/src/HEL/AMD64/BootEFI.cc
index 076055b9..ef9af9ca 100644
--- a/dev/boot/src/HEL/AMD64/BootEFI.cc
+++ b/dev/boot/src/HEL/AMD64/BootEFI.cc
@@ -82,8 +82,8 @@ EfiGUID kEfiGlobalNamespaceVarGUID = {
/// @param image_handle Handle of this image.
/// @param sys_table The system table of it.
/// @return nothing, never returns.
-EFI_EXTERN_C EFI_API Int32 ModuleMain(EfiHandlePtr image_handle,
- EfiSystemTable* sys_table)
+EFI_EXTERN_C EFI_API Int32 ModuleMain(EfiHandlePtr image_handle,
+ EfiSystemTable* sys_table)
{
InitEFI(sys_table); ///! Init the EFI library.
@@ -202,7 +202,7 @@ EFI_EXTERN_C EFI_API Int32 ModuleMain(EfiHandlePtr image_handle,
//-----------------------------------------------------------//
SizeT lookup_index = 0UL;
- SizeT entry_count = size_struct_ptr / sz_desc;
+ SizeT entry_count = size_struct_ptr / sz_desc;
for (; lookup_index < entry_count; ++lookup_index)
{
diff --git a/dev/boot/src/HEL/ARM64/BootEFI.cc b/dev/boot/src/HEL/ARM64/BootEFI.cc
index adce693e..b6f28351 100644
--- a/dev/boot/src/HEL/ARM64/BootEFI.cc
+++ b/dev/boot/src/HEL/ARM64/BootEFI.cc
@@ -78,8 +78,8 @@ EXTERN EfiBootServices* BS;
/// @param image_handle Handle of this image.
/// @param sys_table The system table of it.
/// @return nothing, never returns.
-EFI_EXTERN_C EFI_API Int32 ModuleMain(EfiHandlePtr image_handle,
- EfiSystemTable* sys_table)
+EFI_EXTERN_C EFI_API Int32 ModuleMain(EfiHandlePtr image_handle,
+ EfiSystemTable* sys_table)
{
InitEFI(sys_table); ///! Init the EFI library.
diff --git a/dev/boot/src/New+Delete.cc b/dev/boot/src/New+Delete.cc
index b9982923..3e3cf48f 100644
--- a/dev/boot/src/New+Delete.cc
+++ b/dev/boot/src/New+Delete.cc
@@ -41,7 +41,7 @@ void operator delete(void* buf)
{
if (!buf)
return;
-
+
BS->FreePool(buf);
}
diff --git a/dev/kernel/CFKit/GUIDWrapper.h b/dev/kernel/CFKit/GUIDWrapper.h
index a92fcbf3..e58fcc69 100644
--- a/dev/kernel/CFKit/GUIDWrapper.h
+++ b/dev/kernel/CFKit/GUIDWrapper.h
@@ -10,11 +10,11 @@
#include <NewKit/Ref.h>
#include <NewKit/Stream.h>
-/* GUID for C++ Components */
+/* GUID for C++ classes. */
#define kXRNNil "@{........-....-M...-N...-............}"
-// eXtensible Resource Information
+/// @brief eXtended Resource Namespace
namespace CF::XRN
{
using namespace Kernel;
diff --git a/dev/kernel/CFKit/Utils.h b/dev/kernel/CFKit/Utils.h
index cc65bbee..b2a8b708 100644
--- a/dev/kernel/CFKit/Utils.h
+++ b/dev/kernel/CFKit/Utils.h
@@ -4,6 +4,7 @@
#include <KernelKit/PE.h>
#include <KernelKit/MSDOS.h>
+/// @brief CFKit
namespace CF
{
using namespace Kernel;
diff --git a/dev/kernel/FirmwareKit/CoreBoot/BootNet.h b/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
index a86ea81a..e3cda0ba 100644
--- a/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
+++ b/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
@@ -24,7 +24,7 @@ typedef struct BOOTNET_INTERNET_HEADER
Kernel::Char Name[kBootNetNameLen]; /// example: Modjo
Kernel::Int32 Length; /// the patch length.
Kernel::Char Target[kBootNetNameLen]; /// the target file.
- Kernel::Boolean ImpliesEEPROM : 1; /// does it imply an EEPROM reprogram?
+ Kernel::Boolean ImpliesProgram : 1; /// does it imply an EEPROM program?
Kernel::Boolean Preflight : 1; /// is it a preflight packet.
Kernel::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget**
} ATTRIBUTE(packed) BOOTNET_INTERNET_HEADER;
diff --git a/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
index 80d3307b..d2711025 100644
--- a/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
+++ b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
@@ -12,11 +12,11 @@ namespace Firmware::Detail::CoreBoot
{
using namespace Kernel;
- struct LEHeader;
+ struct COREBOOT_LINEAR_EXEC;
/// @brief Linear Executable Header
/// @author Amlal El Mahrouss
- struct ATTRIBUTE(aligned(4)) LEHeader
+ struct ATTRIBUTE(aligned(4)) COREBOOT_LINEAR_EXEC
{
const Char fMagic[2]; // magic number
const Char fName[10]; // operating system name
@@ -24,8 +24,13 @@ namespace Firmware::Detail::CoreBoot
const UInt32 fStartAddress; // start address (master/slave(s) thread)
#ifdef NE_IS_EXTENDED_COREBOOT
- const UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such (ARM)
+ const UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such. (ARM)
const UIntPtr fMasterStructureVersion; // master structure version.
#endif
+
+#ifdef NE_IS_MBCI_COREBOOT
+ const UIntPtr fMBCIStructure; // MBCI structure for MBCI (ARM)
+ const UIntPtr fMBCIStructureVersion; // MBCI structure version.
+#endif
};
} // namespace Firmware::Detail::CoreBoot
diff --git a/dev/kernel/FirmwareKit/EPM.h b/dev/kernel/FirmwareKit/EPM.h
index a5cb9fe7..548bb9a7 100644
--- a/dev/kernel/FirmwareKit/EPM.h
+++ b/dev/kernel/FirmwareKit/EPM.h
@@ -101,10 +101,10 @@ struct PACKED EPM_PART_BLOCK
enum
{
kEPMInvalid = 0x00,
- kEPMGenericOS = 0xcf, /// @brief Generic OS
+ kEPMGeneric = 0xcf, /// @brief Generic OS
kEPMLinux = 0x8f, /// @brief Linux on EPM
kEPMBSD = 0x9f, /// @brief Berkeley Soft. Distribution
- kEPMNeOS = 0x1f, /// @brief NeKernel.
+ kEPMNeKernel = 0x1f, /// @brief NeKernel.
kEPMInvalidOS = 0xff,
};
diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
index 0ebba546..0d58bb8a 100644
--- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc
+++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
@@ -98,6 +98,8 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept
kout << "Boot Time: " << Kernel::number(kEndTim - kStartTim) << kendl;
+ Kernel::NeFS::fs_init_nefs();
+
Kernel::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr);
Kernel::HAL::Register64 idt_reg;
diff --git a/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc b/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc
index 5819f1d9..63796393 100644
--- a/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc
+++ b/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc
@@ -17,7 +17,7 @@ namespace Kernel::HAL
/***********************************************************************************/
/// \brief Page store type.
/***********************************************************************************/
- struct NE_PAGE_STORE final
+ struct PageStore final
{
struct
{
@@ -43,9 +43,9 @@ namespace Kernel::HAL
return pte && pte->User;
}
- static NE_PAGE_STORE& The()
+ static PageStore& The()
{
- static NE_PAGE_STORE the;
+ static PageStore the;
return the;
}
};
@@ -60,7 +60,7 @@ namespace Kernel::HAL
UInt64 cr3 = (UInt64)hal_read_cr3();
- NE_PAGE_STORE& page_store = NE_PAGE_STORE::The();
+ PageStore& page_store = PageStore::The();
// Extract the indices from the virtual address
UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask;
@@ -123,7 +123,7 @@ namespace Kernel::HAL
UInt64 cr3 = (UInt64)hal_read_cr3();
- NE_PAGE_STORE& page_store = NE_PAGE_STORE::The();
+ PageStore& page_store = PageStore::The();
// Extract the indices from the virtual address
UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask;
@@ -189,7 +189,7 @@ namespace Kernel::HAL
mmi_page_status(pt_entry);
- NE_PAGE_STORE& page_store = NE_PAGE_STORE::The();
+ PageStore& page_store = PageStore::The();
// Update Internal store.
diff --git a/dev/kernel/HALKit/AMD64/PCI/DMA.cc b/dev/kernel/HALKit/AMD64/PCI/DMA.cc
index 747fab94..33cff13e 100644
--- a/dev/kernel/HALKit/AMD64/PCI/DMA.cc
+++ b/dev/kernel/HALKit/AMD64/PCI/DMA.cc
@@ -5,6 +5,7 @@
------------------------------------------- */
#include <KernelKit/PCI/DMA.h>
+#include <ArchKit/ArchKit.h>
namespace Kernel
{
@@ -26,37 +27,34 @@ namespace Kernel
if (offset == 0)
return false;
- kout << "[DMAWrapper::IsIn] Checking offset..\n";
+ kout << "[DMAWrapper::IsIn] Checking offset...\r";
return reinterpret_cast<UIntPtr>(this->fAddress) >= offset;
}
bool DMAWrapper::Write(const UIntPtr& bit, const UInt32& offset)
{
- kout << "[DMAWrapper::Read] Checking this->fAddress..\n";
+ kout << "[DMAWrapper::Read] Checking this->fAddress...\r";
if (!this->fAddress)
return false;
- kout << "[DMAWrapper::Write] Writing at address..\n";
+ kout << "[DMAWrapper::Write] Writing at address: " << hex_number(reinterpret_cast<UIntPtr>(this->fAddress) + offset) << kendl;
- auto addr =
- (volatile UIntPtr*)(reinterpret_cast<UIntPtr>(this->fAddress) + offset);
- *addr = bit;
+ ke_dma_write<UInt32>(reinterpret_cast<UIntPtr>(this->fAddress), offset, bit);
return true;
}
UIntPtr DMAWrapper::Read(const UInt32& offset)
{
- kout << "[DMAWrapper::Read] Checking this->fAddress..\n";
+ kout << "[DMAWrapper::Read] Checking this->fAddress...\r";
if (!this->fAddress)
- return 0;
+ return ~0;
- kout << "[DMAWrapper::Read] Reading this->fAddress..\n";
+ kout << "[DMAWrapper::Write] Writing at address: " << hex_number(reinterpret_cast<UIntPtr>(this->fAddress) + offset) << kendl;
- return *(volatile UIntPtr*)(reinterpret_cast<UIntPtr>(this->fAddress) + offset);
- ;
+ return ke_dma_read<UInt32>(reinterpret_cast<UIntPtr>(this->fAddress), offset);
}
UIntPtr DMAWrapper::operator[](const UIntPtr& offset)
@@ -70,7 +68,7 @@ namespace Kernel
return {};
OwnPtr<IOBuf<Char*>> dmaOwnPtr =
- make_ptr<IOBuf<Char*>, char*>(reinterpret_cast<char*>(dma->fAddress));
+ mm_make_own_ptr<IOBuf<Char*>, char*>(reinterpret_cast<char*>(dma->fAddress));
if (!dmaOwnPtr)
return {};
diff --git a/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc
index 300b959f..5aabf144 100644
--- a/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc
+++ b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc
@@ -76,7 +76,7 @@ Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster)
/// IDE interface
if (kATADevice.Subclass() == 0x01)
{
-
+
break;
}
}
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 <CompilerKit/CompilerKit.h>
#include <NewKit/Defines.h>
@@ -15,9 +15,10 @@
#include <NewKit/KString.h>
#include <NewKit/Utils.h>
-#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 <typename T, typename... Args>
- OwnPtr<T> make_ptr(Args... args)
+ inline OwnPtr<T> mm_make_own_ptr(Args... args)
{
OwnPtr<T> ret;
ret.template New<Args...>(forward(args)...);
diff --git a/dev/kernel/StorageKit/ATA.h b/dev/kernel/StorageKit/ATA.h
index b5e4b2d9..917fa12b 100644
--- a/dev/kernel/StorageKit/ATA.h
+++ b/dev/kernel/StorageKit/ATA.h
@@ -34,19 +34,18 @@ namespace Kernel
const Char* Name() const override;
const UInt16& GetIO();
- Void SetIO(const UInt16& io);
+ Void SetIO(const UInt16& io);
const UInt16& GetMaster();
- Void SetMaster(const UInt16& master);
+ Void SetMaster(const UInt16& master);
const UInt32& GetIndex();
- Void SetIndex(const UInt32& drv);
+ Void SetIndex(const UInt32& drv);
private:
void (*fCleanup)(void) = {nullptr};
UInt32 fDriveIndex{0U};
UInt16 fIO, fMaster{0U};
-
};
/// @brief Initialize an PIO device (StorageKit function)
diff --git a/dev/kernel/src/Json.cc b/dev/kernel/src/Json.cc
index ec5f2c7e..187da6fd 100644
--- a/dev/kernel/src/Json.cc
+++ b/dev/kernel/src/Json.cc
@@ -7,4 +7,4 @@
#include <NewKit/Json.h>
/// @brief Undefined object, is null in length.
-RTL_INIT_OBJECT(Kernel::Json::kNull, Kernel::Json);
+rtl_init_object(Kernel::Json::kNull, Kernel::Json);
diff --git a/dev/kernel/src/KernelProcessScheduler.cc b/dev/kernel/src/KernelProcessScheduler.cc
index 340adb39..2a2384e2 100644
--- a/dev/kernel/src/KernelProcessScheduler.cc
+++ b/dev/kernel/src/KernelProcessScheduler.cc
@@ -7,8 +7,20 @@
------------------------------------------- */
+#include <KernelKit/ProcessScheduler.h>
+
/***********************************************************************************/
/// @file KernelProcessScheduler.cc
/// @brief Privileged/Ring-0 process scheduler.
/// @author Amlal El Mahrouss (amlal@nekernel.org)
/***********************************************************************************/
+
+namespace Kernel
+{
+ /***********************************************************************************/
+ /// @brief Exit Code global variable.
+ /***********************************************************************************/
+
+ STATIC UInt32 kLastExitCode = 0U;
+
+} // namespace Kernel \ No newline at end of file
diff --git a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h
index 30fb3ce6..966672bb 100644
--- a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h
+++ b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h
@@ -15,20 +15,20 @@
#define KT_TEST_SUCCESS (0)
-#define KT_DECL_TEST(NAME, FN) \
+#define KT_DECL_TEST(NAME, FN) \
class KT_##NAME final \
- { \
- public: \
- void Run(); \
- const char* ToString(); \
- }; \
- inline void KT_##NAME::Run() \
- { \
- MUST_PASS(FN() == true); \
- } \
+ { \
+ public: \
+ void Run(); \
+ const char* ToString(); \
+ }; \
+ inline void KT_##NAME::Run() \
+ { \
+ MUST_PASS(FN() == true); \
+ } \
inline const char* KT_##NAME::ToString() \
- { \
- return #FN; \
+ { \
+ return #FN; \
}
KT_DECL_TEST(ALWAYS_BREAK, []() -> bool { return false; });