diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-09 20:31:40 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-09 20:34:16 +0100 |
| commit | af212d19d0b2f0fad608c78ca922d3db9cb326bd (patch) | |
| tree | 5a21ba40baa50909331db7a67f112cc9969e750e /Private | |
| parent | d9556c811b25a7c5533d1f61152ecb8863cfd042 (diff) | |
Kernel: See below.
- Rework some bootloader modules, will work on some.
- Rework GKit to look like the DOM on a browser.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private')
| -rw-r--r-- | Private/NewBoot/NetBoot/EfiModule.cxx (renamed from Private/NewBoot/NetBoot/module.cxx) | 8 | ||||
| -rw-r--r-- | Private/NewBoot/NetBoot/manifest.json | 6 | ||||
| -rw-r--r-- | Private/NewBoot/Source/CDROM/MAHROUSS/.keep | 0 | ||||
| -rw-r--r-- | Private/Source/PermissionSelector.cxx | 2 | ||||
| -rw-r--r-- | Private/StorageKit/ATA.hpp | 165 | ||||
| -rw-r--r-- | Private/StorageKit/NVME.hpp | 50 | ||||
| -rw-r--r-- | Private/StorageKit/PRDT.hpp | 2 |
7 files changed, 105 insertions, 128 deletions
diff --git a/Private/NewBoot/NetBoot/module.cxx b/Private/NewBoot/NetBoot/EfiModule.cxx index b7e4727f..a0ce13a5 100644 --- a/Private/NewBoot/NetBoot/module.cxx +++ b/Private/NewBoot/NetBoot/EfiModule.cxx @@ -7,7 +7,9 @@ * ======================================================== */ -extern "C" void __Module(const char* ip, long iplen) -{ - +#include <EFIKit/Api.hxx> +#include <EFIKit/EFI.hxx> + +extern "C" Int32 EfiMain(EfiHandlePtr handle, EfiSystemTable* SystemTable) { + return kEfiOk; } diff --git a/Private/NewBoot/NetBoot/manifest.json b/Private/NewBoot/NetBoot/manifest.json index 1a177877..8486cfc1 100644 --- a/Private/NewBoot/NetBoot/manifest.json +++ b/Private/NewBoot/NetBoot/manifest.json @@ -1,4 +1,4 @@ { - "pluginName": "internetBoot", - "description": "internetBoot your device from the network." -}
\ No newline at end of file + "pluginName": "interBoot", + "description": "Boot your device from your network infra." +} diff --git a/Private/NewBoot/Source/CDROM/MAHROUSS/.keep b/Private/NewBoot/Source/CDROM/MAHROUSS/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/NewBoot/Source/CDROM/MAHROUSS/.keep diff --git a/Private/Source/PermissionSelector.cxx b/Private/Source/PermissionSelector.cxx index 1943a567..34760b8f 100644 --- a/Private/Source/PermissionSelector.cxx +++ b/Private/Source/PermissionSelector.cxx @@ -5,7 +5,7 @@ * Copyright Mahrouss Logic, all rights reserved. * * File: PermissionSelector.cpp - * Purpose: Permission primitive type. + * Purpose: Permission selectors. * * ======================================================== */ diff --git a/Private/StorageKit/ATA.hpp b/Private/StorageKit/ATA.hpp index 279258ca..33b976ae 100644 --- a/Private/StorageKit/ATA.hpp +++ b/Private/StorageKit/ATA.hpp @@ -1,104 +1,87 @@ /* -* ======================================================== -* -* HCore -* Copyright Mahrouss Logic, all rights reserved. -* -* ======================================================== -*/ + * ======================================================== + * + * HCore + * Copyright Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ #pragma once +#include <KernelKit/DebugOutput.hpp> #include <KernelKit/PCI/Dma.hpp> #include <KernelKit/PCI/IO.hpp> #include <NewKit/Defines.hpp> #include <StorageKit/PRDT.hpp> -#include <KernelKit/DebugOutput.hpp> -namespace HCore -{ - enum class PATAType - { - kRead28, - kRead48, - kWrite28, - kWrite48, - kATAUnknown - }; - - const char* ata_read_28(ULong lba); - const char* ata_read_48(ULong lba); - - Int32 ata_write_48(ULong lba, const char *text = nullptr); - Int32 ata_write_28(ULong lba, const char *text = nullptr); - - class PATACommandManager final - { - public: - PATACommandManager() = default; - ~PATACommandManager() = default; - - PATACommandManager &operator=(const PATACommandManager &) = default; - PATACommandManager(const PATACommandManager &) = default; - - public: - static Ref<PATACommandManager> Shared() - { - static Ref<PATACommandManager> manager; - return manager; +namespace HCore { +enum class PATAType { kRead28, kRead48, kWrite28, kWrite48, kATAUnknown }; + +const char *ata_read_28(ULong lba); +const char *ata_read_48(ULong lba); + +Int32 ata_write_48(ULong lba, const char *text = nullptr); +Int32 ata_write_28(ULong lba, const char *text = nullptr); + +class PATACommandManager final { + public: + explicit PATACommandManager() = default; + ~PATACommandManager() = default; + + PATACommandManager &operator=(const PATACommandManager &) = default; + PATACommandManager(const PATACommandManager &) = default; + + public: + static Ref<PATACommandManager> Shared() { + static Ref<PATACommandManager> manager; + return manager; + } + + public: + template <PATAType Command> + ErrorOr<const char *> operator()(ULong lba, + const char *text = nullptr) noexcept { + switch (Command) { + case PATAType::kRead28: + return ErrorOr<const char *>(ata_read_28(lba)); + case PATAType::kRead48: + return ErrorOr<const char *>(ata_read_48(lba)); + case PATAType::kWrite28: { + if (text) { + ata_write_28(lba, text); + kcout << "ErrorOr<CT> ata_read<CT, Command>: Write ATA Command... " + "(Write28)\n"; + + return {}; } - public: - template <PATAType Command> - ErrorOr<const char*> operator()(ULong lba, const char *text = nullptr) noexcept - { - switch (Command) - { - case PATAType::kRead28: - return ErrorOr<const char*>(ata_read_28(lba)); - case PATAType::kRead48: - return ErrorOr<const char*>(ata_read_48(lba)); - case PATAType::kWrite28: - { - if (text) - { - ata_write_28(lba, text); - kcout << "ErrorOr<CT> ata_read<CT, Command>: Write ATA Command... " - "(Write28)\n"; - - return {}; - } - - kcout << "ErrorOr<CT> ata_read<CT, Command>: Bad ATA Command... " - "(Write28)\n"; - - return {}; - } - case PATAType::kWrite48: - { - if (text) - { - ata_write_48(lba, text); - kcout << "ErrorOr<CT> ata_read<CT, Command>: Write ATA Command... " - "(Write48)\n"; - - return {}; - } - - kcout << "ErrorOr<CT> ata_read<CT, Command>: Bad ATA Command... " - "(Write48)\n"; - - return {}; - } - case PATAType::kATAUnknown: - { - kcout << "ErrorOr<CT> ata_read<CT, Command>: Unknown ATA Command...\n"; - return {}; - } - } - - return ErrorOr<const char*>(nullptr); + kcout << "ErrorOr<CT> ata_read<CT, Command>: Bad ATA Command... " + "(Write28)\n"; + + return {}; + } + case PATAType::kWrite48: { + if (text) { + ata_write_48(lba, text); + kcout << "ErrorOr<CT> ata_read<CT, Command>: Write ATA Command... " + "(Write48)\n"; + + return {}; } - }; -} // namespace HCore + kcout << "ErrorOr<CT> ata_read<CT, Command>: Bad ATA Command... " + "(Write48)\n"; + + return {}; + } + case PATAType::kATAUnknown: { + kcout << "ErrorOr<CT> ata_read<CT, Command>: Unknown ATA Command...\n"; + return {}; + } + } + + return ErrorOr<const char *>(nullptr); + } +}; +} // namespace HCore diff --git a/Private/StorageKit/NVME.hpp b/Private/StorageKit/NVME.hpp index 0bfbef52..1b638989 100644 --- a/Private/StorageKit/NVME.hpp +++ b/Private/StorageKit/NVME.hpp @@ -6,43 +6,35 @@ * * ======================================================== */ - + #pragma once #include <KernelKit/Device.hpp> #include <NewKit/OwnPtr.hpp> -namespace HCore -{ - class NVMEPacket; - - class NVMEDevice : public DeviceInterface<NVMEPacket> - { - public: - NVMEDevice(void(*Out)(NVMEPacket outpacket), - void(*In)(NVMEPacket inpacket), - void(*Cleanup)(void)) - : DeviceInterface(Out, In), fCleanup(Cleanup) - {} - - virtual ~NVMEDevice() - { - if (fCleanup) - fCleanup(); - } +namespace HCore { +class NVMEPacket; - public: - NVMEDevice &operator=(const NVMEDevice &) = default; - NVMEDevice(const NVMEDevice &) = default; +class NVMEDevice : public DeviceInterface<NVMEPacket> { + public: + explicit NVMEDevice(void (*Out)(NVMEPacket outpacket), + void (*In)(NVMEPacket inpacket), void (*Cleanup)(void)) + : DeviceInterface(Out, In), fCleanup(Cleanup) {} - virtual const char *Name() const; + virtual ~NVMEDevice() { + if (fCleanup) fCleanup(); + } - public: - OwnPtr<NVMEPacket> operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); + public: + NVMEDevice &operator=(const NVMEDevice &) = default; + NVMEDevice(const NVMEDevice &) = default; - private: - void(*fCleanup)(void); + virtual const char *Name() const; + public: + OwnPtr<NVMEPacket> operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); - }; -} // namespace HCore + private: + void (*fCleanup)(void); +}; +} // namespace HCore diff --git a/Private/StorageKit/PRDT.hpp b/Private/StorageKit/PRDT.hpp index d269ee3a..fb7d81ff 100644 --- a/Private/StorageKit/PRDT.hpp +++ b/Private/StorageKit/PRDT.hpp @@ -16,7 +16,7 @@ namespace HCore { class PRDT final { public: - PRDT() = delete; + explicit PRDT() = delete; explicit PRDT(const UIntPtr &physAddr); ~PRDT(); |
