summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-23 12:02:10 +0200
committerAmlal <amlal@zka.com>2024-07-23 12:02:10 +0200
commit274cba18b8f1c255ddcff2f5c14aab4d0c846820 (patch)
treeaa56d2223c79d447b85a2bfefdbaab90b25fc8fe /Kernel/Sources
parent8eee31685e4334415870bb00b11b6b0d29821f10 (diff)
[IMP] User class and current user global.
[REMOVE] ApplicationInterface struct. [IMP] DDK_STATUS_STRUCT data structure for driver events. Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Kernel/Sources')
-rw-r--r--Kernel/Sources/Main.cxx6
-rw-r--r--Kernel/Sources/User.cxx (renamed from Kernel/Sources/PermissionSelector.cxx)25
2 files changed, 21 insertions, 10 deletions
diff --git a/Kernel/Sources/Main.cxx b/Kernel/Sources/Main.cxx
index 92dac251..b0083730 100644
--- a/Kernel/Sources/Main.cxx
+++ b/Kernel/Sources/Main.cxx
@@ -63,7 +63,7 @@ namespace Kernel::Detail
const auto cDirCount = 9;
const char* cDirStr[cDirCount] = {
"\\Boot\\", "\\System\\", "\\Support\\", "\\Applications\\",
- "\\Users\\", "\\Library\\", "\\Mounted\\", "\\DCIM\\", "\\Applications\\Storage\\"};
+ "\\Users\\", "\\Library\\", "\\Mounted\\", "\\DCIM\\", "\\Applications\\Store\\"};
for (Kernel::SizeT dirIndx = 0UL; dirIndx < cDirCount; ++dirIndx)
{
@@ -188,6 +188,10 @@ namespace Kernel::Detail
/// @return void no return value.
STATIC Kernel::Void ke_user_switch(Kernel::Void)
{
+
+ Kernel::cRootUser = new User(RingKind::kRingSuperUser, kSuperUser);
+ Kernel::kcout << "newoskrnl: logged in as: " << Kernel::cRootUser->Name().CData() << Kernel::endl;
+
Kernel::kcout << "newoskrnl: " << cKernelVersion.GetKey().CData() << ": " << Kernel::number(cKernelVersion.GetValue()) << Kernel::endl;
}
} // namespace Kernel::Detail
diff --git a/Kernel/Sources/PermissionSelector.cxx b/Kernel/Sources/User.cxx
index 726f34e1..1deac5be 100644
--- a/Kernel/Sources/PermissionSelector.cxx
+++ b/Kernel/Sources/User.cxx
@@ -4,43 +4,50 @@
* Kernel
* Copyright ZKA Technologies, all rights reserved.
*
- * File: PermissionSelector.cpp
+ * File: User.cpp
* Purpose: Permission selectors.
*
* ========================================================
*/
-#include <KernelKit/PermissionSelector.hxx>
+#include <KernelKit/User.hxx>
#include <NewKit/KernelCheck.hpp>
/// bugs 0
namespace Kernel
{
- PermissionSelector::PermissionSelector(const Int32& sel)
+ User::User(const Int32& sel, const Char* userName)
: fRing((RingKind)sel)
{
- MUST_PASS(sel > 0);
+ MUST_PASS(sel >= 0);
+ this->fUserName += userName;
}
- PermissionSelector::PermissionSelector(const RingKind& ringKind)
+ User::User(const RingKind& ringKind, const Char* userName)
: fRing(ringKind)
{
+ this->fUserName += userName;
}
- PermissionSelector::~PermissionSelector() = default;
+ User::~User() = default;
- bool PermissionSelector::operator==(const PermissionSelector& lhs)
+ bool User::operator==(const User& lhs)
{
return lhs.fRing == this->fRing;
}
- bool PermissionSelector::operator!=(const PermissionSelector& lhs)
+ bool User::operator!=(const User& lhs)
{
return lhs.fRing != this->fRing;
}
- const RingKind& PermissionSelector::Ring() noexcept
+ const StringView User::Name() noexcept
+ {
+ return this->fUserName;
+ }
+
+ const RingKind& User::Ring() noexcept
{
return this->fRing;
}