diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-22 20:21:08 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-22 20:21:08 +0100 |
| commit | eba5dbf36b5c96ce8d3e2c46cf9d798c3fb7ec89 (patch) | |
| tree | b3fb44810197b791c62b64a1069fd385fba23f8e /dev/Kernel/HALKit/AMD64 | |
| parent | 89e8d71556a88fa36f8b18a553f589ab66748895 (diff) | |
kernel(general): Refactor AHCI driver and clean up project structure
- Reworked AHCI command setup: fixed command slot indexing and clarified memory setup
- Updated AHCI disk initialization to use reference for ATAPI flag
- Cleaned up verbose logging in scheduler and IRQ handler for a quieter kernel log
- Updated boot image target from fat32.img to neos.img
- Renamed and moved documentation files from `doc/` to `docs/` for consistency
- Renamed `make_docs.sh` to `osx_docs.sh` to reflect platform-specific intent
- Minor formatting improvements in DiskImage struct
- Revised ReadMe: clarified mount instructions and removed outdated screenshots
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit/AMD64')
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 1 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index bc4bd330..05326ecb 100644 --- a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -74,7 +74,6 @@ EXTERN_C void idt_handle_scheduler(NeOS::UIntPtr rsp) try_count_before_brute = 100000UL; kIsScheduling = YES; - kout << "Kernel: Timer IRQ (Scheduler Notification).\r"; NeOS::UserProcessHelper::StartScheduling(); kIsScheduling = NO; diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 27a57a93..a17f3843 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -115,6 +115,8 @@ STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, Siz volatile HbaCmdHeader* command_header = ((HbaCmdHeader*)(((UInt64)kSATAHba->Ports[kSATAIndex].Clb))); + command_header += slot; + MUST_PASS(command_header); command_header->Cfl = sizeof(FisRegH2D) / sizeof(UInt32); @@ -122,6 +124,7 @@ STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, Siz command_header->Prdtl = (UInt16)((size_buffer - 1) >> 4) + 1; HbaCmdTbl* command_table = (HbaCmdTbl*)((VoidPtr)((UInt64)command_header->Ctba)); + rt_set_memory(command_table, 0, sizeof(HbaCmdTbl) + (command_header->Prdtl - 1) * sizeof(HbaPrdtEntry)); MUST_PASS(command_table); @@ -166,7 +169,9 @@ STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, Siz h2d_fis->CountHigh = (size_buffer >> 8) & 0xFF; while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) + { ; + } kSATAHba->Ports[kSATAIndex].Ci = (1 << slot); @@ -232,8 +237,9 @@ STATIC Void ahci_enable_and_probe() /// @brief Initializes an AHCI disk. /// @param pi the amount of ports that have been detected. +/// @param atapi reference value, tells whether we should detect ATAPI instead of SATA. /// @return if the disk was successfully initialized or not. -STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL atapi) +STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) { PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); @@ -390,7 +396,8 @@ Void drv_std_read(UInt64 lba, Char* buffer, SizeT sector_sz, SizeT size_buffer) Bool drv_std_init(UInt16& pi) { - return drv_std_init_ahci(pi, NO); + BOOL atapi = NO; + return drv_std_init_ahci(pi, atapi); } Bool drv_std_detected(Void) |
