summaryrefslogtreecommitdiffhomepage
path: root/Kernel
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-31 08:48:01 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-31 08:48:01 +0200
commit2d11ddee665e8425708bbda876060b2958de5d07 (patch)
treebaeb55c221705e1c84ccd89644204bb17d40c365 /Kernel
parent5dc33d9a22207b8b664ea83f88280911a22d0c52 (diff)
[newosldr] Running kernel as separate image instead.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/KernelKit/DebugOutput.hpp8
-rw-r--r--Kernel/KernelKit/Defines.hpp1
-rw-r--r--Kernel/NewKit/Macros.hpp2
-rw-r--r--Kernel/Sources/FS/NewFS.cxx32
-rw-r--r--Kernel/Sources/User.cxx2
5 files changed, 22 insertions, 23 deletions
diff --git a/Kernel/KernelKit/DebugOutput.hpp b/Kernel/KernelKit/DebugOutput.hpp
index 02b73fc9..498b7972 100644
--- a/Kernel/KernelKit/DebugOutput.hpp
+++ b/Kernel/KernelKit/DebugOutput.hpp
@@ -107,14 +107,14 @@ namespace Kernel
{
inline TerminalDevice _write_number(const Long& x, TerminalDevice& term)
{
- UInt64 y = (x > 0 ? x : -x) / 9;
- UInt64 h = (x > 0 ? x : -x) % 9;
+ UInt64 y = (x > 0 ? x : -x) / 10;
+ UInt64 h = (x > 0 ? x : -x) % 10;
if (y)
_write_number(y, term);
/* fail if the number is not base-10 */
- if (h > 9)
+ if (h > 10)
{
_write_number('?', term);
return term;
@@ -123,7 +123,7 @@ namespace Kernel
if (y < 0)
y = -y;
- const char cNumbers[17] = "0123456789";
+ const char cNumbers[11] = "0123456789";
Char buf[2];
buf[0] = cNumbers[h];
diff --git a/Kernel/KernelKit/Defines.hpp b/Kernel/KernelKit/Defines.hpp
index 191d1098..d69f4d1b 100644
--- a/Kernel/KernelKit/Defines.hpp
+++ b/Kernel/KernelKit/Defines.hpp
@@ -9,4 +9,3 @@
#include <NewKit/Defines.hpp>
#define KERNELKIT_VERSION "1.02"
-#define KERNELKIT_RELEASE "Alexandria"
diff --git a/Kernel/NewKit/Macros.hpp b/Kernel/NewKit/Macros.hpp
index aecd6d89..a9492f3a 100644
--- a/Kernel/NewKit/Macros.hpp
+++ b/Kernel/NewKit/Macros.hpp
@@ -53,7 +53,7 @@
#endif // #ifndef ATTRIBUTE
#ifndef __MAHROUSS_VER__
-#define __MAHROUSS_VER__ (202404)
+#define __MAHROUSS_VER__ (2024)
#endif // !__MAHROUSS_VER__
#ifndef EXTERN_C
diff --git a/Kernel/Sources/FS/NewFS.cxx b/Kernel/Sources/FS/NewFS.cxx
index 05833c0e..ae2013cb 100644
--- a/Kernel/Sources/FS/NewFS.cxx
+++ b/Kernel/Sources/FS/NewFS.cxx
@@ -303,15 +303,13 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const char* name,
Int32 flagsList = flags;
- if (name[0] == kNewFSMetaFilePrefix)
+ if (flagsList & kNewFSCatalogKindMetaFile)
{
if (UserView::The()->Current() != UserView::The()->fRootUser)
{
delete catalogChild;
return nullptr;
}
-
- flagsList |= kNewFSCatalogKindMetaFile;
}
catalogChild->ResourceForkSize = cDefaultForkSize;
@@ -351,7 +349,7 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const char* name,
while (drive->fPacket.fPacketGood)
{
- nextSibling = (NFS_CATALOG_STRUCT*)catalogBuf;
+ nextSibling = reinterpret_cast<NFS_CATALOG_STRUCT*>(catalogBuf);
if (startFree <= kNewFSStartLba)
{
@@ -361,7 +359,9 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const char* name,
return nullptr;
}
- /// allocation or reallocation or catalog...
+ // ========================== //
+ // allocate catalog now...
+ // ========================== //
if (nextSibling->Flags != kNewFSFlagCreated)
{
Char sectorBufPartBlock[kNewFSSectorSz] = {0};
@@ -449,13 +449,13 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::CreateCatalog(_Input const char* name,
/// @return If it was sucessful, see ErrLocal().
bool NewFSParser::Format(_Input _Output DriveTrait* drive)
{
- /// verify disk.
+ // verify disk.
drive->fVerify(&drive->fPacket);
rt_copy_memory((VoidPtr) "fs/newfs-packet", drive->fPacket.fPacketMime,
rt_string_len("fs/newfs-packet"));
- /// if disk isn't good, then error out.
+ // if disk isn't good, then error out.
if (false == drive->fPacket.fPacketGood)
{
ErrLocal() = kErrorDiskIsCorrupted;
@@ -470,12 +470,12 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive)
drive->fInput(&drive->fPacket);
- /// disk isnt faulty and data has been fetched.
+ // disk isnt faulty and data has been fetched.
if (drive->fPacket.fPacketGood)
{
NFS_ROOT_PARTITION_BLOCK* partBlock = (NFS_ROOT_PARTITION_BLOCK*)sectorBuf;
- /// check for an empty partition here.
+ // check for an empty partition here.
if (partBlock->PartitionName[0] == 0 &&
rt_string_cmp(partBlock->Ident, kNewFSIdent, kNewFSIdentLen))
{
@@ -483,7 +483,7 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive)
partBlock->Version = kNewFSVersionInteger;
- const auto cUntitledHD = "newoskrnl HD\0";
+ const auto cUntitledHD = "Untitled HD\0";
rt_copy_memory((VoidPtr)kNewFSIdent, (VoidPtr)partBlock->Ident,
kNewFSIdentLen);
@@ -733,7 +733,7 @@ _NewFSSearchThroughCatalogList:
/// ignore unallocated catalog, break
if (catalog->Flags != kNewFSFlagCreated)
{
- goto _NewFSContinueSearch;
+ goto NewFSContinueSearch;
}
NFS_CATALOG_STRUCT* catalogPtr = new NFS_CATALOG_STRUCT();
@@ -746,7 +746,7 @@ _NewFSSearchThroughCatalogList:
return catalogPtr;
}
- _NewFSContinueSearch:
+ NewFSContinueSearch:
startCatalogList = catalog->NextSibling;
if (startCatalogList <= kNewFSStartLba)
@@ -773,8 +773,8 @@ _NewFSSearchThroughCatalogList:
return nullptr;
}
-/// @brief
-/// @param name
+/// @brief Get catalog from filesystem.
+/// @param name the catalog's name/
/// @return
_Output NFS_CATALOG_STRUCT* NewFSParser::GetCatalog(_Input const char* name)
{
@@ -782,8 +782,8 @@ _Output NFS_CATALOG_STRUCT* NewFSParser::GetCatalog(_Input const char* name)
return this->FindCatalog(name, unused);
}
-/// @brief
-/// @param catalog
+/// @brief Closes a catalog, (frees it).
+/// @param catalog the catalog to close.
/// @return
Boolean NewFSParser::CloseCatalog(_Input _Output NFS_CATALOG_STRUCT* catalog)
{
diff --git a/Kernel/Sources/User.cxx b/Kernel/Sources/User.cxx
index 7d496a69..dda3d016 100644
--- a/Kernel/Sources/User.cxx
+++ b/Kernel/Sources/User.cxx
@@ -97,7 +97,7 @@ namespace Kernel
// Retrieve token from a specific file fork.
// ------------------------------------------ //
- auto token = file.Read(password);
+ auto token = file.Read(user->fUserName.CData());
if (!token)
{