summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-09 21:36:40 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-09 21:36:40 +0100
commit0f8285983883048dbf19734c588473725c66f367 (patch)
treed9ccd3b55cc31b1a9e1178320bf602936742a6ff /dev/Kernel
parent0ea1827a392411eafae2ee9ebbfddbae92958f73 (diff)
Add NS.h file for CoreBoot, and open command.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel')
-rw-r--r--dev/Kernel/FSKit/IndexableProperty.h2
-rw-r--r--dev/Kernel/FirmwareKit/CoreBoot/NS.h10
-rw-r--r--dev/Kernel/FirmwareKit/EFI/API.h16
-rw-r--r--dev/Kernel/FirmwareKit/EFI/NS.h5
-rw-r--r--dev/Kernel/KernelKit/User.h11
-rw-r--r--dev/Kernel/KernelKit/UserProcessScheduler.h2
-rw-r--r--dev/Kernel/src/User.cc8
7 files changed, 32 insertions, 22 deletions
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;