From 77423c4fa55a060c5cf710bbe5c4de02fce43e97 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 29 Apr 2024 20:20:57 +0200 Subject: MHR-18: Fixing last bugs... Signed-off-by: Amlal El Mahrouss --- Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp | 2 +- Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 4 ++-- Private/HALKit/AMD64/HalDebugOutput.cxx | 5 ++++- Private/HALKit/AMD64/PCI/Dma.cxx | 2 +- Private/HALKit/AMD64/Storage/AHCI.cxx | 2 +- Private/HALKit/AMD64/Storage/ATA-PIO.cxx | 4 ++++ 6 files changed, 13 insertions(+), 6 deletions(-) (limited to 'Private/HALKit') diff --git a/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp b/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp index 99a66532..288462ab 100644 --- a/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp +++ b/Private/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cpp @@ -35,7 +35,7 @@ EXTERN_C void idt_handle_scheduler(NewOS::UIntPtr rsp) { /// schedule another process. if (!NewOS::ProcessHelper::StartScheduling()) { - NewOS::kcout << "New OS: Continue schedule this process...\r\n"; + NewOS::kcout << "New OS: Continue schedule this process...\r"; } } diff --git a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp index 5c845812..917af45d 100644 --- a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp +++ b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp @@ -93,13 +93,13 @@ STATIC MadtType* kApicInfoBlock = nullptr; /////////////////////////////////////////////////////////////////////////////////////// void hal_system_get_cores(voidPtr rsdPtr) { - kcout << "New OS: Constructing ACPIFactoryInterface...\r\n"; + kcout << "New OS: Constructing ACPIFactoryInterface...\r"; auto acpi = ACPIFactoryInterface(rsdPtr); kApicMadt = acpi.Find(kApicSignature).Leak().Leak(); if (kApicMadt) { - kcout << "New OS: Successfuly fetched the MADT!\r\n"; + kcout << "New OS: Successfuly fetched the MADT!\r"; kApicInfoBlock = (MadtType*)kApicMadt; } else { MUST_PASS(false); diff --git a/Private/HALKit/AMD64/HalDebugOutput.cxx b/Private/HALKit/AMD64/HalDebugOutput.cxx index ed247875..95f6a3ce 100644 --- a/Private/HALKit/AMD64/HalDebugOutput.cxx +++ b/Private/HALKit/AMD64/HalDebugOutput.cxx @@ -68,7 +68,10 @@ EXTERN_C void ke_io_write(const char* bytes) { SizeT len = rt_string_len(bytes, 256); while (index < len) { - HAL::Out8(Detail::PORT, bytes[index]); + if (bytes[index] == '\r') + HAL::Out8(Detail::PORT, '\r'); + + HAL::Out8(Detail::PORT, bytes[index] == '\r' ? '\n' : bytes[index]); ++index; } diff --git a/Private/HALKit/AMD64/PCI/Dma.cxx b/Private/HALKit/AMD64/PCI/Dma.cxx index f0a10eb9..96063b14 100644 --- a/Private/HALKit/AMD64/PCI/Dma.cxx +++ b/Private/HALKit/AMD64/PCI/Dma.cxx @@ -52,7 +52,7 @@ OwnPtr> DMAFactory::Construct(OwnPtr &dma) { if (!dmaOwnPtr) return {}; - kcout << "Returning the new OwnPtr>!\r\n"; + kcout << "Returning the new OwnPtr>!\r"; return dmaOwnPtr; } diff --git a/Private/HALKit/AMD64/Storage/AHCI.cxx b/Private/HALKit/AMD64/Storage/AHCI.cxx index 80224d89..7c2bc0f6 100644 --- a/Private/HALKit/AMD64/Storage/AHCI.cxx +++ b/Private/HALKit/AMD64/Storage/AHCI.cxx @@ -36,7 +36,7 @@ NewOS::Boolean drv_std_init(NewOS::UInt16& PortsImplemented) { iterator[devIndex].Leak().EnableMmio(); /// enable the memory i/o for this ahci device. kAhciDevice = iterator[devIndex].Leak(); /// and then leak the reference. - kcout << "New Kernel: [PCI] Found AHCI controller.\r\n"; + kcout << "New Kernel: [PCI] Found AHCI controller.\r"; return true; } diff --git a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx index 9b37e248..6dafb5e5 100644 --- a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx +++ b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx @@ -123,6 +123,8 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, Buf[IndexOff] = In16(IO + ATA_REG_DATA); drv_std_wait_io(IO); } + + drv_std_wait_io(IO); } Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, @@ -153,6 +155,8 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, Out16(IO + ATA_REG_DATA, Buf[IndexOff]); drv_std_wait_io(IO); } + + drv_std_wait_io(IO); } /// @brief is ATA detected? -- cgit v1.2.3