diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 15:09:06 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 15:09:06 +0200 |
| commit | 9da6a352ecf70a1f5be99058a880b20db1b57940 (patch) | |
| tree | e22da564798915f55ca44b6658a0120331cd3d75 /dev/kernel/HALKit/AMD64/Storage | |
| parent | e50f871e6852beacb53986f930ed2d5dead84838 (diff) | |
fix, mm: rework paging system.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/Storage')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 41aabca2..a1a9a164 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -87,7 +87,7 @@ STATIC Void drv_compute_disk_ahci() noexcept kSATASectorCount = 0UL; /// Normally 512 bytes, but add an additional 512 bytes to make 1 KIB. - const UInt16 kSzIdent = 256; + const UInt16 kSzIdent = 512; /// Push it to the stack UInt16* identify_data = AHCI::Detail::ahci_align_address<UInt16>(new UInt16[kSzIdent], kib_cast(1)); @@ -186,7 +186,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz command_table->Prdt[0].Dba = (UInt32)(buffer_phys & 0xFFFFFFFF); command_table->Prdt[0].Dbau = (UInt32)(buffer_phys >> 32); command_table->Prdt[0].Dbc = bytes_remaining - 1; - command_table->Prdt[0].Ie = 1; + command_table->Prdt[0].Ie = NO; volatile FisRegH2D* h2d_fis = (volatile FisRegH2D*)(&command_table->Cfis[0]); @@ -300,6 +300,8 @@ STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) kSATADev.EnableMmio(); kSATADev.BecomeBusMaster(); + HAL::mm_map_page((VoidPtr)mem_ahci, (VoidPtr)mem_ahci, HAL::kMMFlagsPresent | HAL::kMMFlagsWr | HAL::kMMFlagsUncached); + UInt32 ports_implemented = mem_ahci->Pi; UInt16 ahci_index = 0; |
