diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 20:00:41 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-26 20:01:41 +0100 |
| commit | 5ab8bb9c497f673a81da693e9aacc78210718000 (patch) | |
| tree | 3ae1d5fe040c2c09e92e121436a54650b0adcd35 /Private | |
| parent | 9a0c2664b0ca5634aa557b0761139cccfb0fe753 (diff) | |
Kernel: Implement more API calls.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private')
| -rw-r--r-- | Private/Builtins/AHCI/Defines.hxx | 19 | ||||
| -rw-r--r-- | Private/Builtins/AHCI/Interface.hxx | 28 | ||||
| -rw-r--r-- | Private/Builtins/ATA/Defines.hxx | 2 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/Storage/AHCI.cxx | 18 |
5 files changed, 37 insertions, 30 deletions
diff --git a/Private/Builtins/AHCI/Defines.hxx b/Private/Builtins/AHCI/Defines.hxx index c1d3c063..e1aa72ae 100644 --- a/Private/Builtins/AHCI/Defines.hxx +++ b/Private/Builtins/AHCI/Defines.hxx @@ -310,7 +310,24 @@ typedef struct HbaCmdTbl final { HCore::UInt8 cfis[64]; // Command FIS HCore::UInt8 acmd[16]; // ATAPI command, 12 or 16 bytes HCore::UInt8 rsv[48]; // Reserved - HbaPrdtEntry prdtEntries[1]; // Physical region descriptor table entries, 0 ~ 65535 + struct HbaPrdtEntry prdtEntries[1]; // Physical region descriptor table entries, 0 ~ 65535 } HbaCmdTbl; /* EOF */ + +#ifdef __KERNEL__ + +/// @brief Initializes an AHCI disk. +/// @param PortsImplemented the amount of port that have been detected. +/// @return +HCore::Boolean drv_ahci_init(HCore::UInt16& PortsImplemented); + +HCore::Boolean drv_ahci_detected(HCore::Void); + +HCore::Void drv_ahci_read(HCore::UInt64 Lba, HCore::UInt16 IO, HCore::UInt8 Master, HCore::Char* Buf, + HCore::SizeT SectorSz, HCore::SizeT Size); + +HCore::Void drv_ahci_write(HCore::UInt64 Lba, HCore::UInt16 IO, HCore::UInt8 Master, HCore::Char* Buf, + HCore::SizeT SectorSz, HCore::SizeT Size); + +#endif // ifdef __KERNEL__ diff --git a/Private/Builtins/AHCI/Interface.hxx b/Private/Builtins/AHCI/Interface.hxx deleted file mode 100644 index 0fef6992..00000000 --- a/Private/Builtins/AHCI/Interface.hxx +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - - File: Interface.hxx - Purpose: AHCI Interface. - - Revision History: - - 03/17/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include <AHCI/Defines.hxx> -#include <NewKit/Defines.hpp> -#include <ObjectKit/ObjectKit.hxx> -#include <HintKit/CompilerHint.hxx> - -#define kObjectAHCINamespace "AHCI\\" - -namespace HCore::Builtins { -/// @brief Returns an AHCI handle. -/// @param pointerAhciObject the handle to pass. -/// @return -inline Boolean HcGetHandleAHCI(_InOut ObjectRef* pointerAhciObject); -} // namespace HCore::Builtins
\ No newline at end of file diff --git a/Private/Builtins/ATA/Defines.hxx b/Private/Builtins/ATA/Defines.hxx index 01b67c42..fbb7c63c 100644 --- a/Private/Builtins/ATA/Defines.hxx +++ b/Private/Builtins/ATA/Defines.hxx @@ -142,4 +142,4 @@ HCore::Void drv_ata_read(HCore::UInt64 Lba, HCore::UInt16 IO, HCore::UInt8 Maste HCore::Void drv_ata_write(HCore::UInt64 Lba, HCore::UInt16 IO, HCore::UInt8 Master, HCore::Char* Buf, HCore::SizeT SectorSz, HCore::SizeT Size); -#endif // ifdef __KERNEL__
\ No newline at end of file +#endif // ifdef __KERNEL__ diff --git a/Private/HALKit/AMD64/Storage/.gitkeep b/Private/HALKit/AMD64/Storage/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Private/HALKit/AMD64/Storage/.gitkeep +++ /dev/null diff --git a/Private/HALKit/AMD64/Storage/AHCI.cxx b/Private/HALKit/AMD64/Storage/AHCI.cxx new file mode 100644 index 00000000..25318212 --- /dev/null +++ b/Private/HALKit/AMD64/Storage/AHCI.cxx @@ -0,0 +1,18 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +/** + * @file AHCI.cxx + * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com) + * @brief AHCI driver. + * @version 0.1 + * @date 2024-02-02 + * + * @copyright Copyright (c) Mahrouss Logic + * + */ + +#include <Builtins/AHCI/Defines.hxx>
\ No newline at end of file |
