diff options
| -rw-r--r-- | ReadMe.md | 13 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalKernelMain.cc | 2 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 10 |
3 files changed, 17 insertions, 8 deletions
@@ -2,27 +2,28 @@ # NeKernel -## Requirements: + + +## Required: - MinGW/GCC, Clang. -- LibCompiler Runtime Headers and Toolchain. - Netwide Assembler. - Git. - BTB. -## Installation: +## Install: Clone repository: ```sh git clone git@github.com:ne-gh/kernel.git cd kernel -./debug_ahci.sh # Generic AHCI target +./debug_ata.sh # Generic ATA PIO target ``` -## Good first PRs +## Good first PRs: -- Contribute to the AHCI generic driver (PRDs are not being read) +- Contribute to the AHCI generic driver, it's the current main effort to bring modern storage standards to the kernel. ## Warning: diff --git a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc index 0e2247ad..e87e6fb1 100644 --- a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc @@ -94,7 +94,7 @@ EXTERN_C void hal_init_platform( EXTERN_C NeOS::Void hal_real_init(NeOS::Void) noexcept { - auto dev = NeOS::sk_init_ahci_device(NO); + NeOS::NeFS::fs_init_nefs(); NeOS::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 51db8054..ae0ae239 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -73,7 +73,7 @@ STATIC Void drv_compute_disk_ahci() noexcept { kSATASectorCount = 0UL; - const UInt16 kSzIdent = 512; + const UInt16 kSzIdent = kib_cast(1); UInt8 identify_data[kSzIdent] = {0}; @@ -205,6 +205,7 @@ SizeT drv_get_size_ahci() return drv_get_sector_count() * kAHCISectorSize; } +/// @brief Enable Host and probe using the IDENTIFY command. STATIC Void ahci_enable_and_probe() { if (kSATAHba->Bohc & kHBABohcBiosOwned) @@ -213,9 +214,16 @@ STATIC Void ahci_enable_and_probe() while (kSATAHba->Bohc & kHBABohcBiosOwned) { + ; } } + // Poll until ready. + while (kSATAHba->Ports[kSATAIndex].Cmd & kHBAPxCmdCR) + { + ; + } + kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdFre; kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdST; |
