summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/zka/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx42
-rw-r--r--dev/zka/src/DriveMgr.cxx8
2 files changed, 40 insertions, 10 deletions
diff --git a/dev/zka/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx b/dev/zka/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
index b6edce6e..4ff168cd 100644
--- a/dev/zka/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
+++ b/dev/zka/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cxx
@@ -57,14 +57,27 @@ EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp)
/// @brief Enter syscall from assembly.
/// @param stack the stack pushed from assembly routine.
/// @return nothing.
-EXTERN_C Kernel::Void hal_system_call_enter(Kernel::UIntPtr rcx, Kernel::UIntPtr rdx)
+EXTERN_C Kernel::Void hal_system_call_enter(Kernel::UIntPtr rcx_syscall_index, Kernel::UIntPtr rdx_syscall_struct)
{
- if (rcx <= (kSyscalls.Count() - 1))
+ if (rcx_syscall_index < kSyscalls.Count())
{
kcout << "syscall: Enter Syscall.\r";
- if (kSyscalls[rcx].fHooked)
- (kSyscalls[rcx].fProc)((Kernel::VoidPtr)rdx);
+ if (kSyscalls[rcx_syscall_index].fHooked)
+ {
+ if (kSyscalls[rcx_syscall_index].fProc)
+ {
+ (kSyscalls[rcx_syscall_index].fProc)((Kernel::VoidPtr)rdx_syscall_struct);
+ }
+ else
+ {
+ kcout << "syscall: syscall isn't valid at all! (is nullptr)\r";
+ }
+ }
+ else
+ {
+ kcout << "syscall: syscall isn't hooked at all! (is set to false)\r";
+ }
kcout << "syscall: Exit Syscall.\r";
}
@@ -73,14 +86,27 @@ EXTERN_C Kernel::Void hal_system_call_enter(Kernel::UIntPtr rcx, Kernel::UIntPtr
/// @brief Enter Kernel call from assembly (DDK only).
/// @param stack the stack pushed from assembly routine.
/// @return nothing.
-EXTERN_C Kernel::Void hal_kernel_call_enter(Kernel::UIntPtr rcx, Kernel::UIntPtr rdx, Kernel::UIntPtr r8, Kernel::UIntPtr r9)
+EXTERN_C Kernel::Void hal_kernel_call_enter(Kernel::UIntPtr rcx_kerncall_index, Kernel::UIntPtr rdx_kerncall_struct)
{
- if (rcx <= (kSyscalls.Count() - 1))
+ if (rcx_kerncall_index < kKerncalls.Count())
{
kcout << "kerncall: Enter Kcall.\r";
- if (kKerncalls[rcx].fHooked)
- (kKerncalls[rcx].fProc)((Kernel::VoidPtr)rdx);
+ if (kKerncalls[rcx_kerncall_index].fHooked)
+ {
+ if (kKerncalls[rcx_kerncall_index].fProc)
+ {
+ (kKerncalls[rcx_kerncall_index].fProc)((Kernel::VoidPtr)rdx_kerncall_struct);
+ }
+ else
+ {
+ kcout << "kerncall: syscall isn't valid at all! (is nullptr)\r";
+ }
+ }
+ else
+ {
+ kcout << "kerncall: syscall isn't hooked at all! (is set to false)\r";
+ }
kcout << "kerncall: Exit Kcall.\r";
}
diff --git a/dev/zka/src/DriveMgr.cxx b/dev/zka/src/DriveMgr.cxx
index d9bf57f2..9a8e98cd 100644
--- a/dev/zka/src/DriveMgr.cxx
+++ b/dev/zka/src/DriveMgr.cxx
@@ -72,10 +72,14 @@ namespace Kernel
kATAMaster = true;
kATAIO = ATA_PRIMARY_IO;
- MUST_PASS(drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster));
+ if (!drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster))
+ return;
+
#elif defined(__AHCI__)
UInt16 pi = 0;
- MUST_PASS(drv_std_init(pi));
+
+ if (!drv_std_init(pi))
+ return;
#endif // if defined(__ATA_PIO__) || defined (__ATA_DMA__)
pckt->fPacketGood = true;