summaryrefslogtreecommitdiffhomepage
path: root/public/tools
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-14 11:52:02 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-14 11:54:18 +0100
commit99826c21b9da1c3a74fd8b3ebc08c7f8dbfadd30 (patch)
tree6cfa8f7d18ed018917ea5609aeba1d870cd4e27a /public/tools
parent39d565d61bb9f9926806bb87abb48f93d0b981f8 (diff)
T& Labs's ZKA, Multi-Processor Operating System.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'public/tools')
-rw-r--r--public/tools/make_app/Common.h2
-rw-r--r--public/tools/make_app/Framework.h2
-rw-r--r--public/tools/make_app/Steps.h2
-rw-r--r--public/tools/make_app/make_app.json2
-rw-r--r--public/tools/make_app/src/CommandLine.cc (renamed from public/tools/make_app/src/CLI.cc)6
-rw-r--r--public/tools/open/open.json5
-rw-r--r--public/tools/open/src/CLI.cc44
-rw-r--r--public/tools/open/src/CommandLine.cc49
8 files changed, 59 insertions, 53 deletions
diff --git a/public/tools/make_app/Common.h b/public/tools/make_app/Common.h
index 17ec3d2d..cb3ec977 100644
--- a/public/tools/make_app/Common.h
+++ b/public/tools/make_app/Common.h
@@ -1,6 +1,6 @@
/**
Sat Oct 26 07:03:28 AM CEST 2024
- (c) t& Corporation.
+ (c) t& Labs.
*/
#ifndef APPS_COMMON_H
diff --git a/public/tools/make_app/Framework.h b/public/tools/make_app/Framework.h
index 5a000c9d..79377181 100644
--- a/public/tools/make_app/Framework.h
+++ b/public/tools/make_app/Framework.h
@@ -1,6 +1,6 @@
/**
Thu Oct 17 07:57:43 CEST 2024
- (c) t& Corporation.
+ (c) t& Labs.
*/
#ifndef APPS_FRAMEWORK_H
diff --git a/public/tools/make_app/Steps.h b/public/tools/make_app/Steps.h
index 217c57bb..81d2cc4f 100644
--- a/public/tools/make_app/Steps.h
+++ b/public/tools/make_app/Steps.h
@@ -1,6 +1,6 @@
/**
Thu Oct 17 07:57:43 CEST 2024
- (c) t& Corporation.
+ (c) t& Labs.
*/
#ifndef APPS_STEPS_H
diff --git a/public/tools/make_app/make_app.json b/public/tools/make_app/make_app.json
index ba103467..abfe5cd3 100644
--- a/public/tools/make_app/make_app.json
+++ b/public/tools/make_app/make_app.json
@@ -2,7 +2,7 @@
"compiler_path": "g++",
"compiler_std": "c++20",
"headers_path": ["./"],
- "sources_path": ["src/CLI.cc"],
+ "sources_path": ["src/CommandLine.cc"],
"output_name": "./dist/make_app",
"cpp_macros": [
"kMKFVersion=0x0100",
diff --git a/public/tools/make_app/src/CLI.cc b/public/tools/make_app/src/CommandLine.cc
index 229645d8..064b11b1 100644
--- a/public/tools/make_app/src/CLI.cc
+++ b/public/tools/make_app/src/CommandLine.cc
@@ -1,7 +1,7 @@
/*
* Created on Thu Oct 17 08:00:42 CEST 2024
*
- * Copyright (c) 2024 t& Corporation
+ * Copyright (c) 2024 t& Labs
*/
#include <Framework.h>
@@ -20,10 +20,10 @@ int main(int argc, char* argv[])
if (strcmp(argv[i], "-h") == 0)
{
std::cout << "make_app: Framework/Application Creation Tool.\n";
- std::cout << "make_app: © t& Corporation, All rights reserved.\n";
+ std::cout << "make_app: © t& Labs, All rights reserved.\n";
std::cout << "make_app: -app: Application directory.\n";
- std::cout << "make_app: -steps: Steps directory.\n";
+ std::cout << "make_app: -steps: Steps (Setup pages) directory.\n";
std::cout << "make_app: -fwrk: Framework directory.\n";
return EXIT_SUCCESS;
diff --git a/public/tools/open/open.json b/public/tools/open/open.json
index 71ef4bf0..04012ab3 100644
--- a/public/tools/open/open.json
+++ b/public/tools/open/open.json
@@ -1,9 +1,10 @@
{
- "compiler_path": "g++",
+ "compiler_path": "cscc",
"compiler_std": "c++20",
"headers_path": ["./"],
- "sources_path": ["src/CLI.cc"],
+ "sources_path": ["src/CommandLine.cc"],
"output_name": "./dist/open",
+ "compiler_flags": "-lSCI",
"cpp_macros": [
"kOpenVersion=0x0100",
"kOpenVersionHighest=0x0100",
diff --git a/public/tools/open/src/CLI.cc b/public/tools/open/src/CLI.cc
deleted file mode 100644
index 2027b14d..00000000
--- a/public/tools/open/src/CLI.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created on Thu Oct 17 08:00:42 CEST 2024
- *
- * Copyright (c) 2024 t& Corporation
- */
-
-#include <iostream>
-#include <vector>
-
-/// @brief This program makes a framework directory for ZKA OS.
-
-int main(int argc, char* argv[])
-{
- if (argc == 1)
- return EXIT_FAILURE;
-
- for (size_t i = 1UL; i < argc; ++i)
- {
- if (strcmp(argv[i], "-h") == 0)
- {
- std::cout << "open: Open Application Tool.\n";
- std::cout << "open: © t& Corporation, All rights reserved.\n";
-
- std::cout << "open: -a: Application is taken as input.\n";
- std::cout << "open: -u: URL is taken as input.\n";
-
- return EXIT_SUCCESS;
- }
- else if (strcmp(argv[i], "-a") == 0)
- {
- const auto kBasePath = "/apps/packages/";
-
- return EXIT_SUCCESS;
- }
- else if (strcmp(argv[i], "-u") == 0)
- {
- const auto kBasePath = "/support/defaults/browser";
-
- return EXIT_SUCCESS;
- }
- }
-
- return EXIT_FAILURE;
-}
diff --git a/public/tools/open/src/CommandLine.cc b/public/tools/open/src/CommandLine.cc
new file mode 100644
index 00000000..64b4076b
--- /dev/null
+++ b/public/tools/open/src/CommandLine.cc
@@ -0,0 +1,49 @@
+/*
+ * Created on Thu Oct 17 08:00:42 CEST 2024
+ *
+ * Copyright (c) 2024 t& Labs
+ */
+
+#include <LibSCI/SCI.h>
+
+/// @brief This program opens an application from **OPEN_APP_BASE_PATH**
+
+#define OPEN_APP_APP_FLAG "-a"
+#define OPEN_APP_HELP_FLAG "-h"
+#define OPEN_APP_BASE_PATH "/app/"
+
+int main(int argc, char* argv[])
+{
+ if (argc == 1)
+ return EXIT_FAILURE;
+
+ for (SizeT i = 1UL; i < argc; ++i)
+ {
+ if (MmStrCmp(argv[i], OPEN_APP_HELP_FLAG) == 0)
+ {
+ ConOut(nullptr, "open: Open Tool.\n");
+ ConOut(nullptr, "open: © t& Labs, All rights reserved.\n");
+
+ ConOut(nullptr, "open: %s: Application is taken as input (opens a PEF/PE32+/ELF program depending on architecture).\n", OPEN_APP_APP_FLAG);
+
+ return EXIT_SUCCESS;
+ }
+ else if (MmStrCmp(argv[i], OPEN_APP_APP_FLAG) == 0)
+ {
+ if ((i + 1) == argc)
+ return EXIT_FAILURE;
+
+ Char base_path[FILE_MAX_LEN] = OPEN_APP_BASE_PATH;
+ MmCopyMemory(base_path + MmStrLen(OPEN_APP_BASE_PATH), argv[i + 1], MmStrLen(argv[i + 1]));
+
+ Bool ret = RtlSpawnProcess(base_path, 0, nullptr, nullptr, 0);
+
+ if (ret > 0)
+ return EXIT_SUCCESS;
+
+ break;
+ }
+ }
+
+ return EXIT_FAILURE;
+}