summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-09-25 08:26:08 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-09-25 08:26:08 +0200
commitdaa4f8c748d290feba8a71e889743a8a3097ad7d (patch)
tree4b4869dbe3ec5f7c1d78c3d88241db96d006a445
parent8f62fbe30655e4d18837f196f01bb203126f474f (diff)
Refactor codebase: Move Objects to obj/, fix flags, remove .vscode, add syscalls
- Refactored Objects directory to obj/ for better organization. - Fixed incorrect flags in the build process. - Removed .vscode folder to clean up unnecessary IDE settings. - Added syscall implementations for enhanced functionality. Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
-rw-r--r--.vscode/c_cpp_properties.json52
-rw-r--r--dev/base/EncryptFS/EncryptFS.hxx22
-rw-r--r--dev/base/EncryptFS/ReadMe.md8
-rw-r--r--dev/base/EncryptFS/build.json2
-rw-r--r--dev/base/EncryptFS/disk_crypt.hxx28
-rw-r--r--dev/base/EncryptFS/source_deploy.xml5
-rw-r--r--dev/base/EncryptFS/src/EncryptBlock.cxx14
-rw-r--r--dev/base/EncryptFS/src/Key.cxx12
-rw-r--r--dev/base/EncryptFS/src/disk_crypt.cxx14
-rw-r--r--dev/base/ReadMe.md2
-rw-r--r--dev/base/RunDLL64/build.json2
-rw-r--r--dev/base/RunDLL64/src/dll.cxx (renamed from dev/base/RunDLL64/src/LauncherMain.cxx)2
-rw-r--r--dev/base/RunXPCOM/build.json2
-rw-r--r--dev/base/RunXPCOM/src/xpcom.cxx (renamed from dev/base/RunXPCOM/src/LauncherMain.cxx)2
-rw-r--r--dev/zka/FSKit/NeFS.hxx2
-rw-r--r--dev/zka/KernelKit/CodeMgr.hxx2
-rw-r--r--dev/zka/KernelKit/PECodeMgr.hxx2
-rwxr-xr-xdev/zka/MoveAll.ARM64.sh2
-rwxr-xr-xdev/zka/MoveAll.X64.sh2
-rw-r--r--dev/zka/amd64-efi.make2
-rw-r--r--dev/zka/arm64-efi.make2
-rw-r--r--dev/zka/obj/.hgkeep (renamed from dev/zka/Objects/.hgkeep)0
22 files changed, 63 insertions, 118 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
deleted file mode 100644
index 6a8b4dfb..00000000
--- a/.vscode/c_cpp_properties.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "configurations": [
- {
- "name": "Kernel (Macintosh)",
- "includePath": [
- "${workspaceFolder}/Kernel/**",
- "${workspaceFolder}/Boot/**",
- "${workspaceFolder}/**"
- ],
- "defines": [
- "__ZKA__",
- "__NEWOSKRNL__",
- "Z_PREFIX",
- "__HAVE_ZKA_APIS__",
- "__FSKIT_USE_NEFS__",
- "__EFI_x86_64__",
- "__ATA_PIO__",
- "__ZKA_AMD64__",
- "__DEBUG__"
- ],
- "cStandard": "c17",
- "cppStandard": "c++20",
- "compilerPath": "/opt/homebrew/bin/x86_64-w64-mingw32-gcc",
- "intelliSenseMode": "gcc-x64"
- },
- {
- "name": "Kernel (Windows)",
- "includePath": [
- "${workspaceFolder}/Kernel/**",
- "${workspaceFolder}/Boot/**",
- "${workspaceFolder}/**"
- ],
- "defines": [
- "__ZKA__",
- "__NEWOSKRNL__",
- "Z_PREFIX",
- "__HAVE_ZKA_APIS__",
- "__FSKIT_USE_NEFS__",
- "__EFI_x86_64__",
- "__ATA_PIO__",
- "__ZKA_AMD64__",
- "__NEWOSLDR__",
- "__DEBUG__"
- ],
- "cStandard": "c17",
- "cppStandard": "c++20",
- "compilerPath": "C:/cygwin64/bin/x86_64-w64-mingw32-gcc.exe",
- "intelliSenseMode": "gcc-x64"
- }
- ],
- "version": 4
-}
diff --git a/dev/base/EncryptFS/EncryptFS.hxx b/dev/base/EncryptFS/EncryptFS.hxx
deleted file mode 100644
index 368df9ae..00000000
--- a/dev/base/EncryptFS/EncryptFS.hxx
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
- File: Encrypt.hxx
- Purpose: Encrypted File System
-
- Revision History:
-
- 8/8/2024: Added file (amlel)
-
-------------------------------------------- */
-
-#pragma once
-
-#include <FSKit/NeFS.hxx>
-
-namespace EncryptFS
-{
- using namespace Kernel;
-
-} \ No newline at end of file
diff --git a/dev/base/EncryptFS/ReadMe.md b/dev/base/EncryptFS/ReadMe.md
index 69968538..e84670cc 100644
--- a/dev/base/EncryptFS/ReadMe.md
+++ b/dev/base/EncryptFS/ReadMe.md
@@ -1,5 +1,11 @@
# ZKA Encrypted File System.
-This is ZKA's Encrypted file system DLL.
+### Purpose:
+
+This is ZKA's Encrypted File System DLL.
+
+### Building:
+
+`btb build.json`
###### (c) ZKA Technologies, all rights reserved.
diff --git a/dev/base/EncryptFS/build.json b/dev/base/EncryptFS/build.json
index efb86ab3..3b41b059 100644
--- a/dev/base/EncryptFS/build.json
+++ b/dev/base/EncryptFS/build.json
@@ -3,7 +3,7 @@
"compiler_std": "c++20",
"headers_path": ["../", "./"],
"sources_path": ["src/*.cxx"],
- "output_name": "encryptfs.dll",
+ "output_name": "efs.sys",
"compiler_flags": [
"-ffreestanding",
"-shared",
diff --git a/dev/base/EncryptFS/disk_crypt.hxx b/dev/base/EncryptFS/disk_crypt.hxx
new file mode 100644
index 00000000..0b80a930
--- /dev/null
+++ b/dev/base/EncryptFS/disk_crypt.hxx
@@ -0,0 +1,28 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+ File: Encrypt.hxx
+ Purpose: Encrypted File System
+
+ Revision History:
+
+ 8/8/2024: Added file (amlel)
+
+------------------------------------------- */
+
+#pragma once
+
+#include <FSKit/NeFS.hxx>
+
+/**************************************** */
+/// @brief Locks an EFS partition.
+/**************************************** */
+
+Kernel::Int32 efs_lock_partition(Kernel::Char* partition_name, Kernel::Char* password, Kernel::Size length);
+
+/**************************************** */
+/// @brief Unlocks an EFS partition.
+/**************************************** */
+
+Kernel::Int32 efs_unlock_partition(Kernel::Char* partition_name, Kernel::Char* password, Kernel::Size length);
diff --git a/dev/base/EncryptFS/source_deploy.xml b/dev/base/EncryptFS/source_deploy.xml
deleted file mode 100644
index 01bd14cd..00000000
--- a/dev/base/EncryptFS/source_deploy.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<SourceDeploy>
-<HiddenFiles>
- <SourceFile>src/*.cxx</SourceFile>
-</HiddenFiles>
-</SourceDeploy>
diff --git a/dev/base/EncryptFS/src/EncryptBlock.cxx b/dev/base/EncryptFS/src/EncryptBlock.cxx
deleted file mode 100644
index b3f2fc56..00000000
--- a/dev/base/EncryptFS/src/EncryptBlock.cxx
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
-------------------------------------------- */
-
-#include <cstddef>
-#include <cstdint>
-
-enum
-{
- eEFSFlagEncrypted = 0x3f,
- eEFSFlagEncryptedEPM = 0xf3,
-};
diff --git a/dev/base/EncryptFS/src/Key.cxx b/dev/base/EncryptFS/src/Key.cxx
deleted file mode 100644
index 166d04b3..00000000
--- a/dev/base/EncryptFS/src/Key.cxx
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
-------------------------------------------- */
-
-#include <new>
-#include <cstddef>
-#include <cstdint>
-
-typedef int32_t efs_encrypt_token_t;
-typedef void* efs_encrypted_blob_t;
diff --git a/dev/base/EncryptFS/src/disk_crypt.cxx b/dev/base/EncryptFS/src/disk_crypt.cxx
new file mode 100644
index 00000000..e8d64bfe
--- /dev/null
+++ b/dev/base/EncryptFS/src/disk_crypt.cxx
@@ -0,0 +1,14 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+------------------------------------------- */
+
+#include <base/EncryptFS/disk_crypt.hxx>
+
+enum
+{
+ eEFSFlagEncryptedFree = 0x00,
+ eEFSFlagEncryptedUnlock = 0x3f,
+ eEFSFlagEncryptedLock = 0xf3,
+};
diff --git a/dev/base/ReadMe.md b/dev/base/ReadMe.md
index df73d757..46443aea 100644
--- a/dev/base/ReadMe.md
+++ b/dev/base/ReadMe.md
@@ -1,5 +1,7 @@
# ZKA User DLLs/Programs.
+## Description:
+
- Used to provide features to a program from the sci.dll.
###### Copyright ZKA Technologies, all rights reserved.
diff --git a/dev/base/RunDLL64/build.json b/dev/base/RunDLL64/build.json
index a69dbb11..c53373a9 100644
--- a/dev/base/RunDLL64/build.json
+++ b/dev/base/RunDLL64/build.json
@@ -8,7 +8,7 @@
"-ffreestanding",
"-fno-rtti",
"-fno-exceptions",
- " -Wl,--subsystem=17"
+ "-Wl,--subsystem=17"
],
"cpp_macros": [
"__RUNDLL_AMD64__",
diff --git a/dev/base/RunDLL64/src/LauncherMain.cxx b/dev/base/RunDLL64/src/dll.cxx
index ed1ab65c..560a404d 100644
--- a/dev/base/RunDLL64/src/LauncherMain.cxx
+++ b/dev/base/RunDLL64/src/dll.cxx
@@ -2,7 +2,7 @@
typedef int (*MainKind)(int, char**);
-int WinMain(int argc, char* argv[])
+int main(int argc, char* argv[])
{
if (argc < 3)
return -1;
diff --git a/dev/base/RunXPCOM/build.json b/dev/base/RunXPCOM/build.json
index a932d733..45d249b8 100644
--- a/dev/base/RunXPCOM/build.json
+++ b/dev/base/RunXPCOM/build.json
@@ -8,7 +8,7 @@
"-ffreestanding",
"-fno-rtti",
"-fno-exceptions",
- " -Wl,--subsystem=17"
+ "-Wl,--subsystem=17"
],
"cpp_macros": [
"__SCM_AMD64__",
diff --git a/dev/base/RunXPCOM/src/LauncherMain.cxx b/dev/base/RunXPCOM/src/xpcom.cxx
index b6047435..9536b070 100644
--- a/dev/base/RunXPCOM/src/LauncherMain.cxx
+++ b/dev/base/RunXPCOM/src/xpcom.cxx
@@ -5,7 +5,7 @@ typedef SInt32 (*RPCProcKind)(IUnknown*);
/**
* @brief Main procedure for DLL runner.
*/
-int WinMain(int argc, char* argv[])
+int main(int argc, char* argv[])
{
if (argc < 4)
return -1;
diff --git a/dev/zka/FSKit/NeFS.hxx b/dev/zka/FSKit/NeFS.hxx
index 442b19ce..9e61c1c4 100644
--- a/dev/zka/FSKit/NeFS.hxx
+++ b/dev/zka/FSKit/NeFS.hxx
@@ -117,7 +117,7 @@ enum
kNeFSSolidStateDrive = 0xC1, // Solid State Drive
kNeFSOpticalDrive = 0x0C, // Blu-Ray/DVD
kNeFSMassStorageDevice = 0xCC, // USB
- kNeFSScsi = 0xC4, // SCSI Hard Drive
+ kNeFSScsiDrive = 0xC4, // SCSI Hard Drive
kNeFSFlashDrive = 0xC6,
kNeFSUnknown = 0xFF, // Unknown device.
kNeFSDriveCount = 7,
diff --git a/dev/zka/KernelKit/CodeMgr.hxx b/dev/zka/KernelKit/CodeMgr.hxx
index c8f9cca9..7b23c50e 100644
--- a/dev/zka/KernelKit/CodeMgr.hxx
+++ b/dev/zka/KernelKit/CodeMgr.hxx
@@ -3,7 +3,7 @@
Copyright ZKA Technologies.
File: CodeMgr.hpp
- Purpose: Code Mgr and Shared Objects.
+ Purpose: Code Mgr and DLL mgr.
Revision History:
diff --git a/dev/zka/KernelKit/PECodeMgr.hxx b/dev/zka/KernelKit/PECodeMgr.hxx
index 7b84fbc1..d905f45b 100644
--- a/dev/zka/KernelKit/PECodeMgr.hxx
+++ b/dev/zka/KernelKit/PECodeMgr.hxx
@@ -3,7 +3,7 @@
Copyright ZKA Technologies.
File: PECodeMgr.hxx
- Purpose: PE32+ Code Mgr and Shared Objects.
+ Purpose: PE32+ Code Mgr and DLL mgr.
Revision History:
diff --git a/dev/zka/MoveAll.ARM64.sh b/dev/zka/MoveAll.ARM64.sh
index 5198559f..35e0909e 100755
--- a/dev/zka/MoveAll.ARM64.sh
+++ b/dev/zka/MoveAll.ARM64.sh
@@ -4,4 +4,4 @@ for file in *.o; do
mv -- "$file" "${file%.o}.obj"
done
-mv *.obj Objects/
+mv *.obj obj/
diff --git a/dev/zka/MoveAll.X64.sh b/dev/zka/MoveAll.X64.sh
index 664ad472..1c135d06 100755
--- a/dev/zka/MoveAll.X64.sh
+++ b/dev/zka/MoveAll.X64.sh
@@ -4,4 +4,4 @@ for file in *.o; do
mv -- "$file" "${file%.o}.obj"
done
-mv *.obj HALKit/AMD64/*.obj Objects/ \ No newline at end of file
+mv *.obj HALKit/AMD64/*.obj obj/
diff --git a/dev/zka/amd64-efi.make b/dev/zka/amd64-efi.make
index a4bf313d..3db23e83 100644
--- a/dev/zka/amd64-efi.make
+++ b/dev/zka/amd64-efi.make
@@ -36,7 +36,7 @@ ASMFLAGS = -f win64
# Kernel subsystem is 17 and entrypoint is hal_init_platform
LDFLAGS = -e hal_init_platform --subsystem=17 --image-base 0x4000000
-LDOBJ = Objects/*.obj
+LDOBJ = obj/*.obj
# This file is the Kernel, responsible of task, memory, driver, sci, disk and device management.
KERNEL_IMG = newoskrnl.exe
diff --git a/dev/zka/arm64-efi.make b/dev/zka/arm64-efi.make
index bb5f73ee..be3f9960 100644
--- a/dev/zka/arm64-efi.make
+++ b/dev/zka/arm64-efi.make
@@ -20,7 +20,7 @@ endif
COPY = cp
LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib
-LDOBJ = Objects/*.obj
+LDOBJ = obj/*.obj
# This file is the Kernel, responsible of task management and memory.
KERNEL = newoskrnl.so
diff --git a/dev/zka/Objects/.hgkeep b/dev/zka/obj/.hgkeep
index e69de29b..e69de29b 100644
--- a/dev/zka/Objects/.hgkeep
+++ b/dev/zka/obj/.hgkeep