summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/HALKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel/HALKit')
-rw-r--r--dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm2
-rw-r--r--dev/Kernel/HALKit/AMD64/HalBoot.asm2
-rw-r--r--dev/Kernel/HALKit/AMD64/HalCommonAPI.asm2
-rw-r--r--dev/Kernel/HALKit/AMD64/HalDebugOutput.cc20
-rw-r--r--dev/Kernel/HALKit/AMD64/HalUtils.asm2
-rw-r--r--dev/Kernel/HALKit/AMD64/PCI/DMA.cc2
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/ATA.cc21
7 files changed, 31 insertions, 20 deletions
diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm b/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
index 2e2411c3..aaed18fa 100644
--- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
+++ b/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
@@ -1,7 +1,7 @@
;; /*
;; * ========================================================
;; *
-;; * ZKA
+;; * NeKernel
;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved., all rights reserved.
;; *
;; * ========================================================
diff --git a/dev/Kernel/HALKit/AMD64/HalBoot.asm b/dev/Kernel/HALKit/AMD64/HalBoot.asm
index 5141c662..5a285673 100644
--- a/dev/Kernel/HALKit/AMD64/HalBoot.asm
+++ b/dev/Kernel/HALKit/AMD64/HalBoot.asm
@@ -1,7 +1,7 @@
;; /*
;; * ========================================================
;; *
-;; * ZKA
+;; * NeKernel
;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved., all rights reserved.
;; *
;; * ========================================================
diff --git a/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm b/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm
index f6c85215..a4b0c841 100644
--- a/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm
+++ b/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm
@@ -1,7 +1,7 @@
;; /*
;; * ========================================================
;; *
-;; * ZKA
+;; * NeKernel
;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved., all rights reserved.
;; *
;; * ========================================================
diff --git a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc
index 6a484723..539d8178 100644
--- a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc
+++ b/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc
@@ -8,6 +8,8 @@
#include <KernelKit/DebugOutput.h>
#include <NewKit/Utils.h>
#include <NewKit/New.h>
+#include <Mod/CoreGfx/FBMgr.h>
+#include <Mod/CoreGfx/TextMgr.h>
namespace Kernel
{
@@ -80,12 +82,30 @@ namespace Kernel
index = 0;
len = rt_string_len(bytes, 255);
+ static int x = kFontSizeX, y = kFontSizeY;
+ auto log_txt = RGB(0xff, 0xff, 0xff);
+
while (index < len)
{
if (bytes[index] == '\r')
HAL::rt_out8(Detail::kPort, '\r');
HAL::rt_out8(Detail::kPort, bytes[index] == '\r' ? '\n' : bytes[index]);
+
+ char tmp_str[2];
+ tmp_str[0] = bytes[index];
+ tmp_str[1] = 0;
+
+ fb_render_string(tmp_str, y, x, log_txt);
+
+ if (bytes[index] == '\r')
+ {
+ y += kFontSizeY;
+ x = kFontSizeX;
+ }
+
+ x += kFontSizeX;
+
++index;
}
diff --git a/dev/Kernel/HALKit/AMD64/HalUtils.asm b/dev/Kernel/HALKit/AMD64/HalUtils.asm
index 2894ca5d..2dc8f815 100644
--- a/dev/Kernel/HALKit/AMD64/HalUtils.asm
+++ b/dev/Kernel/HALKit/AMD64/HalUtils.asm
@@ -1,7 +1,7 @@
;; /*
;; * ========================================================
;; *
-;; * ZKA
+;; * NeKernel
;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved., all rights reserved.
;; *
;; * ========================================================
diff --git a/dev/Kernel/HALKit/AMD64/PCI/DMA.cc b/dev/Kernel/HALKit/AMD64/PCI/DMA.cc
index 541e9533..e9981315 100644
--- a/dev/Kernel/HALKit/AMD64/PCI/DMA.cc
+++ b/dev/Kernel/HALKit/AMD64/PCI/DMA.cc
@@ -22,7 +22,7 @@ namespace Kernel
{
if (!fAddress)
return false;
-
+
if (offset == 0)
return false;
diff --git a/dev/Kernel/HALKit/AMD64/Storage/ATA.cc b/dev/Kernel/HALKit/AMD64/Storage/ATA.cc
index dcb6d816..25143a6d 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/ATA.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/ATA.cc
@@ -20,12 +20,12 @@
#if defined(__ATA_PIO__) || defined(__ATA_DMA__)
+#define kATADataLen 256
+
using namespace Kernel;
using namespace Kernel::HAL;
-/// bugs: 0
-
-#define kATADataLen 256
+/// BUGS: 0
STATIC Boolean kATADetected = false;
STATIC Int32 kATADeviceType = kATADeviceCount;
@@ -128,6 +128,8 @@ Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster)
}
#endif // __ATA_DMA__
+ kout << "ATA is enabled now.\r";
+
return YES;
}
@@ -149,10 +151,6 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz
UInt8 Command = ((!Master) ? 0xE0 : 0xF0);
-#ifdef __ATA_PIO__
- drv_std_wait_io(IO);
-#endif
-
drv_std_select(IO);
rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
@@ -167,8 +165,6 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz
#ifdef __ATA_PIO__
rt_out8(ATA_REG_COMMAND, ATA_CMD_READ_PIO);
- drv_std_wait_io(IO);
-
for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff)
{
drv_std_wait_io(IO);
@@ -201,10 +197,6 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS
UInt8 Command = ((!Master) ? 0xE0 : 0xF0);
-#ifdef __ATA_PIO__
- drv_std_wait_io(IO);
-#endif
-
drv_std_select(IO);
rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
@@ -219,8 +211,6 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS
#ifdef __ATA_PIO__
rt_out8(ATA_REG_COMMAND, ATA_CMD_WRITE_PIO);
- drv_std_wait_io(IO);
-
for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff)
{
drv_std_wait_io(IO);
@@ -243,6 +233,7 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS
while (rt_in8(ATA_REG_STATUS) & 0x01)
;
+
rt_out8(IO + 0x00, 0x00); // Start DMA engine
#endif // __ATA_PIO__
}