diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-09 21:36:40 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-09 21:36:40 +0100 |
| commit | 0f8285983883048dbf19734c588473725c66f367 (patch) | |
| tree | d9ccd3b55cc31b1a9e1178320bf602936742a6ff | |
| parent | 0ea1827a392411eafae2ee9ebbfddbae92958f73 (diff) | |
Add NS.h file for CoreBoot, and open command.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | ReadMe.md | 3 | ||||
| -rw-r--r-- | dev/Kernel/FSKit/IndexableProperty.h | 2 | ||||
| -rw-r--r-- | dev/Kernel/FirmwareKit/CoreBoot/NS.h | 10 | ||||
| -rw-r--r-- | dev/Kernel/FirmwareKit/EFI/API.h | 16 | ||||
| -rw-r--r-- | dev/Kernel/FirmwareKit/EFI/NS.h | 5 | ||||
| -rw-r--r-- | dev/Kernel/KernelKit/User.h | 11 | ||||
| -rw-r--r-- | dev/Kernel/KernelKit/UserProcessScheduler.h | 2 | ||||
| -rw-r--r-- | dev/Kernel/src/User.cc | 8 | ||||
| -rw-r--r-- | public/tools/make_app/src/CLI.cc | 10 | ||||
| -rw-r--r-- | public/tools/open/dist/.keep (renamed from vendor/.keepme) | 0 | ||||
| -rw-r--r-- | public/tools/open/open.json | 12 | ||||
| -rw-r--r-- | public/tools/open/src/CLI.cc | 44 | ||||
| -rw-r--r-- | vendor/.keep | 0 | ||||
| m--------- | vendor/os-kit | 0 |
15 files changed, 97 insertions, 29 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..346af544 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/os-kit"] + path = vendor/os-kit + url = git@github.com:tq-corp/os-kit.git @@ -4,11 +4,10 @@ ZkaOS is designed for real time environements (such as servers or workstations.) -## Installation: +## Requirements - MinGW/GCC for the Kernel, Bootloader and the LibSCI. - Netwide Assembler, for the x64 assemblies if needed. -- The ToolchainKit, to embed a C++ suite in the OS. ### Installation diff --git a/dev/Kernel/FSKit/IndexableProperty.h b/dev/Kernel/FSKit/IndexableProperty.h index c4b12ad6..41dd6654 100644 --- a/dev/Kernel/FSKit/IndexableProperty.h +++ b/dev/Kernel/FSKit/IndexableProperty.h @@ -31,7 +31,7 @@ namespace Kernel : Property() { Kernel::KString strProp(kMaxPropLen); - strProp += "/Properties/Indexable"; + strProp += "/prop/indexable"; this->GetKey() = strProp; } diff --git a/dev/Kernel/FirmwareKit/CoreBoot/NS.h b/dev/Kernel/FirmwareKit/CoreBoot/NS.h new file mode 100644 index 00000000..7113b75c --- /dev/null +++ b/dev/Kernel/FirmwareKit/CoreBoot/NS.h @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Theater Quality Corp, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include <FirmwareKit/CoreBoot/CoreBoot.h> +#include <FirmwareKit/CoreBoot/NetBoot.h>
\ No newline at end of file diff --git a/dev/Kernel/FirmwareKit/EFI/API.h b/dev/Kernel/FirmwareKit/EFI/API.h index 4cf60df4..2634662d 100644 --- a/dev/Kernel/FirmwareKit/EFI/API.h +++ b/dev/Kernel/FirmwareKit/EFI/API.h @@ -36,10 +36,10 @@ namespace EFI /// @return inline Void Stop() noexcept { - while (1) + while (YES) { - rt_hlt(); rt_cli(); + rt_hlt(); } } @@ -55,14 +55,6 @@ Bascially frees everything we have in the EFI side. ST->BootServices->ExitBootServices(ImageHandle, MapKey); } - enum - { - kPartEPM, - kPartGPT, - kPartMBR, - kPartCnt, - }; - inline UInt32 Platform() noexcept { return kPeMachineAMD64; @@ -78,10 +70,10 @@ Bascially frees everything we have in the EFI side. { ST->ConOut->OutputString(ST->ConOut, L"\r*** STOP ***\r"); - ST->ConOut->OutputString(ST->ConOut, L"*** Error: "); + ST->ConOut->OutputString(ST->ConOut, L"*** ERROR: "); ST->ConOut->OutputString(ST->ConOut, ErrorCode); - ST->ConOut->OutputString(ST->ConOut, L", Reason: "); + ST->ConOut->OutputString(ST->ConOut, L" ***\r *** REASON: "); ST->ConOut->OutputString(ST->ConOut, Reason); ST->ConOut->OutputString(ST->ConOut, L" ***\r"); diff --git a/dev/Kernel/FirmwareKit/EFI/NS.h b/dev/Kernel/FirmwareKit/EFI/NS.h index ef061d2f..4eb76164 100644 --- a/dev/Kernel/FirmwareKit/EFI/NS.h +++ b/dev/Kernel/FirmwareKit/EFI/NS.h @@ -11,5 +11,10 @@ namespace Firmware::Detail::EFI { using namespace Kernel; + +EXTERN_C +{ #include <FirmwareKit/EFI/EFI.h> +} + } // namespace Firmware::Detail::EFI diff --git a/dev/Kernel/KernelKit/User.h b/dev/Kernel/KernelKit/User.h index 7cf26e1e..e629286f 100644 --- a/dev/Kernel/KernelKit/User.h +++ b/dev/Kernel/KernelKit/User.h @@ -12,7 +12,8 @@ #include <NewKit/KString.h> #include <NewKit/Defines.h> -///! We got the Super, standard user (%s format) and guest user, all are used to make authorization operations on the OS. +///! We got the Super, standard user (%s format) and guest user, +///! all are used to make authorization operations on the OS. #define kSuperUser "OS AUTHORITY/SUPER/%s" #define kGuestUser "OS AUTHORITY/GUEST/%s" #define kFmtUser "OS AUTHORITY/STD/%s" @@ -35,7 +36,7 @@ namespace Kernel kRingCount = 3, }; - typedef Char* usr_public_key_kind; + typedef Char* UserPublicKey; /// @brief User class. class User final @@ -69,16 +70,16 @@ namespace Kernel Bool IsSuperUser() noexcept; /// @brief Saves a password from the public key. - Bool Save(const usr_public_key_kind password) noexcept; + Bool Save(const UserPublicKey password) noexcept; /// @brief Checks if a password matches the **password**. /// @param password the password to check. - Bool Matches(const usr_public_key_kind password) noexcept; + Bool Matches(const UserPublicKey password) noexcept; private: UserRingKind mUserRing{UserRingKind::kRingStdUser}; Char mUserName[kMaxUserNameLen] = {0}; - Char mUserToken[kMaxUserTokenLen] = {0}; + Char mUserKey[kMaxUserTokenLen] = {0}; }; } // namespace Kernel diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.h b/dev/Kernel/KernelKit/UserProcessScheduler.h index 8212fdc2..79b06f7c 100644 --- a/dev/Kernel/KernelKit/UserProcessScheduler.h +++ b/dev/Kernel/KernelKit/UserProcessScheduler.h @@ -272,6 +272,8 @@ namespace Kernel ProcessID mProcessCount{0}; }; + typedef Array<UserThread, kSchedProcessLimitPerTeam> UserThreadArray; + using UserProcessRef = UserThread&; /// @brief Process scheduler class. diff --git a/dev/Kernel/src/User.cc b/dev/Kernel/src/User.cc index bf68231c..a1c3dfa2 100644 --- a/dev/Kernel/src/User.cc +++ b/dev/Kernel/src/User.cc @@ -78,7 +78,7 @@ namespace Kernel //////////////////////////////////////////////////////////// User::~User() = default; - Bool User::Save(const usr_public_key_kind password_to_fill) noexcept + Bool User::Save(const UserPublicKey password_to_fill) noexcept { if (!password_to_fill || *password_to_fill == 0) @@ -104,7 +104,7 @@ namespace Kernel // then store password. - rt_copy_memory(password, this->mUserToken, rt_string_len(password_to_fill)); + rt_copy_memory(password, this->mUserKey, rt_string_len(password_to_fill)); delete[] password; password = nullptr; @@ -114,7 +114,7 @@ namespace Kernel return Yes; } - Bool User::Matches(const usr_public_key_kind password_to_fill) noexcept + Bool User::Matches(const UserPublicKey password_to_fill) noexcept { if (!password_to_fill || *password_to_fill) @@ -141,7 +141,7 @@ namespace Kernel kcout << "User::Matches: Validating hashed passwords...\r"; // now check if the password matches. - if (rt_string_cmp(password, this->mUserToken, rt_string_len(this->mUserToken)) == 0) + if (rt_string_cmp(password, this->mUserKey, rt_string_len(this->mUserKey)) == 0) { kcout << "User::Matches: Password is valid.\r"; return Yes; diff --git a/public/tools/make_app/src/CLI.cc b/public/tools/make_app/src/CLI.cc index ed686294..cdf3a6b9 100644 --- a/public/tools/make_app/src/CLI.cc +++ b/public/tools/make_app/src/CLI.cc @@ -19,12 +19,12 @@ int main(int argc, char* argv[]) { if (strcmp(argv[i], "-h") == 0) { - std::cout << "make_container: Framework/Application Creation Tool.\n"; - std::cout << "make_container: © Theater Quality Corp, All rights reserved.\n"; + std::cout << "make_app: Framework/Application Creation Tool.\n"; + std::cout << "make_app: © Theater Quality Corp, All rights reserved.\n"; - std::cout << "make_container: -app: Application directory.\n"; - std::cout << "make_container: -steps: Steps directory.\n"; - std::cout << "make_container: -fwrk: Framework directory.\n"; + std::cout << "make_app: -app: Application directory.\n"; + std::cout << "make_app: -steps: Steps directory.\n"; + std::cout << "make_app: -fwrk: Framework directory.\n"; return EXIT_SUCCESS; } diff --git a/vendor/.keepme b/public/tools/open/dist/.keep index e69de29b..e69de29b 100644 --- a/vendor/.keepme +++ b/public/tools/open/dist/.keep diff --git a/public/tools/open/open.json b/public/tools/open/open.json new file mode 100644 index 00000000..71ef4bf0 --- /dev/null +++ b/public/tools/open/open.json @@ -0,0 +1,12 @@ +{ + "compiler_path": "g++", + "compiler_std": "c++20", + "headers_path": ["./"], + "sources_path": ["src/CLI.cc"], + "output_name": "./dist/open", + "cpp_macros": [ + "kOpenVersion=0x0100", + "kOpenVersionHighest=0x0100", + "kOpenVersionLowest=0x0100" + ] +} diff --git a/public/tools/open/src/CLI.cc b/public/tools/open/src/CLI.cc new file mode 100644 index 00000000..3fea9463 --- /dev/null +++ b/public/tools/open/src/CLI.cc @@ -0,0 +1,44 @@ +/* + * Created on Thu Oct 17 08:00:42 CEST 2024 + * + * Copyright (c) 2024 Theater Quality Corp + */ + +#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: © Theater Quality Corp, 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/vendor/.keep b/vendor/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/vendor/.keep diff --git a/vendor/os-kit b/vendor/os-kit new file mode 160000 +Subproject 0a1e7a297ad6c87ab211261667c1c376a974340 |
