diff options
Diffstat (limited to 'Private/NewBoot/BootKit')
| -rw-r--r-- | Private/NewBoot/BootKit/Arch/AHCI.hxx | 12 | ||||
| -rw-r--r-- | Private/NewBoot/BootKit/Arch/ATA.hxx | 11 | ||||
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 22 |
3 files changed, 27 insertions, 18 deletions
diff --git a/Private/NewBoot/BootKit/Arch/AHCI.hxx b/Private/NewBoot/BootKit/Arch/AHCI.hxx new file mode 100644 index 00000000..2e3739b5 --- /dev/null +++ b/Private/NewBoot/BootKit/Arch/AHCI.hxx @@ -0,0 +1,12 @@ +/* + * ======================================================== + * + * NewBoot + * Copyright Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include <Drivers/AHCI/Defines.hxx> diff --git a/Private/NewBoot/BootKit/Arch/ATA.hxx b/Private/NewBoot/BootKit/Arch/ATA.hxx index 4042aaa9..4b4eb399 100644 --- a/Private/NewBoot/BootKit/Arch/ATA.hxx +++ b/Private/NewBoot/BootKit/Arch/ATA.hxx @@ -111,12 +111,6 @@ using namespace HCore; #define ATA_ADDRESS3(x) (x + 5) #define ATA_COMMAND(x) (x + 7) -Boolean ATAInitDriver(UInt8 Bus, UInt8 Drv); -Void ATAWait(UInt16 IO); -Void ATAReadLba(UInt32 Lba, UInt8 Bus, Boolean Master, wchar_t* Buf, - SizeT Offset); -Void ATAWriteLba(UInt32 Lba, UInt8 Bus, Boolean Master, wchar_t* Buf, - SizeT Offset); Boolean ATAIsDetected(Void); class BATADevice final { @@ -134,7 +128,10 @@ class BATADevice final { struct ATATraits final { SizeT mBase{1024}; UInt16 mBus{kPrimary}; - Boolean mMaster{true}; + UInt8 mMaster{0}; + Boolean mErr{false}; + + operator bool() { return !mErr; } }; operator bool() { return ATAIsDetected(); } diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 6fdbacaf..d1584d8a 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -56,13 +56,13 @@ HCore::SizeT BSetMem(CharacterType *src, const CharacterType byte, const HCore::SizeT len); /** - * @brief BootKit Image Reader class - * Reads using the UEFI Simple File protocol. + * @brief BootKit File Reader class + * Reads using the New Filesystem Boot partition. */ -class BImageReader final { +class BFileReader final { public: - explicit BImageReader(const CharacterType *path); - ~BImageReader() = default; + explicit BFileReader(const CharacterType *path); + ~BFileReader() = default; HCore::VoidPtr Fetch(SizeT &size); @@ -78,8 +78,8 @@ class BImageReader final { Int32 &Error() { return mErrorCode; } public: - BImageReader &operator=(const BImageReader &) = default; - BImageReader(const BImageReader &) = default; + BFileReader &operator=(const BFileReader &) = default; + BFileReader(const BFileReader &) = default; private: Int32 mErrorCode{kOperationOkay}; @@ -115,21 +115,21 @@ inline void Out32(UInt16 port, UInt32 value) { } inline UInt8 In8(UInt16 port) { - UInt8 value = 0UL; + UInt8 value; asm volatile("inb %1, %%al" : "=a"(value) : "Nd"(port) : "memory"); return value; } inline UInt16 In16(UInt16 port) { - UInt16 value = 0UL; - asm volatile("in %%dx, %%ax" : "=a"(value) : "d"(port)); + UInt16 value; + asm volatile("inw %%dx, %%ax" : "=a"(value) : "d"(port)); return value; } inline UInt32 In32(UInt16 port) { - UInt32 value = 0UL; + UInt32 value; asm volatile("inl %1, %%eax" : "=a"(value) : "Nd"(port) : "memory"); return value; |
