diff options
42 files changed, 104 insertions, 36 deletions
diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 1454585c..e6309589 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -504,6 +504,7 @@ SizeT UserProcessScheduler::Run() noexcept { if (UserProcessHelper::Switch(process.StackFrame, process.ProcessId)) { process.PTime = static_cast<Int32>(process.Affinity); + // We add a bigger cooldown according to the RTime and affinity here. if (process.PTime < process.RTime && AffinityKind::kRealTime != process.Affinity) { if (process.RTime < (Int32) AffinityKind::kVeryHigh) process.RTime = (Int32) AffinityKind::kLowUsage / 2; diff --git a/dev/libSystem/Err.h b/dev/libSystem/SystemKit/Err.h index e9fe013b..c0a2282b 100644 --- a/dev/libSystem/Err.h +++ b/dev/libSystem/SystemKit/Err.h @@ -6,7 +6,7 @@ #pragma once -#include <libSystem/Macros.h> +#include <libSystem/SystemKit/Macros.h> /// @file Err.h /// @brief Process Codes type and values. diff --git a/dev/libSystem/Jail.h b/dev/libSystem/SystemKit/Jail.h index 6a9259fc..93734dcf 100644 --- a/dev/libSystem/Jail.h +++ b/dev/libSystem/SystemKit/Jail.h @@ -6,10 +6,18 @@ #pragma once -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @file Jail.h /// @brief NeKernel Jail System struct JAIL_INFO; -struct JAIL;
\ No newline at end of file +struct JAIL; + +/// @brief Jail information (client side struct) +struct JAIL_INFO +{ + SInt32 fParentID; + SInt32 fJailHash; + SInt64 fACL; +};
\ No newline at end of file diff --git a/dev/libSystem/Macros.h b/dev/libSystem/SystemKit/Macros.h index 5b3a5ce1..48c586cc 100644 --- a/dev/libSystem/Macros.h +++ b/dev/libSystem/SystemKit/Macros.h @@ -82,8 +82,6 @@ typedef nullPtr NullPtr; #endif -IMPORT_C void _rtl_assert(Bool expr, const Char* origin); - #define MUST_PASS(X) _rtl_assert(X, __FILE__) #ifndef ARRAY_SIZE @@ -124,3 +122,5 @@ IMPORT_C void _rtl_assert(Bool expr, const Char* origin); #endif #define LIBSYS_UNUSED(X) ((void) X) + +IMPORT_C void _rtl_assert(Bool expr, const Char* origin); diff --git a/dev/libSystem/Syscall.h b/dev/libSystem/SystemKit/Syscall.h index 21f8287c..1a334ead 100644 --- a/dev/libSystem/Syscall.h +++ b/dev/libSystem/SystemKit/Syscall.h @@ -6,7 +6,7 @@ #pragma once -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> #include <cstdarg> #ifndef SYSCALL_HASH diff --git a/dev/libSystem/System.h b/dev/libSystem/SystemKit/System.h index 88e1f173..b3d10e32 100644 --- a/dev/libSystem/System.h +++ b/dev/libSystem/SystemKit/System.h @@ -10,7 +10,7 @@ Purpose: System Call Interface. #ifndef LIBSYS_SYSTEM_CALLS_H
#define LIBSYS_SYSTEM_CALLS_H
-#include <libSystem/Macros.h>
+#include <libSystem/SystemKit/Macros.h>
// ------------------------------------------------------------------------------------------ //
/// @brief Types API.
diff --git a/dev/libSystem/src/Makefile b/dev/libSystem/src/Makefile index 41c99c4d..39af446b 100644 --- a/dev/libSystem/src/Makefile +++ b/dev/libSystem/src/Makefile @@ -13,4 +13,4 @@ error: .PHONY: libsys_asm_io_x64 libsys_asm_io_x64: - $(ASM) $(FLAGS) SystemProc.asm -o SystemProc.asm.obj + $(ASM) $(FLAGS) SystemProc.asm -o SystemProc.stub.obj diff --git a/dev/libSystem/src/SystemAPI.cc b/dev/libSystem/src/SystemImpl.cc index 37e835c1..6c2201fe 100644 --- a/dev/libSystem/src/SystemAPI.cc +++ b/dev/libSystem/src/SystemImpl.cc @@ -4,8 +4,8 @@ ------------------------------------------- */
-#include <libSystem/Syscall.h>
-#include <libSystem/System.h>
+#include <libSystem/SystemKit/Syscall.h>
+#include <libSystem/SystemKit/System.h>
/// @file SystemAPI.cc
/// @brief System wide API for NeKernel.
diff --git a/dev/libSystem/src/SystemProc.asm b/dev/libSystem/src/SystemProc.asm index bc41059a..299b59f9 100644 --- a/dev/libSystem/src/SystemProc.asm +++ b/dev/libSystem/src/SystemProc.asm @@ -21,7 +21,8 @@ libsys_syscall_arg_1: mov rbp, rsp mov r8, rcx - syscall + + int 50 pop rbp @@ -33,7 +34,9 @@ libsys_syscall_arg_2: mov r8, rcx mov r9, rdx - syscall + + int 50 + pop rbp ret @@ -46,7 +49,8 @@ libsys_syscall_arg_3: mov r9, rdx mov r10, rbx - syscall + int 50 + pop rbp ret @@ -60,7 +64,8 @@ libsys_syscall_arg_4: mov r10, rbx mov r11, rax - syscall + int 50 + pop rbp ret diff --git a/dev/system_sdk/.keep b/dev/open_msg/.keep index e69de29b..e69de29b 100644 --- a/dev/system_sdk/.keep +++ b/dev/open_msg/.keep diff --git a/dev/open_msg/MsgKit/Server.h b/dev/open_msg/MsgKit/Server.h new file mode 100644 index 00000000..867d3b54 --- /dev/null +++ b/dev/open_msg/MsgKit/Server.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include <NeKit/KString.h> +#include <NeKit/MutableArray.h> + +struct OPENMSG_EXPR; + +struct OPENMSG_EXPR { + Kernel::KString* l_head; + Kernel::MutableArray<OPENMSG_EXPR> l_args; +}; + +typedef Kernel::Void(*openmsg_func_t)(OPENMSG_EXPR* arg); + +EXTERN_C Kernel::Void openmsg_init_library(openmsg_func_t* funcs, Kernel::SizeT cnt); +EXTERN_C Kernel::UInt32 openmsg_close_library(Kernel::Void); diff --git a/dev/open_msg/obj/.keep b/dev/open_msg/obj/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/open_msg/obj/.keep diff --git a/dev/open_msg/script/window.msg b/dev/open_msg/script/window.msg new file mode 100644 index 00000000..77d6ef69 --- /dev/null +++ b/dev/open_msg/script/window.msg @@ -0,0 +1,6 @@ +(window + :id 1 + :pos (x 100 y 100) + :size (w 300 h 200) + :title "My App" + :on-click (lambda () (log "Clicked!")))
\ No newline at end of file diff --git a/dev/open_msg/src/.keep b/dev/open_msg/src/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/open_msg/src/.keep diff --git a/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json b/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json index a208f57a..076b35ae 100644 --- a/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json +++ b/public/frameworks/CoreFoundation.fwrk/CoreFoundation.json @@ -3,7 +3,7 @@ "compiler_std": "c++20", "headers_path": ["../", "./", "../../../dev", "../../../dev/kernel"], "sources_path": ["src/*.cc"], - "output_name": "./dist/libCoreFoundation.dylib", + "output_name": "./dist/libCoreFoundation.fwrk.dylib", "compiler_flags": [ "-ffreestanding", "-shared", diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Array.h b/public/frameworks/CoreFoundation.fwrk/headers/Array.h index 55e75e5e..d9c528d9 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Array.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Array.h @@ -6,7 +6,7 @@ #pragma once -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> namespace CF { template <typename T, SizeT N> diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h index 1f295ea5..500ad544 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h @@ -10,7 +10,7 @@ #pragma once -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> namespace CF { class CFString; diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Property.h b/public/frameworks/CoreFoundation.fwrk/headers/Property.h index 4da173c7..5210bd95 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Property.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Property.h @@ -8,7 +8,7 @@ #define _PROPS_H #include <CoreFoundation.fwrk/headers/Ref.h> -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> #define kMaxPropLen (256U) diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h index cb72a034..87005db1 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h @@ -9,7 +9,7 @@ #define _REF_H_ #include <CoreFoundation.fwrk/headers/Object.h> -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> namespace CF { template <typename T> diff --git a/public/frameworks/DiskImage.fwrk/DiskImage.json b/public/frameworks/DiskImage.fwrk/DiskImage.json index aaff409c..16c538e5 100644 --- a/public/frameworks/DiskImage.fwrk/DiskImage.json +++ b/public/frameworks/DiskImage.fwrk/DiskImage.json @@ -3,7 +3,7 @@ "compiler_std": "c++20", "headers_path": ["../", "./", "../../../dev", "../../../dev/kernel"], "sources_path": ["src/*.cc"], - "output_name": "./dist/libDiskImage.dylib", + "output_name": "./dist/libDiskImage.fwrk.dylib", "compiler_flags": [ "-ffreestanding", "-shared", diff --git a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h index efc21253..53348f3e 100644 --- a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h +++ b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h @@ -9,7 +9,7 @@ #pragma once -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> #ifndef __DISK_IMAGE_CDROM__ #define kDISectorSz (512) diff --git a/public/frameworks/KernelTest.fwrk/KernelTest.json b/public/frameworks/KernelTest.fwrk/KernelTest.json index aa70db30..b8c322b6 100644 --- a/public/frameworks/KernelTest.fwrk/KernelTest.json +++ b/public/frameworks/KernelTest.fwrk/KernelTest.json @@ -3,7 +3,7 @@ "compiler_std": "c++20", "headers_path": ["../", "./", "../../../dev", "../../../dev/kernel"], "sources_path": ["src/*.cc"], - "output_name": "./dist/libKernelTest.dylib", + "output_name": "./dist/libKernelTest.fwrk.dylib", "compiler_flags": [ "-ffreestanding", "-shared", diff --git a/public/frameworks/OpenMSG.fwrk/.keep b/public/frameworks/OpenMSG.fwrk/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/.keep diff --git a/public/frameworks/OpenMSG.fwrk/OpenMSG.json b/public/frameworks/OpenMSG.fwrk/OpenMSG.json new file mode 100644 index 00000000..4bda8798 --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/OpenMSG.json @@ -0,0 +1,19 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": [ + "./", + "../../../dev/kernel", + "../../../public/frameworks/", + "../../../dev/", + "./" + ], + "sources_path": [], + "output_name": "./dist/libOpenMSG.fwrk.dylib", + "cpp_macros": [ + "kSampleFWVersion=0x0100", + "kSampleFWVersionHighest=0x0100", + "kSampleFWVersionLowest=0x0100", + "__NE_SDK__" + ] +}
\ No newline at end of file diff --git a/public/frameworks/OpenMSG.fwrk/headers/.keep b/public/frameworks/OpenMSG.fwrk/headers/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/headers/.keep diff --git a/public/frameworks/OpenMSG.fwrk/src/.keep b/public/frameworks/OpenMSG.fwrk/src/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/src/.keep diff --git a/public/frameworks/OpenMSG.fwrk/src/DylibMain.cc b/public/frameworks/OpenMSG.fwrk/src/DylibMain.cc new file mode 100644 index 00000000..814132e3 --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/src/DylibMain.cc @@ -0,0 +1,5 @@ +#include <libSystem/SystemKit/System.h> + +SInt32 _DylibAttach(SInt32 argc, Char* argv[]) { + return EXIT_FAILURE; +}
\ No newline at end of file diff --git a/public/frameworks/OpenMSG.fwrk/xml/.keep b/public/frameworks/OpenMSG.fwrk/xml/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/xml/.keep diff --git a/public/frameworks/OpenMSG.fwrk/xml/app.xml b/public/frameworks/OpenMSG.fwrk/xml/app.xml new file mode 100644 index 00000000..6a46e598 --- /dev/null +++ b/public/frameworks/OpenMSG.fwrk/xml/app.xml @@ -0,0 +1,2 @@ +<PropertyList> +<PLEntry Type="CFString" Name="LibraryName" Len="12" Value="OpenMSG.fwrk" /></PropertyList>
\ No newline at end of file diff --git a/public/tools/cc/src/CommandLine.cc b/public/tools/cc/src/CommandLine.cc index f1c72b64..62757c43 100644 --- a/public/tools/cc/src/CommandLine.cc +++ b/public/tools/cc/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief Placeholder program. diff --git a/public/tools/ld.dyn/src/CommandLine.cc b/public/tools/ld.dyn/src/CommandLine.cc index 70a0dbd9..e64e7837 100644 --- a/public/tools/ld.dyn/src/CommandLine.cc +++ b/public/tools/ld.dyn/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief Library loader. diff --git a/public/tools/ld.fwrk/src/CommandLine.cc b/public/tools/ld.fwrk/src/CommandLine.cc index 853a4ef7..323e58c7 100644 --- a/public/tools/ld.fwrk/src/CommandLine.cc +++ b/public/tools/ld.fwrk/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief This program loads a code framework into Kernel's memory. diff --git a/public/tools/manual/src/CommandLine.cc b/public/tools/manual/src/CommandLine.cc index 68594c09..8c75d565 100644 --- a/public/tools/manual/src/CommandLine.cc +++ b/public/tools/manual/src/CommandLine.cc @@ -1,4 +1,4 @@ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> SInt32 _NeMain(SInt32 argc, Char* argv[]) { LIBSYS_UNUSED(argc); diff --git a/public/tools/mgmt/src/CommandLine.cc b/public/tools/mgmt/src/CommandLine.cc index f3840d01..6015988e 100644 --- a/public/tools/mgmt/src/CommandLine.cc +++ b/public/tools/mgmt/src/CommandLine.cc @@ -1,4 +1,4 @@ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> SInt32 _NeMain(SInt32 argc, Char* argv[]) { return EXIT_FAILURE; diff --git a/public/tools/mk.fwrk/Common.h b/public/tools/mk.fwrk/Common.h index 89e52471..8e434043 100644 --- a/public/tools/mk.fwrk/Common.h +++ b/public/tools/mk.fwrk/Common.h @@ -7,6 +7,6 @@ #define APPS_COMMON_H #include <CoreFoundation.fwrk/headers/Foundation.h> -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> #endif // APPS_COMMON_H diff --git a/public/tools/mk.fwrk/src/CommandLine.cc b/public/tools/mk.fwrk/src/CommandLine.cc index 423dc12f..87945ddc 100644 --- a/public/tools/mk.fwrk/src/CommandLine.cc +++ b/public/tools/mk.fwrk/src/CommandLine.cc @@ -7,7 +7,7 @@ #include <Framework.h> #include <Steps.h> -#include <libSystem/Err.h> +#include <libSystem/SystemKit/Err.h> #include <CoreFoundation.fwrk/headers/Array.h> diff --git a/public/tools/mk.hefs/src/CommandLine.cc b/public/tools/mk.hefs/src/CommandLine.cc index 0b38386a..91a3527d 100644 --- a/public/tools/mk.hefs/src/CommandLine.cc +++ b/public/tools/mk.hefs/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief Placeholder program. diff --git a/public/tools/mk.nefs/src/CommandLine.cc b/public/tools/mk.nefs/src/CommandLine.cc index 0b38386a..91a3527d 100644 --- a/public/tools/mk.nefs/src/CommandLine.cc +++ b/public/tools/mk.nefs/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief Placeholder program. diff --git a/public/tools/open/src/CommandLine.cc b/public/tools/open/src/CommandLine.cc index 6fa4e2f2..e02fcebc 100644 --- a/public/tools/open/src/CommandLine.cc +++ b/public/tools/open/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> /// @brief This program opens an application from **OPEN_APP_BASE_PATH** /// @file CommandLine.cc diff --git a/public/tools/ping/src/CommandLine.cc b/public/tools/ping/src/CommandLine.cc index 580d7973..a9ba177a 100644 --- a/public/tools/ping/src/CommandLine.cc +++ b/public/tools/ping/src/CommandLine.cc @@ -1,4 +1,4 @@ -#include <libSystem/System.h> +#include <libSystem/SystemKit/System.h> SInt32 _NeMain(SInt32 argc, Char* argv[]) { LIBSYS_UNUSED(argc); diff --git a/tooling/mk_app.py b/tooling/mk_app.py index 5ee6d5b7..7f7cef17 100755 --- a/tooling/mk_app.py +++ b/tooling/mk_app.py @@ -64,7 +64,7 @@ def create_directory_structure(base_path, project_name): proj_cpp_path = os.path.join(base_path, project_name, f"src/CommandLine.cc") - cpp_file = "#include <libSystem/System.h>\n\nSInt32 _NeMain(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" + cpp_file = "#include <libSystem/SystemKit/System.h>\n\nSInt32 _NeMain(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" with open(proj_cpp_path, 'w') as cpp_file_io: cpp_file_io.write(cpp_file) diff --git a/tooling/mk_fwrk.py b/tooling/mk_fwrk.py index e4e5d7de..b2ef99ff 100755 --- a/tooling/mk_fwrk.py +++ b/tooling/mk_fwrk.py @@ -56,7 +56,7 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name): "sources_path": [ ], - "output_name": f"./dist/{project_name}", + "output_name": f"./dist/lib{project_name}.dylib", "cpp_macros": [ "kSampleFWVersion=0x0100", "kSampleFWVersionHighest=0x0100", @@ -70,7 +70,7 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name): proj_cpp_path = os.path.join(base_path_fwrk, project_name, f"src/DylibMain.cc") - cpp_file = "#include <libSystem/System.h>\n\nSInt32 _DylibAttach(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" + cpp_file = "#include <libSystem/SystemKit/System.h>\n\nSInt32 _DylibAttach(SInt32 argc, Char* argv[]) {\n\treturn EXIT_FAILURE;\n}" with open(proj_cpp_path, 'w') as cpp_file_io: cpp_file_io.write(cpp_file) |
