From 77a1bd038f4288a7c24cfe52ad9824ca947c6671 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Mar 2025 05:08:21 +0100 Subject: kernel(feat): Add basic wide system bug check (memory check), other changes have been made too, see commit details for more information. Signed-off-by: Amlal El Mahrouss --- dev/SCIKit/CompilerHint.h | 12 - dev/SCIKit/LPC.h | 2 +- dev/SCIKit/Macros.h | 20 +- dev/SCIKit/SCI.h | 339 -------------------- dev/SCIKit/SystemCalls.h | 341 +++++++++++++++++++++ dev/SCIKit/src/SCI.cc | 2 +- dev/boot/amd64-desktop.make | 2 +- dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | 2 +- dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc | 7 - dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 2 +- dev/kernel/HALKit/ARM64/APM/APM+IO.cc | 2 +- dev/kernel/HALKit/ARM64/MBCI/MBCI.cc | 7 - dev/kernel/HALKit/ARM64/ReadMe.md | 2 +- dev/kernel/HALKit/POWER/ReadMe.md | 2 +- dev/kernel/HALKit/RISCV/ReadMe.md | 2 +- dev/kernel/KernelKit/DriveMgr.h | 2 +- dev/kernel/KernelKit/FileMgr.h | 2 +- dev/kernel/KernelKit/KPC.h | 67 ++++ dev/kernel/KernelKit/LPC.h | 70 ----- dev/kernel/KernelKit/MemoryMgr.h | 2 +- dev/kernel/KernelKit/Timer.h | 2 +- dev/kernel/KernelKit/User.h | 2 +- dev/kernel/NewKit/Defines.h | 2 +- dev/kernel/src/CxxAbi-AMD64.cc | 2 +- dev/kernel/src/CxxAbi-ARM64.cc | 2 +- dev/kernel/src/FS/HeFS.cc | 2 +- dev/kernel/src/FS/NeFS.cc | 2 +- dev/kernel/src/KPC.cc | 45 +++ dev/kernel/src/LPC.cc | 34 -- dev/kernel/src/MemoryMgr.cc | 6 +- dev/kernel/src/Network/IPCAddr.cc | 2 +- dev/kernel/src/Network/IPCMsg.cc | 2 +- dev/kernel/src/User.cc | 2 +- dev/kernel/src/UserProcessScheduler.cc | 2 +- dev/modules/CoreGfx/AccessibilityMgr.h | 2 +- dev/modules/ReadMe.md | 1 - 36 files changed, 490 insertions(+), 507 deletions(-) delete mode 100644 dev/SCIKit/CompilerHint.h delete mode 100644 dev/SCIKit/SCI.h create mode 100644 dev/SCIKit/SystemCalls.h delete mode 100644 dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc delete mode 100644 dev/kernel/HALKit/ARM64/MBCI/MBCI.cc create mode 100644 dev/kernel/KernelKit/KPC.h delete mode 100644 dev/kernel/KernelKit/LPC.h create mode 100644 dev/kernel/src/KPC.cc delete mode 100644 dev/kernel/src/LPC.cc (limited to 'dev') diff --git a/dev/SCIKit/CompilerHint.h b/dev/SCIKit/CompilerHint.h deleted file mode 100644 index a78e59bf..00000000 --- a/dev/SCIKit/CompilerHint.h +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef SCI_HINT_H -#define SCI_HINT_H - -#include - -#endif // ifndef SCI_HINT_H diff --git a/dev/SCIKit/LPC.h b/dev/SCIKit/LPC.h index 044d272e..b0bb2d83 100644 --- a/dev/SCIKit/LPC.h +++ b/dev/SCIKit/LPC.h @@ -9,7 +9,7 @@ #include /// @file LPC.h -/// @brief Local Process Code type and values. +/// @brief Local Procedure Code type and values. #define err_local_ok() (kLastError == kErrorSuccess) #define err_local_fail() (kLastError != kErrorSuccess) diff --git a/dev/SCIKit/Macros.h b/dev/SCIKit/Macros.h index c7bd61e8..174d644a 100644 --- a/dev/SCIKit/Macros.h +++ b/dev/SCIKit/Macros.h @@ -11,10 +11,10 @@ Purpose: libsci Macros header. /***********************************************************************************/ /// @file SCIKit/Macros.h -/// @brief Macros and core types. +/// @brief Macros and Core types. /***********************************************************************************/ -#include +#include #define ATTRIBUTE(X) __attribute__((X)) @@ -23,10 +23,10 @@ Purpose: libsci Macros header. #define DEPRECATED ATTRIBUTE(deprecated) -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 +#define EXIT_SUCCESS (0) +#define EXIT_FAILURE (1) -#define FILE_MAX_LEN 256 +#define FILE_MAX_LEN (256) #ifndef BOOL #define BOOL bool @@ -37,8 +37,8 @@ typedef bool Boolean; typedef void Void; #ifndef __cplusplus -#define true 1 -#define false 0 +#define true (1) +#define false (0) #endif #define YES true @@ -87,7 +87,7 @@ IMPORT_C void _rtl_assert(Bool expr, const Char* origin); #define MUST_PASS(X) _rtl_assert(X, __FILE__) #ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) \ - (((sizeof(a) / sizeof(*(a))) / \ - (static_cast(!(sizeof(a) % sizeof(*(a))))))) +#define ARRAY_SIZE(X) \ + (((sizeof(X) / sizeof(*(X))) / \ + (static_cast(!(sizeof(X) % sizeof(*(X))))))) #endif \ No newline at end of file diff --git a/dev/SCIKit/SCI.h b/dev/SCIKit/SCI.h deleted file mode 100644 index 3e769262..00000000 --- a/dev/SCIKit/SCI.h +++ /dev/null @@ -1,339 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: SCI.h -Purpose: System Call Interface. - -------------------------------------------- */ - -#ifndef SCI_SCI_H -#define SCI_SCI_H - -#include - -// ------------------------------------------------------------------------------------------ // -/// @brief Types API. -// ------------------------------------------------------------------------------------------ // - -typedef VoidPtr SCIObject; - -typedef SCIObject IOObject; -typedef IOObject FSObject; -typedef SCIObject DLLObject; -typedef SCIObject ThreadObject; -typedef SCIObject SocketObject; - -// ------------------------------------------------------------------------------------------ // -/// @brief Dynamic Loader API. -// ------------------------------------------------------------------------------------------ // - -/// @brief Get function which is part of the DLL. -/// @param symbol the symbol to look for -/// @param dll_handle the DLL handle. -/// @return the proc pointer. -IMPORT_C SCIObject LdrGetDLLSymbolFromHandle(_Input const Char* symbol, _Input SCIObject dll_handle); - -/// @brief Open DLL handle. -/// @param path -/// @param drv -/// @return -IMPORT_C SCIObject LdrOpenDLLHandle(_Input const Char* path, _Input const Char* drive_letter); - -/// @brief Close DLL handle -/// @param dll_handle -/// @return -IMPORT_C Void LdrCloseDLLHandle(_Input SCIObject* dll_handle); - -// ------------------------------------------------------------------------------------------ // -// File API. -// ------------------------------------------------------------------------------------------ // - -/// @brief Opens a file from a drive. -/// @param fs_path the filesystem path. -/// @param drive_letter drive name, use NULL to use default drive location. -/// @return the file descriptor of the file. -IMPORT_C SCIObject IoOpenFile(const Char* fs_path, const Char* drive_letter); - -/// @brief Closes a file and flushes its content. -/// @param file_desc the file descriptor. -/// @return Function doesn't return a type. -IMPORT_C Void IoCloseFile(_Input SCIObject file_desc); - -/// @brief Write data to a file. -/// @param file_desc the file descriptor. -/// @param out_data the data to write. -/// @param sz_data the size of the data to write. -/// @return the number of bytes written. -IMPORT_C UInt32 IoWriteFile(_Input SCIObject file_desc, _Output VoidPtr out_data, SizeT sz_data); - -/// @brief Read data from a file. -/// @param file_desc the file descriptor. -/// @param out_data the data to read. -/// @param sz_data the size of the data to read. -IMPORT_C UInt32 IoReadFile(_Input SCIObject file_desc, _Output VoidPtr* out_data, SizeT sz_data); - -/// @brief Rewind the file pointer to the beginning of the file. -/// @param file_desc the file descriptor. -/// @return the number of bytes read. -IMPORT_C UInt64 IoRewindFile(_Input SCIObject file_desc); - -/// @brief Tell the current position of the file pointer. -/// @param file_desc the file descriptor. -/// @return the current position of the file pointer. -IMPORT_C UInt64 IoTellFile(_Input SCIObject file_desc); - -/// @brief Seek file offset from file descriptor. -IMPORT_C UInt64 IoSeekFile(_Input SCIObject file_desc, UInt64 file_offset); - -// ------------------------------------------------------------------------ -// Process API. -// ------------------------------------------------------------------------ - -/// @brief Spawns a Thread Information Block and Global Information Block inside the current process. -/// @param process_id Target Process ID, must be valid. -/// @return > 0 error ocurred or already present, = 0 success. -IMPORT_C UInt32 RtlSpawnIB(UIntPtr process_id); - -/// @brief Spawns a process with a unique pid (stored as UIntPtr). -/// @param process_path process filesystem path. -/// @return > 0 process was created. -IMPORT_C UIntPtr RtlSpawnProcess(const Char* process_path, SizeT argc, Char** argv, Char** envp, SizeT envp_len); - -/// @brief Exits a process with an exit_code. -/// @return if it has succeeded true, otherwise false. -IMPORT_C Bool RtlExitProcess(UIntPtr handle, UIntPtr exit_code); - -/// @brief Get current PID of process. -/// @return Current process ID. -IMPORT_C UIntPtr RtlCurrentPID(Void); - -// ------------------------------------------------------------------------ -// Memory Manager API. -// ------------------------------------------------------------------------ - -/// @brief Creates a new heap from the process's address space. -/// @param len the length of it. -/// @param flags the flags of it. -/// @return heap pointer. -IMPORT_C VoidPtr MmCreateHeap(_Input SizeT len, _Input UInt32 flags); - -/// @brief Destroys the pointer -/// @param heap the heap itself. -/// @return void. -IMPORT_C Void MmDestroyHeap(_Input VoidPtr heap); - -/// @brief Change protection flags of a memory region. -IMPORT_C Void MmSetHeapFlags(_Input VoidPtr heap, _Input UInt32 flags); - -/// @brief Change protection flags of a memory region. -IMPORT_C UInt32 MmGetHeapFlags(_Input VoidPtr heap); - -/// @brief Fill memory region with CRC32. -IMPORT_C UInt32 MmFillCRC32Heap(_Input VoidPtr heap); - -/// @brief Copy memory region. -IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); - -/// @brief Compare memory regions. -IMPORT_C SInt64 MmCmpMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); - -/// @brief Fill memory region. -IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value); - -/// @brief Compare string regions. -IMPORT_C SInt64 MmStrCmp(_Input const Char* dest, _Input const Char* src); - -/// @brief Get length of string. -IMPORT_C SInt64 MmStrLen(const Char* str); - -// ------------------------------------------------------------------------ -// @brief Error API. -// ------------------------------------------------------------------------ - -IMPORT_C SInt32 ErrGetLastError(Void); - -// ------------------------------------------------------------------------ -// @brief Threading API. -// ------------------------------------------------------------------------ - -/// @brief Exit the current thread. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitCurrentThread(_Input SInt32 exit_code); - -/// @brief Exit the main thread. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitMainThread(_Input SInt32 exit_code); - -/// @brief Exit a thread. -/// @param thread the thread to exit. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitThread(_Input ThreadObject thread, _Input SInt32 exit_code); - -/// @brief Thread procedure function type. -typedef Void (*thread_proc_kind)(int argc, char** argv); - -/// @brief Creates a thread. -/// @param procedure the thread procedure. -/// @param argument_count number of arguments inside that thread. -/// @param flags Thread flags. -/// @return the thread object. -IMPORT_C ThreadObject ThrCreateThread(thread_proc_kind procedure, SInt32 argument_count, SInt32 flags); - -/// @brief Yields the current thread. -/// @param thread the thread to yield. -IMPORT_C Void ThrYieldThread(ThreadObject thrd); - -/// @brief Joins a thread. -/// @param thread the thread to join. -IMPORT_C Void ThrJoinThread(ThreadObject thrd); - -/// @brief Detach a thread. -/// @param thread the thread to detach. -IMPORT_C Void ThrDetachThread(ThreadObject thrd); - -// ------------------------------------------------------------------------ -// @brief Drive Management API. -// ------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------ // -/// @brief Get the default drive letter. -/// @param void. -/// @return the drive letter. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Char* DrvGetDefaultDriveLetter(Void); - -// ------------------------------------------------------------------------------------------ // -/// @brief Get the drive letter from a path. -/// @param path the path. -/// @return the drive letter. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Char* DrvGetDriveLetterFromPath(_Input const Char* path); - -// ------------------------------------------------------------------------------------------ // -/// @brief Get a mounted drive from a letter. -/// @param letter the letter (A..Z). -/// @return the drive object. -// ------------------------------------------------------------------------------------------ // -IMPORT_C SCIObject DrvGetMountedDrive(_Input const Char letter); - -// ------------------------------------------------------------------------------------------ // -/// @brief Mount a drive. -/// @param path the path to mount. -/// @param letter the letter to mount. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Void DrvMountDrive(_Input const Char* path, _Input const Char* letter); - -// ------------------------------------------------------------------------------------------ // -/// @brief Unmount a drive. -/// @param letter the letter to unmount. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Void DrvUnmountDrive(_Input const Char letter); - -// ------------------------------------------------------------------------ -// Event handling API, use to listen to OS specific events. -// ------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------ // -/// @brief Add an event listener. -/// @param event_name the event name. -/// @param listener the listener to add. -/// @return the event listener. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Void EvtAddListener(_Input const Char* event_name, _Input SCIObject listener); - -// ------------------------------------------------------------------------------------------ // -/// @brief Remove an event listener. -/// @param event_name the event name. -/// @param listener the listener to remove. -/// @return the event listener. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Void EvtRemoveListener(_Input const Char* event_name, _Input SCIObject listener); - -// ------------------------------------------------------------------------------------------ // -/// @brief Dispatch an event. -/// @param event_name the event name. -/// @param event_data the event data. -/// @return the event data. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr event_data); - -// ------------------------------------------------------------------------------------------ // -// Power API. -// ------------------------------------------------------------------------------------------ // - -enum -{ - kPowerCodeShutdown, - kPowerCodeReboot, - kPowerCodeSleep, - kPowerCodeWake, - kPowerCodeCount, -}; - -IMPORT_C SInt32 PwrReadCode(_Output SInt32& code); - -IMPORT_C SInt32 PwrSendCode(_Output SInt32& code); - -// ------------------------------------------------------------------------------------------ // -// CD-ROM API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 CdEjectDrive(_Input const Char drv_letter); - -IMPORT_C SInt32 CdOpenTray(Void); - -IMPORT_C SInt32 CdCloseTray(Void); - -// ------------------------------------------------------------------------------------------ // -// Printer API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 PrintOut(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); - -IMPORT_C SInt32 PrintIn(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); - -IMPORT_C IOObject PrintCreate(Void); - -IMPORT_C SInt32 PrintRelease(IOObject); - -IMPORT_C IOObject PrintGet(const Char* path); - -// ------------------------------------------------------------------------------------------ // -// @brief Scheduler/Debug API. -// ------------------------------------------------------------------------------------------ // - -typedef SInt32 AffinityKind; -typedef UInt64 PID; - -IMPORT_C SInt32 SchedAffinity(PID, SInt32 req, AffinityKind* local); - -IMPORT_C SInt32 SchedTrace(PID, SInt32 req, VoidPtr address, VoidPtr data); - -IMPORT_C SInt32 SchedKill(PID, SInt32 req); - -IMPORT_C SInt32 SchedBreakPoint(Void); - -// ------------------------------------------------------------------------------------------ // -// @brief Filesystem API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C BOOL FsCopy(const char* path, const char* dst); -IMPORT_C BOOL FsMove(const char* path, const char* dst); - -IMPORT_C BOOL FsExists(const char* path); - -IMPORT_C BOOL FsCreateDir(const char* path); -IMPORT_C BOOL FsCreateFile(const char* path); -IMPORT_C BOOL FsCreateAlias(const char* path, const char* from); - -// ------------------------------------------------------------------------------------------ // -// @brief Format API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Char* StrFmt(const Char* fmt, ...); - -#endif // ifndef SCI_SCI_H diff --git a/dev/SCIKit/SystemCalls.h b/dev/SCIKit/SystemCalls.h new file mode 100644 index 00000000..7615a2d1 --- /dev/null +++ b/dev/SCIKit/SystemCalls.h @@ -0,0 +1,341 @@ +/* ------------------------------------------- + +Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +File: SystemCalls.h +Purpose: System Call Interface. + +------------------------------------------- */ + +#ifndef SCI_SCI_H +#define SCI_SCI_H + +#include + +// ------------------------------------------------------------------------------------------ // +/// @brief Types API. +// ------------------------------------------------------------------------------------------ // + +typedef VoidPtr SCIObject; + +typedef SCIObject IOObject; +typedef IOObject FSObject; +typedef SCIObject DLLObject; +typedef SCIObject ThreadObject; +typedef SCIObject SocketObject; + +// ------------------------------------------------------------------------------------------ // +/// @brief Dynamic Loader API. +// ------------------------------------------------------------------------------------------ // + +/// @brief Get function which is part of the DLL. +/// @param symbol the symbol to look for +/// @param dll_handle the DLL handle. +/// @return the proc pointer. +IMPORT_C SCIObject LdrGetDLLSymbolFromHandle(_Input const Char* symbol, _Input SCIObject dll_handle); + +/// @brief Open DLL handle. +/// @param path +/// @param drv +/// @return +IMPORT_C SCIObject LdrOpenDLLHandle(_Input const Char* path, _Input const Char* drive_letter); + +/// @brief Close DLL handle +/// @param dll_handle +/// @return +IMPORT_C Void LdrCloseDLLHandle(_Input SCIObject* dll_handle); + +// ------------------------------------------------------------------------------------------ // +// File API. +// ------------------------------------------------------------------------------------------ // + +/// @brief Opens a file from a drive. +/// @param fs_path the filesystem path. +/// @param drive_letter drive name, use NULL to use default drive location. +/// @return the file descriptor of the file. +IMPORT_C SCIObject IoOpenFile(const Char* fs_path, const Char* drive_letter); + +/// @brief Closes a file and flushes its content. +/// @param file_desc the file descriptor. +/// @return Function doesn't return a type. +IMPORT_C Void IoCloseFile(_Input SCIObject file_desc); + +/// @brief Write data to a file. +/// @param file_desc the file descriptor. +/// @param out_data the data to write. +/// @param sz_data the size of the data to write. +/// @return the number of bytes written. +IMPORT_C UInt32 IoWriteFile(_Input SCIObject file_desc, _Output VoidPtr out_data, SizeT sz_data); + +/// @brief Read data from a file. +/// @param file_desc the file descriptor. +/// @param out_data the data to read. +/// @param sz_data the size of the data to read. +IMPORT_C UInt32 IoReadFile(_Input SCIObject file_desc, _Output VoidPtr* out_data, SizeT sz_data); + +/// @brief Rewind the file pointer to the beginning of the file. +/// @param file_desc the file descriptor. +/// @return the number of bytes read. +IMPORT_C UInt64 IoRewindFile(_Input SCIObject file_desc); + +/// @brief Tell the current position of the file pointer. +/// @param file_desc the file descriptor. +/// @return the current position of the file pointer. +IMPORT_C UInt64 IoTellFile(_Input SCIObject file_desc); + +/// @brief Seek file offset from file descriptor. +IMPORT_C UInt64 IoSeekFile(_Input SCIObject file_desc, UInt64 file_offset); + +// ------------------------------------------------------------------------ +// Process API. +// ------------------------------------------------------------------------ + +/// @brief Spawns a Thread Information Block and Global Information Block inside the current process. +/// @param process_id Target Process ID, must be valid. +/// @return > 0 error ocurred or already present, = 0 success. +IMPORT_C UInt32 RtlSpawnIB(UIntPtr process_id); + +/// @brief Spawns a process with a unique pid (stored as UIntPtr). +/// @param process_path process filesystem path. +/// @return > 0 process was created. +IMPORT_C UIntPtr RtlSpawnProcess(const Char* process_path, SizeT argc, Char** argv, Char** envp, SizeT envp_len); + +/// @brief Exits a process with an exit_code. +/// @return if it has succeeded true, otherwise false. +IMPORT_C Bool RtlExitProcess(UIntPtr handle, UIntPtr exit_code); + +/// @brief Get current PID of process. +/// @return Current process ID. +IMPORT_C UIntPtr RtlCurrentPID(Void); + +// ------------------------------------------------------------------------ +// Memory Manager API. +// ------------------------------------------------------------------------ + +/// @brief Creates a new heap from the process's address space. +/// @param len the length of it. +/// @param flags the flags of it. +/// @return heap pointer. +IMPORT_C VoidPtr MmCreateHeap(_Input SizeT len, _Input UInt32 flags); + +/// @brief Destroys the pointer +/// @param heap the heap itself. +/// @return void. +IMPORT_C Void MmDestroyHeap(_Input VoidPtr heap); + +/// @brief Change protection flags of a memory region. +IMPORT_C Void MmSetHeapFlags(_Input VoidPtr heap, _Input UInt32 flags); + +/// @brief Change protection flags of a memory region. +IMPORT_C UInt32 MmGetHeapFlags(_Input VoidPtr heap); + +/// @brief Fill memory region with CRC32. +IMPORT_C UInt32 MmFillCRC32Heap(_Input VoidPtr heap); + +/// @brief Copy memory region. +IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); + +/// @brief Compare memory regions. +IMPORT_C SInt64 MmCmpMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); + +/// @brief Fill memory region. +IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value); + +/// @brief Compare string regions. +IMPORT_C SInt64 MmStrCmp(_Input const Char* dest, _Input const Char* src); + +/// @brief Get length of string. +IMPORT_C SInt64 MmStrLen(const Char* str); + +// ------------------------------------------------------------------------ +// @brief Error API. +// ------------------------------------------------------------------------ + +IMPORT_C SInt32 ErrGetLastError(Void); + +// ------------------------------------------------------------------------ +// @brief Threading API. +// ------------------------------------------------------------------------ + +/// @brief Exit the current thread. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitCurrentThread(_Input SInt32 exit_code); + +/// @brief Exit the main thread. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitMainThread(_Input SInt32 exit_code); + +/// @brief Exit a thread. +/// @param thread the thread to exit. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitThread(_Input ThreadObject thread, _Input SInt32 exit_code); + +/// @brief Thread procedure function type. +typedef Void (*thread_proc_kind)(int argc, char** argv); + +/// @brief Creates a thread. +/// @param procedure the thread procedure. +/// @param argument_count number of arguments inside that thread. +/// @param flags Thread flags. +/// @return the thread object. +IMPORT_C ThreadObject ThrCreateThread(thread_proc_kind procedure, SInt32 argument_count, SInt32 flags); + +/// @brief Yields the current thread. +/// @param thread the thread to yield. +IMPORT_C Void ThrYieldThread(ThreadObject thrd); + +/// @brief Joins a thread. +/// @param thread the thread to join. +IMPORT_C Void ThrJoinThread(ThreadObject thrd); + +/// @brief Detach a thread. +/// @param thread the thread to detach. +IMPORT_C Void ThrDetachThread(ThreadObject thrd); + +// ------------------------------------------------------------------------ +// @brief Drive Management API. +// ------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------ // +/// @brief Get the default drive letter. +/// @param void. +/// @return the drive letter. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Char* DrvGetDefaultDriveLetter(Void); + +// ------------------------------------------------------------------------------------------ // +/// @brief Get the drive letter from a path. +/// @param path the path. +/// @return the drive letter. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Char* DrvGetDriveLetterFromPath(_Input const Char* path); + +// ------------------------------------------------------------------------------------------ // +/// @brief Get a mounted drive from a letter. +/// @param letter the letter (A..Z). +/// @return the drive object. +// ------------------------------------------------------------------------------------------ // +IMPORT_C SCIObject DrvGetMountedDrive(_Input const Char letter); + +// ------------------------------------------------------------------------------------------ // +/// @brief Mount a drive. +/// @param path the path to mount. +/// @param letter the letter to mount. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Void DrvMountDrive(_Input const Char* path, _Input const Char* letter); + +// ------------------------------------------------------------------------------------------ // +/// @brief Unmount a drive. +/// @param letter the letter to unmount. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Void DrvUnmountDrive(_Input const Char letter); + +// ------------------------------------------------------------------------ +// Event handling API, use to listen to OS specific events. +// ------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------ // +/// @brief Add an event listener. +/// @param event_name the event name. +/// @param listener the listener to add. +/// @return the event listener. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Void EvtAddListener(_Input const Char* event_name, _Input SCIObject listener); + +// ------------------------------------------------------------------------------------------ // +/// @brief Remove an event listener. +/// @param event_name the event name. +/// @param listener the listener to remove. +/// @return the event listener. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Void EvtRemoveListener(_Input const Char* event_name, _Input SCIObject listener); + +// ------------------------------------------------------------------------------------------ // +/// @brief Dispatch an event. +/// @param event_name the event name. +/// @param event_data the event data. +/// @return the event data. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr event_data); + +// ------------------------------------------------------------------------------------------ // +// Power API. +// ------------------------------------------------------------------------------------------ // + +enum +{ + kPowerCodeShutdown, + kPowerCodeReboot, + kPowerCodeSleep, + kPowerCodeWake, + kPowerCodeCount, +}; + +IMPORT_C SInt32 PwrReadCode(_Output SInt32& code); + +IMPORT_C SInt32 PwrSendCode(_Output SInt32& code); + +// ------------------------------------------------------------------------------------------ // +// CD-ROM API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C SInt32 CdEjectDrive(_Input const Char drv_letter); + +IMPORT_C SInt32 CdOpenTray(Void); + +IMPORT_C SInt32 CdCloseTray(Void); + +// ------------------------------------------------------------------------------------------ // +// Printer API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C SInt32 PrintOut(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); + +IMPORT_C SInt32 PrintIn(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); + +IMPORT_C IOObject PrintCreate(Void); + +IMPORT_C SInt32 PrintRelease(IOObject); + +IMPORT_C IOObject PrintGet(const Char* path); + +// ------------------------------------------------------------------------------------------ // +// @brief Scheduler/Debug API. +// ------------------------------------------------------------------------------------------ // + +typedef SInt32 AffinityKind; +typedef UInt64 PID; + +IMPORT_C SInt32 SchedAffinity(PID, SInt32 req, AffinityKind* local); + +IMPORT_C SInt32 SchedTrace(PID, SInt32 req, VoidPtr address, VoidPtr data); + +IMPORT_C SInt32 SchedKill(PID, SInt32 req); + +IMPORT_C SInt32 SchedBreakPoint(Void); + +// ------------------------------------------------------------------------------------------ // +// @brief Filesystem API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C BOOL FsCopy(const char* path, const char* dst); +IMPORT_C BOOL FsMove(const char* path, const char* dst); + +IMPORT_C BOOL FsExists(const char* path); + +IMPORT_C BOOL FsCreateDir(const char* path); +IMPORT_C BOOL FsCreateFile(const char* path); +IMPORT_C BOOL FsCreateAlias(const char* path, const char* from); + +// ------------------------------------------------------------------------------------------ // +// @brief Format API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Char* StrFmt(const Char* fmt, ...); + +IMPORT_C UInt64 MathToNumber(const Char* in, const Char** endp, const SInt16 base); + +#endif // ifndef SCI_SCI_H diff --git a/dev/SCIKit/src/SCI.cc b/dev/SCIKit/src/SCI.cc index 3427ae4e..6556754d 100644 --- a/dev/SCIKit/src/SCI.cc +++ b/dev/SCIKit/src/SCI.cc @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include +#include /// @file libsci.cc /// @brief Source file for the memory functions of the libsci. diff --git a/dev/boot/amd64-desktop.make b/dev/boot/amd64-desktop.make index 212a61dc..22023923 100644 --- a/dev/boot/amd64-desktop.make +++ b/dev/boot/amd64-desktop.make @@ -28,7 +28,7 @@ BIOS=OVMF.fd IMG=epm-master-1.img IMG_2=epm-master-2.img -BOOT=./src/neos.img +BOOT=./src/neos_esp.img DISK_DRV = diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc index da680afa..5880cc7c 100644 --- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -30,7 +30,7 @@ /////////////////////////////////////////////////////////////////////////////////////// -//! NOTE: fGSI stands 'Field Global System Interrupt' +/// @brief The **HAL** namespace. /////////////////////////////////////////////////////////////////////////////////////// diff --git a/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc b/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc deleted file mode 100644 index 09632bc9..00000000 --- a/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 002266de..0180288c 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include diff --git a/dev/kernel/HALKit/ARM64/APM/APM+IO.cc b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc index 752f29f9..5fb45452 100644 --- a/dev/kernel/HALKit/ARM64/APM/APM+IO.cc +++ b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include using namespace NeOS; diff --git a/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc b/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc deleted file mode 100644 index d2df66e6..00000000 --- a/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/ReadMe.md b/dev/kernel/HALKit/ARM64/ReadMe.md index c51229f2..a2807e5c 100644 --- a/dev/kernel/HALKit/ARM64/ReadMe.md +++ b/dev/kernel/HALKit/ARM64/ReadMe.md @@ -1,3 +1,3 @@ # ARM64 Hardware Abstraction Layer -- Supported Firmware: CoreBoot/EDK/OpenMobileBoot +- Supported Firmware: NeKernel CoreBoot/EDK diff --git a/dev/kernel/HALKit/POWER/ReadMe.md b/dev/kernel/HALKit/POWER/ReadMe.md index a9751581..a4919c4a 100644 --- a/dev/kernel/HALKit/POWER/ReadMe.md +++ b/dev/kernel/HALKit/POWER/ReadMe.md @@ -1,4 +1,4 @@ POWER Hardware Abstraction Layer - Supported CPU: POWER -- Supported Firmware: CoreBoot \ No newline at end of file +- Supported Firmware: NeKernel CoreBoot \ No newline at end of file diff --git a/dev/kernel/HALKit/RISCV/ReadMe.md b/dev/kernel/HALKit/RISCV/ReadMe.md index b099aa31..982a2acb 100644 --- a/dev/kernel/HALKit/RISCV/ReadMe.md +++ b/dev/kernel/HALKit/RISCV/ReadMe.md @@ -1,4 +1,4 @@ RISCV64 Hardware Abstraction Layer - Supported CPU: RISCV64 -- Supported Firmware: CoreBoot \ No newline at end of file +- Supported Firmware: NeKernel CoreBoot \ No newline at end of file diff --git a/dev/kernel/KernelKit/DriveMgr.h b/dev/kernel/KernelKit/DriveMgr.h index 87bd2714..fd972ab7 100644 --- a/dev/kernel/KernelKit/DriveMgr.h +++ b/dev/kernel/KernelKit/DriveMgr.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/dev/kernel/KernelKit/FileMgr.h b/dev/kernel/KernelKit/FileMgr.h index 7374df9d..59203998 100644 --- a/dev/kernel/KernelKit/FileMgr.h +++ b/dev/kernel/KernelKit/FileMgr.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h new file mode 100644 index 00000000..9b62c14e --- /dev/null +++ b/dev/kernel/KernelKit/KPC.h @@ -0,0 +1,67 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @file KPC.h +/// @brief Kernel Procedure Code. + +#define err_local_ok() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == NeOS::kErrorSuccess) +#define err_local_fail() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != NeOS::kErrorSuccess) +#define err_local_get() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode()) + +#define err_global_ok() (NeOS::kErrorLocalNumber == NeOS::kErrorSuccess) +#define err_global_fail() (NeOS::kErrorLocalNumber != NeOS::kErrorSuccess) +#define err_global_get() (NeOS::kErrorLocalNumber) + +namespace NeOS +{ + typedef Int32 HError; + + inline HError kErrorLocalNumber = 0UL; + + inline constexpr HError kErrorSuccess = 0; + inline constexpr HError kErrorExecutable = 33; + inline constexpr HError kErrorExecutableLib = 34; + inline constexpr HError kErrorFileNotFound = 35; + inline constexpr HError kErrorDirectoryNotFound = 36; + inline constexpr HError kErrorDiskReadOnly = 37; + inline constexpr HError kErrorDiskIsFull = 38; + inline constexpr HError kErrorProcessFault = 39; + inline constexpr HError kErrorSocketHangUp = 40; + inline constexpr HError kErrorThreadLocalStorage = 41; + inline constexpr HError kErrorMath = 42; + inline constexpr HError kErrorNoNetwork = 43; + inline constexpr HError kErrorHeapOutOfMemory = 44; + inline constexpr HError kErrorNoSuchDisk = 45; + inline constexpr HError kErrorFileExists = 46; + inline constexpr HError kErrorFormatFailed = 47; + inline constexpr HError kErrorNetworkTimeout = 48; + inline constexpr HError kErrorInternal = 49; + inline constexpr HError kErrorForkAlreadyExists = 50; + inline constexpr HError kErrorOutOfTeamSlot = 51; + inline constexpr HError kErrorHeapNotPresent = 52; + inline constexpr HError kErrorNoEntrypoint = 53; + inline constexpr HError kErrorDiskIsCorrupted = 54; + inline constexpr HError kErrorDisk = 55; + inline constexpr HError kErrorInvalidData = 56; + inline constexpr HError kErrorAsync = 57; + inline constexpr HError kErrorNonBlocking = 58; + inline constexpr HError kErrorIPC = 59; + inline constexpr HError kErrorSign = 60; + inline constexpr HError kErrorInvalidCreds = 61; + inline constexpr HError kErrorCDTrayBroken = 62; + inline constexpr HError kErrorUnrecoverableDisk = 63; + inline constexpr HError kErrorFileLocked = 64; + inline constexpr HError kErrorUnimplemented = -1; + + /// @brief Does a system wide bug check. + /// @param void no params are needed. + /// @return if error-free: false, otherwise true. + Boolean err_bug_check_raise(Void) noexcept; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/LPC.h b/dev/kernel/KernelKit/LPC.h deleted file mode 100644 index d76eeff1..00000000 --- a/dev/kernel/KernelKit/LPC.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @file LPC.h -/// @brief Local Process Codes. - -#define err_local_ok() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == NeOS::kErrorSuccess) -#define err_local_fail() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != NeOS::kErrorSuccess) -#define err_local_get() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode()) - -#define err_global_ok() (NeOS::kErrorLocalNumber == NeOS::kErrorSuccess) -#define err_global_fail() (NeOS::kErrorLocalNumber != NeOS::kErrorSuccess) -#define err_global_get() (NeOS::kErrorLocalNumber) - -namespace NeOS -{ - typedef Int32 HError; - - inline HError kErrorLocalNumber = 0UL; - - inline constexpr HError kErrorSuccess = 0; - inline constexpr HError kErrorExecutable = 33; - inline constexpr HError kErrorExecutableLib = 34; - inline constexpr HError kErrorFileNotFound = 35; - inline constexpr HError kErrorDirectoryNotFound = 36; - inline constexpr HError kErrorDiskReadOnly = 37; - inline constexpr HError kErrorDiskIsFull = 38; - inline constexpr HError kErrorProcessFault = 39; - inline constexpr HError kErrorSocketHangUp = 40; - inline constexpr HError kErrorThreadLocalStorage = 41; - inline constexpr HError kErrorMath = 42; - inline constexpr HError kErrorNoNetwork = 43; - inline constexpr HError kErrorHeapOutOfMemory = 44; - inline constexpr HError kErrorNoSuchDisk = 45; - inline constexpr HError kErrorFileExists = 46; - inline constexpr HError kErrorFormatFailed = 47; - inline constexpr HError kErrorNetworkTimeout = 48; - inline constexpr HError kErrorInternal = 49; - inline constexpr HError kErrorForkAlreadyExists = 50; - inline constexpr HError kErrorOutOfTeamSlot = 51; - inline constexpr HError kErrorHeapNotPresent = 52; - inline constexpr HError kErrorNoEntrypoint = 53; - inline constexpr HError kErrorDiskIsCorrupted = 54; - inline constexpr HError kErrorDisk = 55; - inline constexpr HError kErrorInvalidData = 56; - inline constexpr HError kErrorAsync = 57; - inline constexpr HError kErrorNonBlocking = 58; - inline constexpr HError kErrorIPC = 59; - inline constexpr HError kErrorSign = 60; - inline constexpr HError kErrorInvalidCreds = 61; - inline constexpr HError kErrorCDTrayBroken = 62; - inline constexpr HError kErrorUnrecoverableDisk = 63; - inline constexpr HError kErrorFileLocked = 64; - inline constexpr HError kErrorUnimplemented = -1; - - /// @brief Raises a bug check stop code. - Void err_bug_check_raise(Void) noexcept; - - /// @brief Does a system wide bug check. - /// @param void no params are needed. - /// @return if error-free: false, otherwise true. - Boolean err_bug_check(Void) noexcept; -} // namespace NeOS diff --git a/dev/kernel/KernelKit/MemoryMgr.h b/dev/kernel/KernelKit/MemoryMgr.h index 93718493..139ae7aa 100644 --- a/dev/kernel/KernelKit/MemoryMgr.h +++ b/dev/kernel/KernelKit/MemoryMgr.h @@ -12,7 +12,7 @@ /// @brief: heap allocation support. #include -#include +#include #include namespace NeOS diff --git a/dev/kernel/KernelKit/Timer.h b/dev/kernel/KernelKit/Timer.h index abca5352..e52f91e7 100644 --- a/dev/kernel/KernelKit/Timer.h +++ b/dev/kernel/KernelKit/Timer.h @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace NeOS { diff --git a/dev/kernel/KernelKit/User.h b/dev/kernel/KernelKit/User.h index 9ab2b02e..620b9bc9 100644 --- a/dev/kernel/KernelKit/User.h +++ b/dev/kernel/KernelKit/User.h @@ -16,7 +16,7 @@ ------------------------------------------- */ #include -#include +#include #include #include diff --git a/dev/kernel/NewKit/Defines.h b/dev/kernel/NewKit/Defines.h index 0b0b97e5..7758c053 100644 --- a/dev/kernel/NewKit/Defines.h +++ b/dev/kernel/NewKit/Defines.h @@ -27,7 +27,7 @@ #endif #endif -/// @brief The **Kernel** namespace where it's API resides. +/// @brief The **Kernel** namespace. namespace NeOS { using voidPtr = void*; diff --git a/dev/kernel/src/CxxAbi-AMD64.cc b/dev/kernel/src/CxxAbi-AMD64.cc index f0e57077..555c613f 100644 --- a/dev/kernel/src/CxxAbi-AMD64.cc +++ b/dev/kernel/src/CxxAbi-AMD64.cc @@ -8,7 +8,7 @@ #include #include -#include +#include atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; diff --git a/dev/kernel/src/CxxAbi-ARM64.cc b/dev/kernel/src/CxxAbi-ARM64.cc index b52be160..a24dfce3 100644 --- a/dev/kernel/src/CxxAbi-ARM64.cc +++ b/dev/kernel/src/CxxAbi-ARM64.cc @@ -8,7 +8,7 @@ #include #include -#include +#include atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; diff --git a/dev/kernel/src/FS/HeFS.cc b/dev/kernel/src/FS/HeFS.cc index 7615ed77..b6f1bede 100644 --- a/dev/kernel/src/FS/HeFS.cc +++ b/dev/kernel/src/FS/HeFS.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/dev/kernel/src/FS/NeFS.cc b/dev/kernel/src/FS/NeFS.cc index 00824122..5878067f 100644 --- a/dev/kernel/src/FS/NeFS.cc +++ b/dev/kernel/src/FS/NeFS.cc @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/dev/kernel/src/KPC.cc b/dev/kernel/src/KPC.cc new file mode 100644 index 00000000..7081bf51 --- /dev/null +++ b/dev/kernel/src/KPC.cc @@ -0,0 +1,45 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + STATIC Bool kRaiseOnBugCheck = false; + + /// @brief Does a system wide bug check. + /// @param void no params are needed. + /// @return if error-free: false, otherwise true. + Boolean err_bug_check_raise(Void) noexcept + { + Char* ptr = new Char[512]; + + if (ptr == nullptr) + goto bug_check_fail; + + if (!mm_is_valid_heap(ptr)) + goto bug_check_fail; + + delete[] ptr; + + return Yes; + + bug_check_fail: + if (ptr) + delete[] ptr; + + ptr = nullptr; + + if (kRaiseOnBugCheck) + { + ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR); + } + + return No; + } +} // namespace NeOS diff --git a/dev/kernel/src/LPC.cc b/dev/kernel/src/LPC.cc deleted file mode 100644 index b6b2e11b..00000000 --- a/dev/kernel/src/LPC.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - STATIC Bool kRaiseOnBugCheck = false; - - /// @brief Does a system wide bug check. - /// @param void no params. - /// @return if error-free: false, otherwise true. - Boolean err_bug_check(void) noexcept - { - if (kRaiseOnBugCheck) - { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR); - } - - return No; - } - - /// @brief Tells if we should raise a bug check not. - /// @param void - /// @return void - Void err_bug_check_raise(Void) noexcept - { - kRaiseOnBugCheck = true; - } -} // namespace NeOS diff --git a/dev/kernel/src/MemoryMgr.cc b/dev/kernel/src/MemoryMgr.cc index 4e13ea15..5e595b51 100644 --- a/dev/kernel/src/MemoryMgr.cc +++ b/dev/kernel/src/MemoryMgr.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include #include #include #include @@ -25,11 +25,11 @@ //! @brief Heap algorithm that serves as the main memory manager. #define kKernelHeapMagic (0xD4D75) -#define kKernelHeapAlignSz (__BIGGEST_ALIGNMENT__) +#define kKernelHeapAlignSz (4) namespace NeOS { - /// @brief Contains data structures and algorithms for the heap. + /// @brief Implementation details. namespace Detail { struct PACKED HEAP_INFORMATION_BLOCK; diff --git a/dev/kernel/src/Network/IPCAddr.cc b/dev/kernel/src/Network/IPCAddr.cc index 75a54a36..fb2d785a 100644 --- a/dev/kernel/src/Network/IPCAddr.cc +++ b/dev/kernel/src/Network/IPCAddr.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include #include namespace NeOS diff --git a/dev/kernel/src/Network/IPCMsg.cc b/dev/kernel/src/Network/IPCMsg.cc index f5bec6f7..5c18fe9c 100644 --- a/dev/kernel/src/Network/IPCMsg.cc +++ b/dev/kernel/src/Network/IPCMsg.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include -#include +#include #include namespace NeOS diff --git a/dev/kernel/src/User.cc b/dev/kernel/src/User.cc index 3c23c59e..fab5da88 100644 --- a/dev/kernel/src/User.cc +++ b/dev/kernel/src/User.cc @@ -11,7 +11,7 @@ */ #include -#include +#include #include #include #include diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 1087ac6b..19861dbe 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include ///! BUGS: 0 diff --git a/dev/modules/CoreGfx/AccessibilityMgr.h b/dev/modules/CoreGfx/AccessibilityMgr.h index a45470eb..a7cd24b5 100644 --- a/dev/modules/CoreGfx/AccessibilityMgr.h +++ b/dev/modules/CoreGfx/AccessibilityMgr.h @@ -8,7 +8,7 @@ #define GFX_MGR_ACCESSIBILITY_H #include -#include +#include #include #include #include diff --git a/dev/modules/ReadMe.md b/dev/modules/ReadMe.md index 1261e247..5e71937f 100644 --- a/dev/modules/ReadMe.md +++ b/dev/modules/ReadMe.md @@ -7,6 +7,5 @@ They are pluggable modules for specific hardware support. ## To-Do - [X] AHCI kernel module. -- [X] MBCI kernel module. ###### Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. All rights reserved. -- cgit v1.2.3