diff options
| -rw-r--r-- | doc/specs/SPECIFICATION_MACROS.md | 5 | ||||
| -rw-r--r-- | doc/specs/SPECIFICATION_MBCI.md | 3 | ||||
| -rw-r--r-- | doc/specs/SPECIFICATION_OS.md | 9 | ||||
| -rw-r--r-- | doc/tex/openhefs.tex | 2 | ||||
| -rw-r--r-- | doc/tex/trace_server.tex | 17 | ||||
| -rw-r--r-- | src/kernel/DmaKit/DmaPool.h | 15 | ||||
| -rw-r--r-- | src/kernel/GfxKit/FB.h | 8 | ||||
| -rw-r--r-- | src/kernel/GfxKit/GPU.h | 36 | ||||
| -rw-r--r-- | src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc | 2 | ||||
| -rw-r--r-- | src/kernel/HALKit/AMD64/HalCoreSystemCalls+DDK.cc (renamed from src/kernel/HALKit/AMD64/HalCoreSystemCalls.cc) | 6 | ||||
| -rw-r--r-- | src/kernel/HALKit/AMD64/HalCoreSystemCalls+NeLaunch.cc | 9 | ||||
| -rw-r--r-- | src/kernel/KernelKit/TraceSrv.h | 26 | ||||
| -rw-r--r-- | src/kernel/amd64-desktop.make | 3 | ||||
| -rw-r--r-- | src/kernel/src/UserProcessScheduler.cc | 4 | ||||
| -rw-r--r-- | src/launch/src/AppMain.cc | 6 | ||||
| -rw-r--r-- | src/libDDK/DriverKit/ddk.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/System.h | 14 | ||||
| -rw-r--r-- | src/modules/MBCI/MBCI.h | 2 |
18 files changed, 139 insertions, 33 deletions
diff --git a/doc/specs/SPECIFICATION_MACROS.md b/doc/specs/SPECIFICATION_MACROS.md index 3acef7af..3b091454 100644 --- a/doc/specs/SPECIFICATION_MACROS.md +++ b/doc/specs/SPECIFICATION_MACROS.md @@ -4,6 +4,8 @@ =================================== +The NeKernel System uses macro to configure its compilation. Some of them shall not be defined at the same time to avoid run-time issues. + =================================== # 1: NeKernel/BootZ: @@ -13,6 +15,9 @@ - `__nekernel_max_cores` -> Max SMP cores usable by NeKernel's scheduler. - `__nekernel_boot_core_index` -> Index of the boot core (0, 1, or 3). - `__nekernel_allow_non_nekernel_pe` -> Allow non-subsystem 17 to run on NeKernel. +- `__nekernel_halkit_include_processor` HALKit include directory for Processor.h +- `__nekernel_dma_pool_start` NeKernel DMA pool start. +- `__nekernel_dma_pool_size` NeKernel DMA pool size. =================================== diff --git a/doc/specs/SPECIFICATION_MBCI.md b/doc/specs/SPECIFICATION_MBCI.md index 648529cf..4c6aa0b9 100644 --- a/doc/specs/SPECIFICATION_MBCI.md +++ b/doc/specs/SPECIFICATION_MBCI.md @@ -14,7 +14,8 @@ =================================== -- MBCI Host +- MBCI Client, the controlled MBCI component. +- MBCI Host, it shall govern how the MBCI Client act. - MBCI Authentication key (24-bit number) - MBCI Host Kind and Flags. diff --git a/doc/specs/SPECIFICATION_OS.md b/doc/specs/SPECIFICATION_OS.md index 346ae3c9..9838609a 100644 --- a/doc/specs/SPECIFICATION_OS.md +++ b/doc/specs/SPECIFICATION_OS.md @@ -77,3 +77,12 @@ - Multi-drive support (A, B, C, D indices). - Packet-based I/O operations. - Separation of read/write operations per drive. + +=================================== + +# 6: The TraceSrv: + +================================== + +- Opcode Based Debug System. +- Packet Based Messages with a 'type' field. The 'type' field shall decide how the message shall be interpreted. diff --git a/doc/tex/openhefs.tex b/doc/tex/openhefs.tex index 136d651c..8503bcd0 100644 --- a/doc/tex/openhefs.tex +++ b/doc/tex/openhefs.tex @@ -12,7 +12,7 @@ \maketitle -\section{Overview} +\section{Abstract} The High-throughput Extended File System (OpenHeFS) is a custom filesystem tailored for performance, structure, and compact representation. It uses red-black trees for directory indexing, sparse block slicing for file layout, and fixed-size metadata structures optimized for 512-byte sector alignment. \section{Constants and Macros} diff --git a/doc/tex/trace_server.tex b/doc/tex/trace_server.tex new file mode 100644 index 00000000..55ef491b --- /dev/null +++ b/doc/tex/trace_server.tex @@ -0,0 +1,17 @@ +\documentclass{article} +\usepackage{graphicx} + +\title{TraceSrv: The Trace Subsystem} +\author{Amlal El Mahrouss} +\date{\today} + +\begin{document} + +\maketitle + +\begin{abstract} +{The Trace Subsystem in NeKernel is responsible for handling tracing and debugging functionalities within the operating system kernel. +This document provides an overview of the design and components of the Trace Subsystem, including its message structures and communication protocols.} +\end{abstract} + +\end{document}
\ No newline at end of file diff --git a/src/kernel/DmaKit/DmaPool.h b/src/kernel/DmaKit/DmaPool.h index 1cf3200f..880daab7 100644 --- a/src/kernel/DmaKit/DmaPool.h +++ b/src/kernel/DmaKit/DmaPool.h @@ -7,17 +7,10 @@ #include <KernelKit/DebugOutput.h> -#ifdef __NE_AMD64__ -#include <HALKit/AMD64/Processor.h> -#define kNeDMAPoolStart (0x1000000) -#define kNeDMAPoolSize (0x1000000) -#elif defined(__NE_ARM64__) -#include <HALKit/ARM64/Processor.h> - -/// @todo what reference offset shall we use? -#define kNeDMAPoolStart (0x1000000) -#define kNeDMAPoolSize (0x1000000) -#endif +#include __nekernel_halkit_include_processor + +#define kNeDMAPoolStart (__nekernel_dma_pool_start) +#define kNeDMAPoolSize (__nekernel_dma_pool_size) #define kNeDMABestAlign (8) diff --git a/src/kernel/GfxKit/FB.h b/src/kernel/GfxKit/FB.h index 79539995..462608ae 100644 --- a/src/kernel/GfxKit/FB.h +++ b/src/kernel/GfxKit/FB.h @@ -12,10 +12,10 @@ namespace Kernel { class FBDeviceInterface; struct FBDevicePacket; -typedef UInt32 FBCoord2x2; -typedef UInt32 FBDim2x2; -typedef UInt32 FBColorProfile; -typedef UInt32 FBFlags; +using FBCoord2x2 = UInt32; +using FBDim2x2 = UInt32; +using FBColorProfile = UInt32; +using FBFlags = UInt32; /// @brief Framebuffer device interface packet. /// @details This structure is used to send and receive data from the framebuffer device. diff --git a/src/kernel/GfxKit/GPU.h b/src/kernel/GfxKit/GPU.h new file mode 100644 index 00000000..78d71558 --- /dev/null +++ b/src/kernel/GfxKit/GPU.h @@ -0,0 +1,36 @@ +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/nekernel-org/nekernel + +#ifndef GFXKIT_FB_H +#define GFXKIT_FB_H + +#include <KernelKit/DeviceMgr.h> + +namespace Kernel { + +class GPUDeviceInterface; + +/// @brief Framebuffer device interface. +/// @details This class is used to send and receive data from the framebuffer device. +/// @note The class is derived from the IDevice class. +class GPUDeviceInterface NE_DEVICE<VoidPtr> { + public: + GPUDeviceInterface(void (*out)(IDevice* self, GPUDeviceInterface* out), + void (*in)(IDevice* self, GPUDeviceInterface* in)); + + virtual ~GPUDeviceInterface() override; + + public: + GPUDeviceInterface& operator=(const GPUDeviceInterface&) = default; + GPUDeviceInterface(const GPUDeviceInterface&) = default; + const Char* Name() const override; + + public: + GPUDeviceInterface& operator<<(VoidPtr dat) override; + GPUDeviceInterface& operator>>(VoidPtr dat) override; +}; + +} // namespace Kernel + +#endif diff --git a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc index 040f5daa..e977912f 100644 --- a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc +++ b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc @@ -12,7 +12,7 @@ EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip); EXTERN_C Kernel::UIntPtr kApicBaseAddress; -static bool kIsRunning = NO; +STATIC BOOL kIsRunning{NO}; /// @brief Notify APIC and PIC that we're done with the interrupt. /// @note diff --git a/src/kernel/HALKit/AMD64/HalCoreSystemCalls.cc b/src/kernel/HALKit/AMD64/HalCoreSystemCalls+DDK.cc index 4e089de0..12429e48 100644 --- a/src/kernel/HALKit/AMD64/HalCoreSystemCalls.cc +++ b/src/kernel/HALKit/AMD64/HalCoreSystemCalls+DDK.cc @@ -1,7 +1,9 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel #include <ArchKit/ArchKit.h> -using namespace Kernel; +namespace Kernel { + +}
\ No newline at end of file diff --git a/src/kernel/HALKit/AMD64/HalCoreSystemCalls+NeLaunch.cc b/src/kernel/HALKit/AMD64/HalCoreSystemCalls+NeLaunch.cc new file mode 100644 index 00000000..29740f00 --- /dev/null +++ b/src/kernel/HALKit/AMD64/HalCoreSystemCalls+NeLaunch.cc @@ -0,0 +1,9 @@ +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/nekernel-org/nekernel + +#include <ArchKit/ArchKit.h> + +namespace Kernel { + +} diff --git a/src/kernel/KernelKit/TraceSrv.h b/src/kernel/KernelKit/TraceSrv.h index 79fbd7da..9da48561 100644 --- a/src/kernel/KernelKit/TraceSrv.h +++ b/src/kernel/KernelKit/TraceSrv.h @@ -13,12 +13,36 @@ namespace TraceSrv { inline constexpr auto kDebugCmdLen = 256U; inline constexpr auto kDebugPort = 51820; - /// \brief Debug Magic Value inline constexpr auto kDebugMagic = "NE1.0.0;"; inline constexpr auto kDebugVersion = 0x0100; inline constexpr auto kDebugDelim = ';'; inline constexpr auto kDebugEnd = '\r'; + enum class TRACE_SOURCE_OPCODE { + kStop, + kContinue, + kStepIn, + kStepOver, + kStepOut, + kSetBreakpoint, + kRemoveBreakpoint, + kGetStackTrace, + kGetSourceMessage, + kGetVariables, + kEvaluateExpression, + kUnknown + }; + + inline constexpr auto kDebugSymbolLen = 0x0100; + + struct TRACE_SOURCE_MESSAGE { + Int32 fType; + Int32 fChksum; + Char fSymbol[kDebugSymbolLen]; + UInt32 fOffset; + UInt32 fOpcode; + }; + } // namespace TraceSrv } // namespace Kernel diff --git a/src/kernel/amd64-desktop.make b/src/kernel/amd64-desktop.make index 88652718..f30c47df 100644 --- a/src/kernel/amd64-desktop.make +++ b/src/kernel/amd64-desktop.make @@ -5,7 +5,8 @@ CXX = x86_64-w64-mingw32-g++ LD = x86_64-w64-mingw32-ld -CCFLAGS = -fshort-wchar -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__FSKIT_INCLUDES_OPENHEFS__ -D__FSKIT_INCLUDES_EXT2__ -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot +CCFLAGS = -fshort-wchar -D__nekernel_dma_pool_start=0x1000000 -D__nekernel_dma_pool_size=0x1000000 \ + -D__nekernel_halkit_include_processor="<HALKit/AMD64/Processor.h>" -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__FSKIT_INCLUDES_OPENHEFS__ -D__FSKIT_INCLUDES_EXT2__ -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot ASM = nasm diff --git a/src/kernel/src/UserProcessScheduler.cc b/src/kernel/src/UserProcessScheduler.cc index 1d29b9fc..3b9e1a0f 100644 --- a/src/kernel/src/UserProcessScheduler.cc +++ b/src/kernel/src/UserProcessScheduler.cc @@ -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/nekernel-org/nekernel @@ -12,7 +12,7 @@ #include <NeKit/Utils.h> #include <SignalKit/Signals.h> -///! BUGS: 0 +///! BUG COUNT: 0 namespace Kernel { UserProcess::UserProcess() = default; diff --git a/src/launch/src/AppMain.cc b/src/launch/src/AppMain.cc index b37747be..dc3390ef 100644 --- a/src/launch/src/AppMain.cc +++ b/src/launch/src/AppMain.cc @@ -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/nekernel-org/nekernel @@ -10,12 +10,12 @@ IMPORT_C SInt32 nelaunch_startup_fn(Void) { /// Start LaunchHelpers.fwrk services, and make the launcher manageable too (via mgmt.launch) UInt32* ret = static_cast<UInt32*>( - libsys_syscall_arg_1(libsys_hash_64("__launch_register_launch_service"))); + libsys_syscall_arg_1(libsys_hash_64("__launch_register_service"))); if (ret) { switch (*ret) { case kErrorSuccess: { - libsys_syscall_arg_1(libsys_hash_64("__launch_listen_as_root")); + libsys_syscall_arg_1(libsys_hash_64("__launch_listen_as_super")); return *ret; } default: diff --git a/src/libDDK/DriverKit/ddk.h b/src/libDDK/DriverKit/ddk.h index eeb5e91e..fa6a90ed 100644 --- a/src/libDDK/DriverKit/ddk.h +++ b/src/libDDK/DriverKit/ddk.h @@ -27,6 +27,11 @@ struct DDK_STATUS_STRUCT DDK_FINAL { typedef void* ptr_t; +typedef ptr_t addr_t; + +typedef ptr_t vaddr_t; +typedef ptr_t paddr_t; + /// @brief Call Kernel procedure. /// @param name the procedure name. /// @param cnt number of elements in **dat** diff --git a/src/libSystem/SystemKit/System.h b/src/libSystem/SystemKit/System.h index a8cf05f2..2360b611 100644 --- a/src/libSystem/SystemKit/System.h +++ b/src/libSystem/SystemKit/System.h @@ -2,14 +2,18 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel -#ifndef LIBSYS_SYSTEM_CALLS_H -#define LIBSYS_SYSTEM_CALLS_H +#ifndef SYSTEMKIT_SYSTEM_H +#define SYSTEMKIT_SYSTEM_H #include <libSystem/SystemKit/Macros.h> /// @brief TTY device path. -#define kPrintDevicePath "/devices/tty{}" -#define kCDDevicePath "/devices/dvd{}" +#define kPrintDevicePath "/devices/tty{}{}" + +/// @brief Secure TTY device path. +#define kSecurePrintDevicePath "/devices/stty{}{}" + +#define kCDDevicePath "/devices/dvd{}{}" // ------------------------------------------------------------------------------------------ // /// @brief Types API. @@ -383,4 +387,4 @@ IMPORT_C Char* StrFmt(const Char* fmt, ...); IMPORT_C UInt64 StrMathToNumber(const Char* in, const Char** endp, const SInt16 base); -#endif // ifndef LIBSYS_SYSTEM_CALLS_H +#endif // ifndef SYSTEMKIT_SYSTEM_H diff --git a/src/modules/MBCI/MBCI.h b/src/modules/MBCI/MBCI.h index daf1f02d..770d8312 100644 --- a/src/modules/MBCI/MBCI.h +++ b/src/modules/MBCI/MBCI.h @@ -97,7 +97,7 @@ typedef UInt32 MBCIAuthKeyType; /// @internal inline BOOL busi_test_mmio(_Input struct IMBCIHost* host, _Input const UInt32 test) { host->MMIOTest = test; - UInt16 timeout = 0UL; + UInt16 timeout{0UL}; while (host->MMIOTest == test) { ++timeout; |
