diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-27 17:30:36 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-27 17:30:36 +0200 |
| commit | cb2f383f45dda8d1cdcef0b87fe4c70243659701 (patch) | |
| tree | f109c3c44fa3f142d34f8ca61cfa69672e556614 /dev/boot/src/HEL/AMD64/BootSATA.cc | |
| parent | 14d5ee9e0cfededddfceec73d5dfa8a2fcda6c5d (diff) | |
dev, kernel: AHCI, HeFS filesystem, SysChk, and BootSATA improvements.
what?
- AHCI now writes to disk, forgot to do it.
- Codebase's architecutre has been used to reuse the Generic+AHCI driver in SysChk for AHCI. (tradeoff is 256K in size instead of 36K)
- DriveMgr now detects EPM.
- And HeFS is still being worked on.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/boot/src/HEL/AMD64/BootSATA.cc')
| -rw-r--r-- | dev/boot/src/HEL/AMD64/BootSATA.cc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/dev/boot/src/HEL/AMD64/BootSATA.cc b/dev/boot/src/HEL/AMD64/BootSATA.cc index ef5d2096..783acb4c 100644 --- a/dev/boot/src/HEL/AMD64/BootSATA.cc +++ b/dev/boot/src/HEL/AMD64/BootSATA.cc @@ -18,3 +18,65 @@ #include <BootKit/HW/SATA.h> #include <BootKit/Platform.h> #include <BootKit/Protocol.h> + +#include <BootKit/BootKit.h> +#include <FirmwareKit/EFI.h> + +#if defined(__AHCI__) && defined(__SYSCHK__) + +using namespace Boot; + +/*** + * + * + * @brief SATA Device class. + * + * + */ + +/** + * @brief ATA Device constructor. + * @param void none. + */ +BootDeviceSATA::BootDeviceSATA() noexcept { + UInt16 pi = 0u; + drv_std_init(pi); +} + +/** + @brief Read Buf from disk + @param Sz Sector size + @param Buf buffer +*/ +BootDeviceSATA& BootDeviceSATA::Read(CharacterTypeUTF8* Buf, SizeT SectorSz) { + NE_UNUSED(Buf); + NE_UNUSED(SectorSz); + + drv_std_read(mTrait.mBase, Buf, SectorSz, mTrait.mSize); + + return *this; +} + +/** + @brief Write Buf into disk + @param Sz Sector size + @param Buf buffer +*/ +BootDeviceSATA& BootDeviceSATA::Write(CharacterTypeUTF8* Buf, SizeT SectorSz) { + NE_UNUSED(Buf); + NE_UNUSED(SectorSz); + + drv_std_write(mTrait.mBase, Buf, SectorSz, mTrait.mSize); + + return *this; +} + +/** + * @brief ATA trait getter. + * @return BootDeviceSATA::ATATrait& the drive config. + */ +BootDeviceSATA::SATATrait& BootDeviceSATA::Leak() { + return mTrait; +} + +#endif
\ No newline at end of file |
