NeKernel dev
Loading...
Searching...
No Matches
SATA.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7#pragma once
8
9#include <BootKit/BootKit.h>
11#include <modules/AHCI/AHCI.h>
12
13#define kAHCISectorSz (512)
14
15class BootDeviceSATA final {
16 public:
17 explicit BootDeviceSATA();
18 ~BootDeviceSATA() = default;
19
21
22 struct SATATrait final : public Device::Trait {
25
26 operator bool() { return !this->mErr; }
27 };
28
29 operator bool() { return this->Leak().mDetected; }
30
32
33 constexpr static auto kSectorSize = kAHCISectorSize;
34
37
39
40 private:
42};
Bootloader Application Programming Interface.
#define NE_COPY_DEFAULT(KLASS)
Definition Detail.h:17
static constexpr auto kSectorSize
Definition SATA.h:33
~BootDeviceSATA()=default
BootDeviceSATA & Write(Boot::CharacterTypeASCII *Buf, const Kernel::SizeT SecCount)
SATATrait mTrait
Definition SATA.h:41
BootDeviceSATA & Read(Boot::CharacterTypeASCII *Buf, const Kernel::SizeT SecCount)
SizeT GetDiskSize()
Definition SATA.h:31
SATATrait & Leak()
Device type.
Definition Device.h:14
AHCI support.
#define kAHCISectorSize
Definition AHCI.h:22
Kernel::SizeT drv_std_get_size()
Gets the AHCI disk size.
Char CharacterTypeASCII
Definition BootKit.h:54
__SIZE_TYPE__ SizeT
Definition Config.h:60
bool Boolean
Definition Config.h:49
Definition SATA.h:22
Kernel::Boolean mDetected
Definition SATA.h:24
Kernel::Boolean mErr
Definition SATA.h:23