summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-23 09:03:11 +0200
committerAmlal <amlal@zka.com>2024-07-23 09:03:11 +0200
commit8eee31685e4334415870bb00b11b6b0d29821f10 (patch)
tree29a808acfdcf6b2319b0413adbc8be693a462779
parent76d27cbde9371ded3c3b10cb45b223d68d58374b (diff)
[MHR-36] NVME driver improvements, add RLE flag for NewFS.
NVME: - Rename NVME.hxx to Defines.hxx, inside NVME module. NewFS: - Add RLE flag to NewFS. Which marks catalog as compressed. Meta: - Remove unused headers. - Use Mahrouss API version for kernel version. Signed-off-by: Amlal <amlal@zka.com>
-rw-r--r--Boot/BootKit/Vendor/Qr.hxx1
-rw-r--r--Boot/Sources/HEL/AMD64/BootMain.cxx1
-rw-r--r--Kernel/FSKit/NewFS.hxx2
-rw-r--r--Kernel/HALKit/AMD64/HalKernelMain.cxx2
-rw-r--r--Kernel/HALKit/AMD64/PCI/PCI.cxx2
-rw-r--r--Kernel/KernelKit/PCI/Iterator.hpp7
-rw-r--r--Kernel/KernelKit/PCI/PCI.hxx (renamed from Kernel/KernelKit/PCI/PCI.hpp)11
-rw-r--r--Kernel/Modules/NVME/Defines.hxx (renamed from Kernel/Modules/NVME/NVME.hxx)19
-rw-r--r--Kernel/NewKit/Macros.hpp2
9 files changed, 31 insertions, 16 deletions
diff --git a/Boot/BootKit/Vendor/Qr.hxx b/Boot/BootKit/Vendor/Qr.hxx
index 0571aa7c..8799d824 100644
--- a/Boot/BootKit/Vendor/Qr.hxx
+++ b/Boot/BootKit/Vendor/Qr.hxx
@@ -1,7 +1,6 @@
#ifndef QR_HXX
#define QR_HXX
-#include "BootKit/BootKit.hxx"
extern "C" {
#include <math.h>
#include <stddef.h>
diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx
index 15c9b7e5..5828e340 100644
--- a/Boot/Sources/HEL/AMD64/BootMain.cxx
+++ b/Boot/Sources/HEL/AMD64/BootMain.cxx
@@ -4,7 +4,6 @@
------------------------------------------- */
-#include "NewKit/Json.hxx"
#include <BootKit/BootKit.hxx>
#include <BootKit/Rsrc/NewBoot.rsrc>
#include <Modules/CoreCG/CoreCG.hxx>
diff --git a/Kernel/FSKit/NewFS.hxx b/Kernel/FSKit/NewFS.hxx
index 86bd3be3..f8924fee 100644
--- a/Kernel/FSKit/NewFS.hxx
+++ b/Kernel/FSKit/NewFS.hxx
@@ -65,6 +65,8 @@ default.
#define kNewFSCatalogKindDevice (9)
#define kNewFSCatalogKindLock (10)
+#define kNewFSCatalogKindRLE (11)
+
#define kNewFSSeparator '\\'
#define kNewFSUpDir ".."
diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx
index ad031b8b..1628e5e9 100644
--- a/Kernel/HALKit/AMD64/HalKernelMain.cxx
+++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx
@@ -221,7 +221,7 @@ EXTERN_C void hal_init_platform(
strVer += "\\Properties\\KernelVersion";
cKernelVersion.GetKey() = strVer;
- cKernelVersion.GetValue() = 100;
+ cKernelVersion.GetValue() = __MAHROUSS__;
Kernel::StringView strAutoMount(cMaxPropLen);
strAutoMount += "\\Properties\\AutoMountFS?";
diff --git a/Kernel/HALKit/AMD64/PCI/PCI.cxx b/Kernel/HALKit/AMD64/PCI/PCI.cxx
index 3fd3f193..d15b1b9a 100644
--- a/Kernel/HALKit/AMD64/PCI/PCI.cxx
+++ b/Kernel/HALKit/AMD64/PCI/PCI.cxx
@@ -4,4 +4,4 @@
------------------------------------------- */
-#include <KernelKit/PCI/PCI.hpp>
+#include <KernelKit/PCI/PCI.hxx>
diff --git a/Kernel/KernelKit/PCI/Iterator.hpp b/Kernel/KernelKit/PCI/Iterator.hpp
index 0d6d894c..8c2df3b4 100644
--- a/Kernel/KernelKit/PCI/Iterator.hpp
+++ b/Kernel/KernelKit/PCI/Iterator.hpp
@@ -1,3 +1,9 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies
+
+------------------------------------------- */
+
#ifndef __PCI_ITERATOR_HPP__
#define __PCI_ITERATOR_HPP__
@@ -22,7 +28,6 @@ namespace Kernel::PCI
explicit Iterator(const Types::PciDeviceKind& deviceType);
Iterator& operator=(const Iterator&) = default;
-
Iterator(const Iterator&) = default;
~Iterator();
diff --git a/Kernel/KernelKit/PCI/PCI.hpp b/Kernel/KernelKit/PCI/PCI.hxx
index b2d54a34..e75215d6 100644
--- a/Kernel/KernelKit/PCI/PCI.hpp
+++ b/Kernel/KernelKit/PCI/PCI.hxx
@@ -3,16 +3,17 @@
Copyright ZKA Technologies
------------------------------------------- */
+
#pragma once
#include <NewKit/Defines.hpp>
-#define PCI_CONFIG_ADDRESS (0xCF8)
-#define PCI_CONFIG_DATA (0xCFC)
+#define cPCIConfigAddressPort (0xCF8)
+#define cPCIConfigDataPort (0xCFC)
-#define PCI_DEVICE_COUNT (32)
-#define PCI_FUNC_COUNT (8)
-#define PCI_BUS_COUNT (255)
+#define cPCIDeviceCount (32)
+#define cPCIFuncCount (8)
+#define cPCIBusCount (255)
namespace Kernel::PCI
{
diff --git a/Kernel/Modules/NVME/NVME.hxx b/Kernel/Modules/NVME/Defines.hxx
index b306af4b..50960ed5 100644
--- a/Kernel/Modules/NVME/NVME.hxx
+++ b/Kernel/Modules/NVME/Defines.hxx
@@ -2,6 +2,11 @@
Copyright ZKA Technologies
+ Revision History:
+
+ ??/??/24: Added file (amlel)
+ 23 Jul 24: Update filename to Defines.hxx and using ALIGN_NVME for NVME structs. (amlel)
+
------------------------------------------- */
#ifndef __MODULE_NVME_HXX__
@@ -11,13 +16,13 @@
/// TODO: checklist in: https://wiki.osdev.org/NVMe
-#define mNVMEAlign ATTRIBUTE(aligned(sizeof(Kernel::NVMEInt32)))
+#define ALIGN_NVME ATTRIBUTE(aligned(sizeof(Kernel::NVMEInt32)))
namespace Kernel
{
typedef UInt32 NVMEInt32;
- struct NVMEBar0 final
+ struct ALIGN_NVME NVMEBar0 final
{
NVMEInt32 fCap;
NVMEInt32 fVer;
@@ -30,7 +35,7 @@ namespace Kernel
NVMEInt32 fAdminCompletionQueue;
};
- struct NVMEQueue final
+ struct ALIGN_NVME NVMEQueue final
{
NVMEInt32 fOpcode;
NVMEInt32 fNSID;
@@ -50,7 +55,9 @@ namespace Kernel
};
template <Int32 Opcode>
- inline Bool nvme_create_admin_command(NVMEQueue* entry, UInt32 nsid, UInt32 prpTransfer[3], UInt32 startingLba[2], UInt32 lowTransferBlocks)
+ inline Bool nvme_create_admin_command(NVMEQueue* entry, UInt32 nsid,
+ UInt32 prpTransfer[3],
+ UInt32 startingLba[2], UInt32 lowTransferBlocks)
{
if (entry == nullptr)
return false;
@@ -70,7 +77,9 @@ namespace Kernel
}
template <Int32 Opcode>
- inline Bool nvme_create_admin_command(NVMEQueue* entry, UInt64 baseAddress, UInt32 identLoAndQueueSizeHi, UInt32 flagsLoAndQueueComplIdHi, UInt32 identify, Bool provideIdentify = false, Bool namespaceIdentify = false)
+ inline Bool nvme_create_io_command(NVMEQueue* entry, UInt64 baseAddress,
+ UInt32 identLoAndQueueSizeHi, UInt32 flagsLoAndQueueComplIdHi,
+ UInt32 identify, Bool provideIdentify = false, Bool namespaceIdentify = false)
{
if (entry == nullptr)
return false;
diff --git a/Kernel/NewKit/Macros.hpp b/Kernel/NewKit/Macros.hpp
index a8749cf4..ba636874 100644
--- a/Kernel/NewKit/Macros.hpp
+++ b/Kernel/NewKit/Macros.hpp
@@ -53,7 +53,7 @@
#endif // #ifndef ATTRIBUTE
#ifndef __MAHROUSS__
-#define __MAHROUSS__ (202401)
+#define __MAHROUSS__ (202404)
#endif // !__MAHROUSS__
#ifndef EXTERN_C