diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-11-03 15:05:19 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-11-03 15:05:19 +0100 |
| commit | e2c2361f335a45d1268481c17fea6f50aa03bbff (patch) | |
| tree | e2fd2c4fd8cfe0b26277f64e975fbbf756f8a3c8 | |
| parent | 140d983c55e0f9a2d1829c997d7751f234703fb6 (diff) | |
IMP: MakeFramework tool, (Alpha)
- This tool is used to make frameworks and apps.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | dev/SCIKit/src/DispatchSysCalls.asm (renamed from dev/SCIKit/src/Syscall.asm) | 16 | ||||
| -rw-r--r-- | dev/SCIKit/src/Foundation.cc | 4 | ||||
| -rw-r--r-- | dev/SCIKit/src/Makefile | 3 | ||||
| -rw-r--r-- | dev/ZKAKit/HALKit/AMD64/MBCI/.gitkeep | 0 | ||||
| -rw-r--r-- | dev/ZKAKit/HALKit/AMD64/MBCI/HalMBCI.cc | 7 | ||||
| -rw-r--r-- | tools/Framework.h | 13 | ||||
| -rw-r--r-- | tools/make_framework.json | 10 | ||||
| -rw-r--r-- | tools/src/Framework.cc | 68 | ||||
| -rw-r--r-- | tools/src/MakeFramework.cc | 42 |
9 files changed, 99 insertions, 64 deletions
diff --git a/dev/SCIKit/src/Syscall.asm b/dev/SCIKit/src/DispatchSysCalls.asm index d1928191..d0a8054e 100644 --- a/dev/SCIKit/src/Syscall.asm +++ b/dev/SCIKit/src/DispatchSysCalls.asm @@ -9,23 +9,23 @@ [bits 64] -global sci_syscall_1 -global sci_syscall_2 -global sci_syscall_3 -global sci_syscall_4 +global sci_syscall_arg_1 +global sci_syscall_arg_2 +global sci_syscall_arg_3 +global sci_syscall_arg_4 -sci_syscall_1: +sci_syscall_arg_1: mov r8, rcx syscall ret -sci_syscall_2: +sci_syscall_arg_2: mov r8, rcx mov r9, rdx syscall ret -sci_syscall_3: +sci_syscall_arg_3: mov rbx, r8 mov r8, rcx @@ -35,7 +35,7 @@ sci_syscall_3: syscall ret -sci_syscall_4: +sci_syscall_arg_4: mov rbx, r8 mov rax, r9 diff --git a/dev/SCIKit/src/Foundation.cc b/dev/SCIKit/src/Foundation.cc index 4231c02c..c0723c93 100644 --- a/dev/SCIKit/src/Foundation.cc +++ b/dev/SCIKit/src/Foundation.cc @@ -6,8 +6,8 @@ #include <SCIKit/Foundation.h>
-/// @file sci_base.cc
-/// @brief Base Memory Manager functions for SCI.dll
+/// @file Foundation.cc
+/// @brief Foundation source file for SCI Kit.
/// @brief Copy memory region.
IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len)
diff --git a/dev/SCIKit/src/Makefile b/dev/SCIKit/src/Makefile index e518909a..68a6407b 100644 --- a/dev/SCIKit/src/Makefile +++ b/dev/SCIKit/src/Makefile @@ -1,4 +1,3 @@ .PHONY: syscall_unit syscall_unit: - nasm -f win64 Syscall.asm - + nasm -f win64 DispatchSysCalls.asm -o DispatchSysCalls.obj diff --git a/dev/ZKAKit/HALKit/AMD64/MBCI/.gitkeep b/dev/ZKAKit/HALKit/AMD64/MBCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/dev/ZKAKit/HALKit/AMD64/MBCI/.gitkeep +++ /dev/null diff --git a/dev/ZKAKit/HALKit/AMD64/MBCI/HalMBCI.cc b/dev/ZKAKit/HALKit/AMD64/MBCI/HalMBCI.cc new file mode 100644 index 00000000..9eb3afb3 --- /dev/null +++ b/dev/ZKAKit/HALKit/AMD64/MBCI/HalMBCI.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright EL Mahrouss Logic. + +------------------------------------------- */ + +#include <Modules/MBCI/MBCI.h> diff --git a/tools/Framework.h b/tools/Framework.h index 9d5a6861..bc66658c 100644 --- a/tools/Framework.h +++ b/tools/Framework.h @@ -3,11 +3,14 @@ (C) EL Mahrouss Logic. */ -#pragma once +#ifndef TOOLS_FRAMEWORK_H +#define TOOLS_FRAMEWORK_H #include <Common.h> -#define kFKDLLDirectory "ZKA/DLL/" -#define kFKManifestDirectory "ZKA/Manifests/" -#define kFKRootDirectory "ZKA/" -#define kFKExtension ".framework" +#define kExecDirectory "ZKA/Exec/" +#define kRootDirectory "ZKA/" +#define kFKExtension ".fwrk" +#define kAppExtension ".app" + +#endif // !TOOLS_FRAMEWORK_H diff --git a/tools/make_framework.json b/tools/make_framework.json index 4ef2d7b6..9709ff3a 100644 --- a/tools/make_framework.json +++ b/tools/make_framework.json @@ -2,12 +2,12 @@ "compiler_path": "g++", "compiler_std": "c++20", "headers_path": ["./"], - "sources_path": ["src/MakeFramework.cc"], - "output_name": "make_framework.exe", + "sources_path": ["src/Framework.cc"], + "output_name": "make_framework.o", "cpp_macros": [ "__MKF_AMD64__", - "cMKFVersion=0x0100", - "cMKFVersionHighest=0x0100", - "cMKFVersionLowest=0x0100" + "kMKFVersion=0x0100", + "kMKFVersionHighest=0x0100", + "kMKFVersionLowest=0x0100" ] } diff --git a/tools/src/Framework.cc b/tools/src/Framework.cc new file mode 100644 index 00000000..1a678ec3 --- /dev/null +++ b/tools/src/Framework.cc @@ -0,0 +1,68 @@ +/* + * Created on Thu Oct 17 08:00:42 CEST 2024 + * + * Copyright (c) 2024 EL Mahrouss Logic + */ + +#include <cstdlib> +#include <filesystem> +#include <Framework.h> +#include <vector> + +/// @brief This program makes a framework directory for ZKA OS. + +int main(int argc, char* argv[]) +{ + std::vector<std::string> files; + + auto ext = kFKExtension; + + for (size_t i = 2UL; i < argc; ++i) + { + if (strcmp(argv[i], "-h") == 0) + { + std::cout << "make_framework: Framework Creation Tool.\n"; + std::cout << "make_framework: © EL Mahrouss Logic, all rights reserved.\n"; + + return EXIT_SUCCESS; + } + + if (strcmp(argv[i], "-a") == 0) + { + ext = kAppExtension; + continue; + } + + files.push_back(argv[i]); + } + + auto path = std::string(argv[1]); + + if (!path.ends_with(ext)) + return EXIT_FAILURE; + + std::filesystem::path path_arg = path; + + if (std::filesystem::create_directory(path_arg)) + { + std::filesystem::create_directory(path_arg / kRootDirectory); + std::filesystem::create_directory(path_arg / kExecDirectory); + + for (auto& file : files) + { + std::string file_cpy = file; + + while (file_cpy.find("/") != std::string::npos) + { + file_cpy.erase(0, file_cpy.find("/")); + file_cpy.erase(file_cpy.find("/"), 1); + } + + std::filesystem::copy(path, path_arg / kExecDirectory / file_cpy); + } + + return EXIT_SUCCESS; + } + + return EXIT_FAILURE; +} diff --git a/tools/src/MakeFramework.cc b/tools/src/MakeFramework.cc deleted file mode 100644 index af4ed0cb..00000000 --- a/tools/src/MakeFramework.cc +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Created on Thu Oct 17 08:00:42 CEST 2024 - * - * Copyright (c) 2024 EL Mahrouss Logic - */ - -#include <filesystem> -#include <framework.h> - -/// @brief This program converts a PE32+ driver, into a custom format, the ZXD. -/// @note ZXD is a format for ZKA signed drivers. -int main(int argc, char* argv[]) -{ - for (size_t i = 1ul; i < argc; ++i) - { - if (strcmp(argv[i], "-h") == 0) - { - std::cout << "make_framework: Framework Creation Tool.\n"; - std::cout << "make_framework: © EL Mahrouss Logic, all rights reserved.\n"; - - return 0; - } - } - - auto path = std::string(argv[1]); - - if (!path.ends_with(kFKExtension)) - return 1; - - std::filesystem::path path_arg = path; - - if (std::filesystem::create_directory(path_arg)) - { - std::filesystem::create_directory(path_arg / kFKRootDirectory); - std::filesystem::create_directory(path_arg / kFKManifestDirectory); - std::filesystem::create_directory(path_arg / kFKDLLDirectory); - - return 0; - } - - return 1; -} |
