From 5127ff4c1afe6c2ec62cc2cae1c48dbca3b7dd89 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Thu, 8 Aug 2024 19:41:07 +0200 Subject: - Remove VGA syscall. + Add FB request syscall. + Add Updated DDK document. + Typo fixes and improvements. Signed-off-by: Amlal EL Mahrouss --- DDKit/KernelStd.h | 2 +- Kernel/HALKit/AMD64/HalKernelMain.cxx | 17 +++-------------- Meta/DDK Driver ToolKit Internal SPECS.pdf | Bin 0 -> 24997 bytes Meta/DDK specs.pdf | Bin 23051 -> 0 bytes SCIKit/SCIBase.hxx | 19 +++++++++++++++++++ 5 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 Meta/DDK Driver ToolKit Internal SPECS.pdf delete mode 100644 Meta/DDK specs.pdf diff --git a/DDKit/KernelStd.h b/DDKit/KernelStd.h index abb56ea6..e1f3be44 100644 --- a/DDKit/KernelStd.h +++ b/DDKit/KernelStd.h @@ -22,7 +22,7 @@ #endif // defined(__cplusplus) #ifndef __NEWOSKRNL__ -#error !!! including header in kernel mode !!! +#error !!! including header in user mode !!! #endif // __NEWOSKRNL__ struct DDK_STATUS_STRUCT; diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx index bf63b388..520d0833 100644 --- a/Kernel/HALKit/AMD64/HalKernelMain.cxx +++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx @@ -46,8 +46,6 @@ struct PROCESS_EXIT_INFO final Kernel::Char fReason[cReasonLen]; }; -STATIC Kernel::UInt32 kTextOffsetY = 30; - namespace Kernel::HAL { /// @brief Gets the system cores using the MADT. @@ -80,6 +78,8 @@ EXTERN_C void hal_init_platform( return; } + STATIC Kernel::UInt32 kTextOffsetY = 30; + cg_write_text("NEWOSKRNL (C) ZKA TECHNOLOGIES.", kTextOffsetY, 10, RGB(0x00, 0x00, 0x00)); kTextOffsetY += 10; cg_write_text("SMP OS (MAX 8 CORES).", kTextOffsetY, 10, RGB(0x00, 0x00, 0x00)); @@ -90,7 +90,7 @@ EXTERN_C void hal_init_platform( void hal_real_init(void) { // get page size. - kKernelVirtualSize = kHandoverHeader->f_VirtualSize; + kKernelVirtualSize = kHandoverHeader->f_VirtualSize; // get virtual address start. kKernelVirtualStart = reinterpret_cast( @@ -100,9 +100,6 @@ void hal_real_init(void) kKernelPhysicalStart = reinterpret_cast( reinterpret_cast(kHandoverHeader->f_PhysicalStart)); - kTextOffsetY += 10; - cg_write_text("LOADING INTERRUPTS...", kTextOffsetY, 10, RGB(0x00, 0x00, 0x00)); - // Load memory descriptors. Kernel::HAL::RegisterGDT gdtBase; @@ -123,7 +120,6 @@ void hal_real_init(void) // Register the basic system calls. - constexpr auto cVGAWrite = 0x10; constexpr auto cTlsInterrupt = 0x11; constexpr auto cTlsInstallInterrupt = 0x12; constexpr auto cNewInterrupt = 0x13; @@ -143,12 +139,6 @@ void hal_real_init(void) constexpr auto cLPCCloseMsg = 0x27; constexpr auto cLPCSanitizeMsg = 0x28; - kSyscalls[cVGAWrite].Leak().Leak()->fProc = [](Kernel::VoidPtr rdx) -> void { - const char* msg = (const char*)rdx; - cg_write_text(msg, kTextOffsetY, 10, RGB(0x00, 0x00, 0x00)); - kTextOffsetY += 10; - }; - kSyscalls[cTlsInterrupt].Leak().Leak()->fProc = [](Kernel::VoidPtr rdx) -> void { if (tls_check_syscall_impl(rdx) == false) { @@ -221,7 +211,6 @@ void hal_real_init(void) pow.Shutdown(); }; - kSyscalls[cVGAWrite].Leak().Leak()->fHooked = true; kSyscalls[cTlsInterrupt].Leak().Leak()->fHooked = true; kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fHooked = true; kSyscalls[cDeleteInterrupt].Leak().Leak()->fHooked = true; diff --git a/Meta/DDK Driver ToolKit Internal SPECS.pdf b/Meta/DDK Driver ToolKit Internal SPECS.pdf new file mode 100644 index 00000000..7029e0cc Binary files /dev/null and b/Meta/DDK Driver ToolKit Internal SPECS.pdf differ diff --git a/Meta/DDK specs.pdf b/Meta/DDK specs.pdf deleted file mode 100644 index c3af60cf..00000000 Binary files a/Meta/DDK specs.pdf and /dev/null differ diff --git a/SCIKit/SCIBase.hxx b/SCIKit/SCIBase.hxx index 07b50b0a..95eb5bb1 100644 --- a/SCIKit/SCIBase.hxx +++ b/SCIKit/SCIBase.hxx @@ -97,3 +97,22 @@ IMPORT_C UInt64 RtlOpenFile(const char* path, const char* drv); /// @param file_desc the file descriptor. /// @return IMPORT_C UInt0 RtlCloseFile(UInt64 file_desc); + +/// @brief Installs the TIB and GIB inside the current process. +/// @param none +/// @return > 0 error ocurred or already present, = 0 success. +IMPORT_C UInt32 RtlInstallTIB(UInt0); + +/// @brief Asks for the process's own framebuffer. (Not a GPU one) +/// @param flags +/// @param fb_ptr +/// @param fb_out_sz +/// @return +IMPORT_C UInt32 RtlRequestFB(SInt32* type, VoidPtr* fb_ptr, SizeT* fb_out_sz); + +enum +{ + eFBGPU, + eFBCPU, + eFBInvalid, +}; \ No newline at end of file -- cgit v1.2.3