diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 15:14:37 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 15:14:37 +0100 |
| commit | b89b9bc8ec4955f3eef3d34a4c917ace0a5cf2d9 (patch) | |
| tree | 4d82f613f7e2fbb306fb9ab8b86506b4334ebeee /Private/KernelKit | |
| parent | e8af9b5cdc8efd7eee7a53c6fd78918fa2b0a810 (diff) | |
Bootloader: Add support for Boot Services.
Kernel: Did refactor to code in Drive Manager, XPM has become EPM.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/KernelKit')
| -rw-r--r-- | Private/KernelKit/DriveManager.hpp | 4 | ||||
| -rw-r--r-- | Private/KernelKit/PCI/Dma.hpp | 95 | ||||
| -rw-r--r-- | Private/KernelKit/SharedObjectCore.hxx | 4 |
3 files changed, 51 insertions, 52 deletions
diff --git a/Private/KernelKit/DriveManager.hpp b/Private/KernelKit/DriveManager.hpp index b5c0ad0c..3d77dd56 100644 --- a/Private/KernelKit/DriveManager.hpp +++ b/Private/KernelKit/DriveManager.hpp @@ -28,8 +28,8 @@ enum kFloppyDisc = 0xCD, kOpticalDisc = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray kReadOnly = 0x10, // Read only drive - kXPMDrive = 0x11, // eXplicit Partition Map. - kXPTDrive = 0x12, // GPT w/ XPM partition. + kEPMDrive = 0x11, // Explicit Partition Map. + kEPTDrive = 0x12, // ESP w/ EPM partition. kMBRDrive = 0x13, // IBM PC classic partition scheme }; diff --git a/Private/KernelKit/PCI/Dma.hpp b/Private/KernelKit/PCI/Dma.hpp index 025192f0..87cd78cf 100644 --- a/Private/KernelKit/PCI/Dma.hpp +++ b/Private/KernelKit/PCI/Dma.hpp @@ -17,66 +17,65 @@ 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: - DMAWrapper() = delete; - - public: - DMAWrapper(nullPtr) = delete; - DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind) {} +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; - public: - DMAWrapper &operator=(voidPtr Ptr); + public: + explicit DMAWrapper(nullPtr) = delete; + explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) : m_Address(Ptr), m_Kind(Kind) + { + } - public: - DMAWrapper &operator=(const DMAWrapper &) = default; - DMAWrapper(const DMAWrapper &) = default; + public: + DMAWrapper &operator=(voidPtr Ptr); - public: - ~DMAWrapper() = default; + public: + DMAWrapper &operator=(const DMAWrapper &) = default; + DMAWrapper(const DMAWrapper &) = default; - template<class T> - T *operator->(); + public: + ~DMAWrapper() = default; - template<class T> - T *Get(const UIntPtr off = 0); + template <class T> T *operator->(); - public: - operator bool(); - bool operator!(); + template <class T> T *Get(const UIntPtr off = 0); - public: - bool Write(const UIntPtr &bit, const UIntPtr &offset); - UIntPtr Read(const UIntPtr &offset); - Boolean Check(UIntPtr offset) const; + public: + operator bool(); + bool operator!(); - public: - UIntPtr operator[](const UIntPtr &offset); + public: + bool Write(const UIntPtr &bit, const UIntPtr &offset); + UIntPtr Read(const UIntPtr &offset); + Boolean Check(UIntPtr offset) const; - private: - voidPtr m_Address{nullptr}; - DmaKind m_Kind{DmaKind::Invalid}; + public: + UIntPtr operator[](const UIntPtr &offset); - private: - friend class DMAFactory; - }; + private: + voidPtr m_Address{nullptr}; + DmaKind m_Kind{DmaKind::Invalid}; - class DMAFactory final - { - public: - static OwnPtr<IOBuf<Char*>> Construct(OwnPtr <DMAWrapper> &dma); + private: + friend class DMAFactory; +}; - }; +class DMAFactory final +{ + public: + static OwnPtr<IOBuf<Char *>> Construct(OwnPtr<DMAWrapper> &dma); +}; } // namespace hCore #include <KernelKit/PCI/Dma.inl> diff --git a/Private/KernelKit/SharedObjectCore.hxx b/Private/KernelKit/SharedObjectCore.hxx index 07b261d0..784e6e52 100644 --- a/Private/KernelKit/SharedObjectCore.hxx +++ b/Private/KernelKit/SharedObjectCore.hxx @@ -10,8 +10,8 @@ #ifndef __KERNELKIT_SHARED_OBJECT_CORE_HXX__ #define __KERNELKIT_SHARED_OBJECT_CORE_HXX__ -#include "CodeManager.hpp" -#include "PEF.hpp" +#include <KernelKit/CodeManager.hpp> +#include <KernelKit/PEF.hpp> #include <KernelKit/Loader.hpp> #include <NewKit/Defines.hpp> |
