summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
Diffstat (limited to 'Private')
-rw-r--r--Private/KernelKit/DebugOutput.hpp2
-rw-r--r--Private/KernelKit/DeviceManager.hpp (renamed from Private/KernelKit/Device.hpp)0
-rw-r--r--Private/KernelKit/DriveManager.hpp2
-rw-r--r--Private/KernelKit/MSDOS.hpp13
-rw-r--r--Private/KernelKit/PCI/Dma.hpp91
-rw-r--r--Private/NetworkKit/NetworkDevice.hpp2
-rw-r--r--Private/NewBoot/Source/RuntimeMain.cxx20
-rw-r--r--Private/NewBoot/Source/makefile2
-rw-r--r--Private/Root/System/LookAndFeel.css46
-rw-r--r--Private/Source/DeviceManager.cxx (renamed from Private/Source/Device.cxx)2
-rw-r--r--Private/Source/DriveManager.cxx4
-rw-r--r--Private/StorageKit/NVME.hpp12
12 files changed, 127 insertions, 69 deletions
diff --git a/Private/KernelKit/DebugOutput.hpp b/Private/KernelKit/DebugOutput.hpp
index dd34df8e..6e651924 100644
--- a/Private/KernelKit/DebugOutput.hpp
+++ b/Private/KernelKit/DebugOutput.hpp
@@ -9,7 +9,7 @@
#pragma once
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
#include <NewKit/OwnPtr.hpp>
#include <NewKit/Stream.hpp>
diff --git a/Private/KernelKit/Device.hpp b/Private/KernelKit/DeviceManager.hpp
index 9a689b26..9a689b26 100644
--- a/Private/KernelKit/Device.hpp
+++ b/Private/KernelKit/DeviceManager.hpp
diff --git a/Private/KernelKit/DriveManager.hpp b/Private/KernelKit/DriveManager.hpp
index ac39c177..8e6aaefd 100644
--- a/Private/KernelKit/DriveManager.hpp
+++ b/Private/KernelKit/DriveManager.hpp
@@ -11,7 +11,7 @@
#define __DRIVE_MANAGER__
#include <CompilerKit/CompilerKit.hpp>
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
#include <NewKit/Defines.hpp>
#include <NewKit/String.hpp>
diff --git a/Private/KernelKit/MSDOS.hpp b/Private/KernelKit/MSDOS.hpp
index 4f098249..2276f3cb 100644
--- a/Private/KernelKit/MSDOS.hpp
+++ b/Private/KernelKit/MSDOS.hpp
@@ -16,6 +16,8 @@
#include <NewKit/Defines.hpp>
+#include "PE.hpp"
+
typedef HCore::UInt32 DosWord;
typedef HCore::Long DosLong;
@@ -41,4 +43,15 @@ typedef struct _DosHeader {
DosLong eLfanew;
} DosHeader, *DosHeaderPtr;
+namespace HCore {
+/// @brief Find the PE header inside the the blob.
+inline auto rt_find_exec_header(DosHeaderPtr ptrDos) -> VoidPtr {
+ if (!ptrDos) return nullptr;
+ if (ptrDos->eMagic[0] != kMagMz0) return nullptr;
+ if (ptrDos->eMagic[0] != kMagMz1) return nullptr;
+
+ return (VoidPtr)(&ptrDos->eLfanew + 1);
+}
+} // namespace HCore
+
#endif /* ifndef __MSDOS_EXEC__ */
diff --git a/Private/KernelKit/PCI/Dma.hpp b/Private/KernelKit/PCI/Dma.hpp
index 8e027179..0b4b55b8 100644
--- a/Private/KernelKit/PCI/Dma.hpp
+++ b/Private/KernelKit/PCI/Dma.hpp
@@ -9,73 +9,70 @@
#pragma once
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
#include <KernelKit/PCI/Device.hpp>
#include <NewKit/Array.hpp>
#include <NewKit/OwnPtr.hpp>
#include <NewKit/Ref.hpp>
-namespace HCore
-{
-enum class DmaKind
-{
- PCI, // Bus mastering is required to be turned on. Basiaclly a request
- // control system. 64-Bit access depends on the PAE bit and the device
- // (if Double Address Cycle is available)
- ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM.
- Invalid,
+namespace HCore {
+enum class DmaKind {
+ PCI, // Bus mastering is required to be turned on. Basiaclly a request
+ // control system. 64-Bit access depends on the PAE bit and the device
+ // (if Double Address Cycle is available)
+ ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM.
+ Invalid,
};
-class DMAWrapper final
-{
- public:
- explicit DMAWrapper() = delete;
+class DMAWrapper final {
+ public:
+ explicit DMAWrapper() = delete;
- public:
- explicit DMAWrapper(nullPtr) = delete;
- explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind)
- {
- }
+ public:
+ explicit DMAWrapper(nullPtr) = delete;
+ explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI)
+ : m_Address(Ptr), m_Kind(Kind) {}
- public:
- DMAWrapper &operator=(voidPtr Ptr);
+ public:
+ DMAWrapper &operator=(voidPtr Ptr);
- public:
- DMAWrapper &operator=(const DMAWrapper &) = default;
- DMAWrapper(const DMAWrapper &) = default;
+ public:
+ DMAWrapper &operator=(const DMAWrapper &) = default;
+ DMAWrapper(const DMAWrapper &) = default;
- public:
- ~DMAWrapper() = default;
+ public:
+ ~DMAWrapper() = default;
- template <class T> T *operator->();
+ template <class T>
+ T *operator->();
- template <class T> T *Get(const UIntPtr off = 0);
+ template <class T>
+ T *Get(const UIntPtr off = 0);
- public:
- operator bool();
- bool operator!();
+ public:
+ operator bool();
+ bool operator!();
- public:
- bool Write(const UIntPtr &bit, const UIntPtr &offset);
- UIntPtr Read(const UIntPtr &offset);
- Boolean Check(UIntPtr offset) const;
+ public:
+ bool Write(const UIntPtr &bit, const UIntPtr &offset);
+ UIntPtr Read(const UIntPtr &offset);
+ Boolean Check(UIntPtr offset) const;
- public:
- UIntPtr operator[](const UIntPtr &offset);
+ public:
+ UIntPtr operator[](const UIntPtr &offset);
- private:
- voidPtr m_Address{nullptr};
- DmaKind m_Kind{DmaKind::Invalid};
+ private:
+ voidPtr m_Address{nullptr};
+ DmaKind m_Kind{DmaKind::Invalid};
- private:
- friend class DMAFactory;
+ private:
+ friend class DMAFactory;
};
-class DMAFactory final
-{
- public:
- static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma);
+class DMAFactory final {
+ public:
+ static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma);
};
-} // namespace HCore
+} // namespace HCore
#include <KernelKit/PCI/Dma.inl>
diff --git a/Private/NetworkKit/NetworkDevice.hpp b/Private/NetworkKit/NetworkDevice.hpp
index a9edb09c..e631e868 100644
--- a/Private/NetworkKit/NetworkDevice.hpp
+++ b/Private/NetworkKit/NetworkDevice.hpp
@@ -10,7 +10,7 @@
#ifndef _INC_NETWORKDEVICE_HPP__
#define _INC_NETWORKDEVICE_HPP__
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
#include <NetworkKit/IP.hpp>
namespace HCore {
diff --git a/Private/NewBoot/Source/RuntimeMain.cxx b/Private/NewBoot/Source/RuntimeMain.cxx
index a520b980..a6e4015c 100644
--- a/Private/NewBoot/Source/RuntimeMain.cxx
+++ b/Private/NewBoot/Source/RuntimeMain.cxx
@@ -15,15 +15,7 @@
#include <KernelKit/PE.hpp>
#include <NewKit/Ref.hpp>
-namespace Detail {
-constexpr Int32 kBufferReadSz = 2048;
-
-auto FindPEHeader(DosHeaderPtr ptrDos) -> ExecHeaderPtr {
- if (!ptrDos) return nullptr;
-
- return (ExecHeaderPtr)(&ptrDos->eLfanew + 1);
-}
-} // namespace Detail
+#define kBufferReadSz 2048
EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
EfiSystemTable* SystemTable) {
@@ -54,17 +46,17 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
BFileReader img(L"HCOREKRNL.EXE", ImageHandle);
- img.Size() = Detail::kBufferReadSz;
+ img.Size() = kBufferReadSz;
img.Read();
if (img.Error() == BFileReader::kOperationOkay) {
BlobType blob = (BlobType)img.Blob();
- DosHeaderPtr ptrDos = reinterpret_cast<DosHeaderPtr>(blob);
- ExecHeaderPtr ptrHdr = Detail::FindPEHeader(ptrDos);
+ ExecHeaderPtr ptrHdr = reinterpret_cast<ExecHeaderPtr>(
+ HCore::rt_find_exec_header(reinterpret_cast<DosHeaderPtr>(blob)));
- if (ptrDos->eMagic[0] == kMagMz0 && ptrDos->eMagic[1] == kMagMz1 &&
- ptrHdr->mMachine == EFI::Platform() && ptrHdr->mMagic == kPeMagic) {
+ if (ptrHdr && ptrHdr->mMachine == EFI::Platform() &&
+ ptrHdr->mMagic == kPeMagic) {
if (ptrHdr->mNumberOfSections > 1) {
UInt64 MapKey = 0;
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 23678e9d..fab7453d 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -22,7 +22,7 @@ bootloader-amd64:
$(ASM) $(FLAG_ASM) HEl/AMD64/AMD64-VirtualMemory.asm
$(LD_GNU) $(OBJ) $(LD_FLAGS) -o HCoreLdr.exe
cp HCoreLdr.exe CDROM/EFI/BOOT/BOOTX64.EFI
- cp ../../HCoreKrnl.exe CDROM/HCOREKRNL.EXE
+ cp ../../HCoreKrnl.exe CDROM/HCOREKRNL.EXE && cp ../../Root/System/LookAndFeel.css CDROM/LOOK.CSS
.PHONY: run-efi-amd64
run-efi-amd64:
diff --git a/Private/Root/System/LookAndFeel.css b/Private/Root/System/LookAndFeel.css
new file mode 100644
index 00000000..44e38465
--- /dev/null
+++ b/Private/Root/System/LookAndFeel.css
@@ -0,0 +1,46 @@
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 240 10% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+ --primary: 240 5.9% 10%;
+ --primary-foreground: 0 0% 98%;
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: 240 5.9% 10%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+ --ring: 240 5.9% 10%;
+ --radius: 0.5rem;
+ }
+
+ .dark {
+ --background: 240 10% 3.9%;
+ --foreground: 0 0% 98%;
+ --card: 240 10% 3.9%;
+ --card-foreground: 0 0% 98%;
+ --popover: 240 10% 3.9%;
+ --popover-foreground: 0 0% 98%;
+ --primary: 0 0% 98%;
+ --primary-foreground: 240 5.9% 10%;
+ --secondary: 240 3.7% 15.9%;
+ --secondary-foreground: 0 0% 98%;
+ --muted: 240 3.7% 15.9%;
+ --muted-foreground: 240 5% 64.9%;
+ --accent: 240 3.7% 15.9%;
+ --accent-foreground: 0 0% 98%;
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 3.7% 15.9%;
+ --input: 240 3.7% 15.9%;
+ --ring: 240 4.9% 83.9%;
+ }
+}
diff --git a/Private/Source/Device.cxx b/Private/Source/DeviceManager.cxx
index ae72fdad..e5b84bd3 100644
--- a/Private/Source/Device.cxx
+++ b/Private/Source/DeviceManager.cxx
@@ -7,4 +7,4 @@
* ========================================================
*/
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx
index bc100a1a..371758b1 100644
--- a/Private/Source/DriveManager.cxx
+++ b/Private/Source/DriveManager.cxx
@@ -33,7 +33,7 @@ bool DriveSelector::Mount(DriveTraits *drive) {
fDrive = drive;
fDrive->fMount();
- kcout << "[Krnl] mounted: " << fDrive->fName << "\n";
+ kcout << "Mount: " << fDrive->fName << "\n";
return true;
}
@@ -49,7 +49,7 @@ DriveTraits *DriveSelector::Unmount() {
fDrive->fUnmount();
fDrive = nullptr;
- kcout << "[Krnl] unmounted: " << fDrive->fName << "\n";
+ kcout << "Unmount: " << fDrive->fName << "\n";
return drivePointer;
}
diff --git a/Private/StorageKit/NVME.hpp b/Private/StorageKit/NVME.hpp
index 1b638989..2e778883 100644
--- a/Private/StorageKit/NVME.hpp
+++ b/Private/StorageKit/NVME.hpp
@@ -9,7 +9,7 @@
#pragma once
-#include <KernelKit/Device.hpp>
+#include <KernelKit/DeviceManager.hpp>
#include <NewKit/OwnPtr.hpp>
namespace HCore {
@@ -37,4 +37,14 @@ class NVMEDevice : public DeviceInterface<NVMEPacket> {
private:
void (*fCleanup)(void);
};
+
+class NVMEPacket {
+ UIntPtr DataPtr;
+ SizeT DataSz;
+ UInt64 DriveID;
+
+ Boolean ErrorSet;
+ Boolean BusySet;
+ Boolean ReadySet;
+};
} // namespace HCore