diff options
Diffstat (limited to 'dev/LibSCI')
| -rw-r--r-- | dev/LibSCI/CompilerHint.h | 25 | ||||
| -rw-r--r-- | dev/LibSCI/FileMgr.h | 10 | ||||
| -rw-r--r-- | dev/LibSCI/GPU.h | 78 | ||||
| -rw-r--r-- | dev/LibSCI/LPC.h | 56 | ||||
| -rw-r--r-- | dev/LibSCI/Macros.h | 93 | ||||
| -rw-r--r-- | dev/LibSCI/SCI.h | 352 | ||||
| -rw-r--r-- | dev/LibSCI/doc/LibSCI.drawio | 28 | ||||
| -rw-r--r-- | dev/LibSCI/libsci.json | 20 | ||||
| -rw-r--r-- | dev/LibSCI/src/GPU.cc | 10 | ||||
| -rw-r--r-- | dev/LibSCI/src/LPC.cc | 10 | ||||
| -rw-r--r-- | dev/LibSCI/src/LibSCI+IO.asm | 50 | ||||
| -rw-r--r-- | dev/LibSCI/src/Makefile | 16 | ||||
| -rw-r--r-- | dev/LibSCI/src/SCI.cc | 45 |
13 files changed, 0 insertions, 793 deletions
diff --git a/dev/LibSCI/CompilerHint.h b/dev/LibSCI/CompilerHint.h deleted file mode 100644 index 01ecb35f..00000000 --- a/dev/LibSCI/CompilerHint.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef SCI_HINT_H -#define SCI_HINT_H - -#ifdef __TK__ -#pragma compiler(hint_manifest) -#endif - -#define _Input -#define _Output - -#define _Optional - -#define _StrictCheckInput -#define _StrictCheckOutput - -#define _InOut -#define _StrictInOut - -#endif // ifndef SCI_HINT_H diff --git a/dev/LibSCI/FileMgr.h b/dev/LibSCI/FileMgr.h deleted file mode 100644 index 2e256bfb..00000000 --- a/dev/LibSCI/FileMgr.h +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: Finder.h -Purpose: FileMgr Interface. - -------------------------------------------- */ - -#pragma once
\ No newline at end of file diff --git a/dev/LibSCI/GPU.h b/dev/LibSCI/GPU.h deleted file mode 100644 index a29eae00..00000000 --- a/dev/LibSCI/GPU.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: GPU.h -Purpose: GPU/FB System Calls. - -------------------------------------------- */ - -#ifndef SCI_GPU_H -#define SCI_GPU_H - -#include <LibSCI/SCI.h> - -/// ------------------------------------------------------------------------------------------ // -/// @brief Graphics Processor API. -/// ------------------------------------------------------------------------------------------ // - -struct GPUCmdEntry; -struct GPUCmdEntryTraits; - -typedef VoidPtr GPUObject; - -/// ------------------------------------------------------------------------------------------ // -/// @brief Command structure type. -/// ------------------------------------------------------------------------------------------ // - -struct GPUCmdEntry -{ - VoidPtr Data{nullptr}; - SizeT DataSz{0}; - SizeT Layer{0}; - BOOL IsGPGPUData{NO}; -}; - -struct GPUCmdEntryTraits final -{ - GPUCmdEntry* Cmd{nullptr}; - - BOOL isGPGPUData() - { - return this->isValid() && this->Cmd->IsGPGPUData; - } - - BOOL isBackBuffer() - { - return this->Cmd->Layer > 0; - } - - BOOL isValid() - { - return this->Cmd->Data && (this->Cmd->DataSz > 0) && (MmGetHeapFlags(this->Cmd->Data) != ~0); - } -}; - -IMPORT_C BOOL GPUListDevices(const Char** list, SizeT cnt); - -IMPORT_C GPUObject GPUFindByDeviceName(_Input const Char* device_name); - -IMPORT_C GPUObject GPUQueryInfo(_Input const GPUObject* gpu_handle, VoidPtr* out, SizeT out_sz); - -IMPORT_C SInt32 GPUDisposeDevice(GPUObject gpu_handle, Bool cancel_all, Bool flush_all); - -IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPUObject gpu_handle, GPUCmdEntry** cmd_list, SizeT cmd_list_cnt); - -// ------------------------------------------------------------------------------------------ // -// @brief Framebuffer API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 FBAcquireBuffer(GPUObject* out, SInt32 width, SInt32 height); - -IMPORT_C SInt32 FBDisposeBuffer(GPUObject* in); - -IMPORT_C SInt32 FBGetColorProfile(GPUObject in); - -IMPORT_C SInt32 FBQueryInfo(GPUObject handle, VoidPtr* info_ptr, SizeT* info_sz); - -#endif // ifndef SCI_GPU_H diff --git a/dev/LibSCI/LPC.h b/dev/LibSCI/LPC.h deleted file mode 100644 index 8631f3de..00000000 --- a/dev/LibSCI/LPC.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include <Macros.h> - -/// @file LPC.h -/// @brief Local Process Code type and values. - -#define err_local_ok() (kLastError == kErrorSuccess) -#define err_local_fail() (kLastError != kErrorSuccess) -#define err_local_get() (kLastError) - -typedef SInt32 ErrObject; - -inline constexpr ErrObject kErrorSuccess = 0; -inline constexpr ErrObject kErrorExecutable = 33; -inline constexpr ErrObject kErrorExecutableLib = 34; -inline constexpr ErrObject kErrorFileNotFound = 35; -inline constexpr ErrObject kErrorDirectoryNotFound = 36; -inline constexpr ErrObject kErrorDiskReadOnly = 37; -inline constexpr ErrObject kErrorDiskIsFull = 38; -inline constexpr ErrObject kErrorProcessFault = 39; -inline constexpr ErrObject kErrorSocketHangUp = 40; -inline constexpr ErrObject kErrorThreadLocalStorage = 41; -inline constexpr ErrObject kErrorMath = 42; -inline constexpr ErrObject kErrorNoNetwork = 43; -inline constexpr ErrObject kErrorHeapOutOfMemory = 44; -inline constexpr ErrObject kErrorNoSuchDisk = 45; -inline constexpr ErrObject kErrorFileExists = 46; -inline constexpr ErrObject kErrorFormatFailed = 47; -inline constexpr ErrObject kErrorNetworkTimeout = 48; -inline constexpr ErrObject kErrorInternal = 49; -inline constexpr ErrObject kErrorForkAlreadyExists = 50; -inline constexpr ErrObject kErrorOutOfTeamSlot = 51; -inline constexpr ErrObject kErrorHeapNotPresent = 52; -inline constexpr ErrObject kErrorNoEntrypoint = 53; -inline constexpr ErrObject kErrorDiskIsCorrupted = 54; -inline constexpr ErrObject kErrorDisk = 55; -inline constexpr ErrObject kErrorInvalidData = 56; -inline constexpr ErrObject kErrorAsync = 57; -inline constexpr ErrObject kErrorNonBlocking = 58; -inline constexpr ErrObject kErrorIPC = 59; -inline constexpr ErrObject kErrorSign = 60; -inline constexpr ErrObject kErrorInvalidCreds = 61; -inline constexpr ErrObject kErrorCDTrayBroken = 62; -inline constexpr ErrObject kErrorUnrecoverableDisk = 63; -inline constexpr ErrObject kErrorFileLocked = 64; -inline constexpr ErrObject kErrorUnimplemented = -1; - -/// @brief The last error reported by the system to the process. -IMPORT_C ErrObject kLastError; diff --git a/dev/LibSCI/Macros.h b/dev/LibSCI/Macros.h deleted file mode 100644 index 4e4bff9a..00000000 --- a/dev/LibSCI/Macros.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: Macros.h -Purpose: LibSCI Macros header. - -------------------------------------------- */ - -#pragma once - -/***********************************************************************************/ -/// @file LibSCI/Macros.h -/// @brief Macros and core types. -/***********************************************************************************/ - -#include <LibSCI/CompilerHint.h> - -#define ATTRIBUTE(X) __attribute__((X)) - -#define IMPORT_CXX extern "C++" -#define IMPORT_C extern "C" - -#define DEPRECATED ATTRIBUTE(deprecated) - -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -#define FILE_MAX_LEN 256 - -#ifndef BOOL -#define BOOL bool -#endif - -typedef bool Bool; -typedef bool Boolean; -typedef void Void; - -#ifndef __cplusplus -#define true 1 -#define false 0 -#endif - -#define YES true -#define NO false - -typedef __UINT64_TYPE__ UInt64; -typedef __UINT32_TYPE__ UInt32; -typedef __UINT16_TYPE__ UInt16; -typedef __UINT8_TYPE__ UInt8; - -typedef __SIZE_TYPE__ SizeT; - -typedef __INT64_TYPE__ SInt64; -typedef __INT32_TYPE__ SInt32; -typedef __INT16_TYPE__ SInt16; -typedef __INT8_TYPE__ SInt8; - -typedef void* VoidPtr; -typedef __UINTPTR_TYPE__ UIntPtr; -typedef char Char; - -#ifdef __cplusplus -typedef decltype(nullptr) nullPtr; -typedef nullPtr NullPtr; - -#define SCI_COPY_DELETE(KLASS) \ - KLASS& operator=(const KLASS&) = delete; \ - KLASS(const KLASS&) = delete; - -#define SCI_COPY_DEFAULT(KLASS) \ - KLASS& operator=(const KLASS&) = default; \ - KLASS(const KLASS&) = default; - -#define SCI_MOVE_DELETE(KLASS) \ - KLASS& operator=(KLASS&&) = delete; \ - KLASS(KLASS&&) = delete; - -#define SCI_MOVE_DEFAULT(KLASS) \ - KLASS& operator=(KLASS&&) = default; \ - KLASS(KLASS&&) = default; - -#endif - -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<SizeT>(!(sizeof(a) % sizeof(*(a))))))) -#endif
\ No newline at end of file diff --git a/dev/LibSCI/SCI.h b/dev/LibSCI/SCI.h deleted file mode 100644 index 97af9ffc..00000000 --- a/dev/LibSCI/SCI.h +++ /dev/null @@ -1,352 +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 <LibSCI/Macros.h>
-
-// ------------------------------------------------------------------------------------------ //
-/// @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);
-
-// ------------------------------------------------------------------------------------------ //
-// Console API.
-// ------------------------------------------------------------------------------------------ //
-
-IMPORT_C SInt32 ConOut(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...);
-
-IMPORT_C SInt32 ConIn(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...);
-
-IMPORT_C IOObject ConCreate(Void);
-
-IMPORT_C SInt32 ConRelease(IOObject);
-
-IMPORT_C IOObject ConGet(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, ...);
-
-// ------------------------------------------------------------------------------------------ //
-// @brief Message API.
-// ------------------------------------------------------------------------------------------ //
-
-IMPORT_C SInt32 MsgFree(VoidPtr handle);
-IMPORT_C SInt32 MsgShow(VoidPtr handle);
-
-/// @note fmt could be any POSIX argument, or the extended ones (%$, %{})
-IMPORT_C SInt32 MsgSend(VoidPtr handle, const Char* fmt, ...);
-IMPORT_C SInt32 MsgAlloc(VoidPtr handle);
-
-IMPORT_C VoidPtr kWarnMsg, kInfoMsg, kErrorMsg;
-
-#endif // ifndef SCI_SCI_H
diff --git a/dev/LibSCI/doc/LibSCI.drawio b/dev/LibSCI/doc/LibSCI.drawio deleted file mode 100644 index 132eacc1..00000000 --- a/dev/LibSCI/doc/LibSCI.drawio +++ /dev/null @@ -1,28 +0,0 @@ -<mxfile host="65bd71144e"> - <diagram name="Page-1" id="_vc7fxBdNKI2W8YhI8VA"> - <mxGraphModel dx="756" dy="528" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> - <root> - <mxCell id="0"/> - <mxCell id="1" parent="0"/> - <mxCell id="eRehIIeIVOPW1y23kRkx-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="eRehIIeIVOPW1y23kRkx-2" target="eRehIIeIVOPW1y23kRkx-8" edge="1"> - <mxGeometry relative="1" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-2" value="LibSCI Header (Foundation.h)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> - <mxGeometry x="200" y="450" width="226" height="60" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="eRehIIeIVOPW1y23kRkx-3" target="eRehIIeIVOPW1y23kRkx-2" edge="1"> - <mxGeometry relative="1" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-3" value="LibSCI" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" parent="1" vertex="1"> - <mxGeometry x="283" y="290" width="60" height="80" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-8" value="WindowMgr" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> - <mxGeometry x="253" y="570" width="120" height="60" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-10" value="<h1 style="margin-top: 0px;">System Call Interface</h1><p>A set of core functions made to call the microkernel.</p><p>These calls takes care of I/O, Heap and process control.</p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1"> - <mxGeometry x="450" y="240" width="320" height="100" as="geometry"/> - </mxCell> - </root> - </mxGraphModel> - </diagram> -</mxfile>
\ No newline at end of file diff --git a/dev/LibSCI/libsci.json b/dev/LibSCI/libsci.json deleted file mode 100644 index 8b54828d..00000000 --- a/dev/LibSCI/libsci.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["src/*.cc", "src/*.o"], - "output_name": "libSCI.dylib", - "compiler_flags": [ - "-fPIC", - "-ffreestanding", - "-shared", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17" - ], - "cpp_macros": [ - "kSCIVersion=0x0100", - "kSCIVersionHighest=0x0100", - "kSCIVersionLowest=0x0100" - ] -} diff --git a/dev/LibSCI/src/GPU.cc b/dev/LibSCI/src/GPU.cc deleted file mode 100644 index b3442db8..00000000 --- a/dev/LibSCI/src/GPU.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: GPU.cc -Purpose: GPU Interface. - -------------------------------------------- */ - -#include <GPU.h> diff --git a/dev/LibSCI/src/LPC.cc b/dev/LibSCI/src/LPC.cc deleted file mode 100644 index e0d2897d..00000000 --- a/dev/LibSCI/src/LPC.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: LPC.cc -Purpose: Local Procedure Codes. - -------------------------------------------- */ - -#include <LPC.h> diff --git a/dev/LibSCI/src/LibSCI+IO.asm b/dev/LibSCI/src/LibSCI+IO.asm deleted file mode 100644 index 1d6ee83c..00000000 --- a/dev/LibSCI/src/LibSCI+IO.asm +++ /dev/null @@ -1,50 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * LibSCI -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[bits 64] - -section .text - -global sci_syscall_arg_1 -global sci_syscall_arg_2 -global sci_syscall_arg_3 -global sci_syscall_arg_4 - -sci_syscall_arg_1: - mov r8, rcx - syscall - ret - -sci_syscall_arg_2: - mov r8, rcx - mov r9, rdx - syscall - ret - -sci_syscall_arg_3: - mov rbx, r8 - - mov r8, rcx - mov r9, rdx - mov r10, rbx - - syscall - ret - -sci_syscall_arg_4: - mov rbx, r8 - mov rax, r9 - - mov r8, rcx - mov r9, rdx - mov r10, rbx - mov r11, rax - - syscall - ret diff --git a/dev/LibSCI/src/Makefile b/dev/LibSCI/src/Makefile deleted file mode 100644 index eb655ed5..00000000 --- a/dev/LibSCI/src/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the bootloader makefile. -################################################## - -ASM=nasm -FLAGS=-f win64 - -.PHONY: error -error: - @echo "==> Invalid rule." - @echo "==> Use sci_asm_io_<arch> instead." - -.PHONY: sci_asm_io_x64 -sci_asm_io_x64: - $(ASM) $(FLAGS) LibSCI+IO.asm -o LibSCI+IO.o diff --git a/dev/LibSCI/src/SCI.cc b/dev/LibSCI/src/SCI.cc deleted file mode 100644 index 3fe7b0f8..00000000 --- a/dev/LibSCI/src/SCI.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* -------------------------------------------
-
- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
-
-------------------------------------------- */
-
-#include <SCI.h>
-
-/// @file LibSCI.cc
-/// @brief Source file for the memory functions of the LibSCI.
-
-/// @brief Copy memory region.
-IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len)
-{
- if (!len ||
- !dest ||
- !src)
- {
- return nullptr;
- }
-
- for (SizeT i = 0; i < len; i++)
- {
- ((Char*)dest)[i] = ((Char*)src)[i];
- }
-
- return dest;
-}
-
-/// @brief Fill memory region with **value**.
-IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value)
-{
- if (!len ||
- !dest)
- {
- return nullptr;
- }
-
- for (SizeT i = 0; i < len; i++)
- {
- ((Char*)dest)[i] = value;
- }
-
- return dest;
-}
|
