From cb2f383f45dda8d1cdcef0b87fe4c70243659701 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 27 Apr 2025 17:30:36 +0200 Subject: dev, kernel: AHCI, HeFS filesystem, SysChk, and BootSATA improvements. what? - AHCI now writes to disk, forgot to do it. - Codebase's architecutre has been used to reuse the Generic+AHCI driver in SysChk for AHCI. (tradeoff is 256K in size instead of 36K) - DriveMgr now detects EPM. - And HeFS is still being worked on. Signed-off-by: Amlal --- dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc | 38 ++++++++++++-------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc') diff --git a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc index e6d57be2..2fb6ad4c 100644 --- a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc +++ b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc @@ -15,26 +15,20 @@ namespace Detail { STATIC ::Kernel::Detail::AMD64::InterruptDescriptorAMD64 kInterruptVectorTable[kKernelIdtSize] = {}; -#if 0 - STATIC void hal_set_irq_mask(UInt8 irql) [[maybe_unused]] - { - UInt16 port; - UInt8 value; - - if (irql < 8) - { - port = kPICData; - } - else - { - port = kPIC2Data; - irql -= 8; - } - - value = rt_in8(port) | (1 << irql); - rt_out8(port, value); - } -#endif // make gcc shut up + STATIC ATTRIBUTE(unused) void hal_set_irq_mask(UInt8 irql) [[maybe_unused]] { + UInt16 port; + UInt8 value; + + if (irql < 8) { + port = kPICData; + } else { + port = kPIC2Data; + irql -= 8; + } + + value = rt_in8(port) | (1 << irql); + rt_out8(port, value); + } STATIC void hal_clear_irq_mask(UInt8 irql) [[maybe_unused]] { UInt16 port; @@ -70,7 +64,9 @@ namespace Detail { /// @param gdt /// @return Void GDTLoader::Load(Register64& gdt) { +#ifndef __NE_MODULAR_KERNEL_COMPONENTS__ hal_load_gdt(gdt); +#endif // __NE_MODULAR_KERNEL_COMPONENTS__ } Void IDTLoader::Load(Register64& idt) { @@ -98,7 +94,9 @@ Void IDTLoader::Load(Register64& idt) { Detail::hal_enable_pit(kPITTickForScheduler); +#ifndef __NE_MODULAR_KERNEL_COMPONENTS__ hal_load_idt(idt); +#endif // __NE_MODULAR_KERNEL_COMPONENTS__ rt_sti(); } -- cgit v1.2.3