diff options
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc | 119 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/CR.s | 11 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp | 0 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp | 24 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/HAL.s | 13 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/Processor.h | 7 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/SYSCALL.s | 10 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AXP/VM.s | 5 | ||||
| -rw-r--r-- | dev/kernel/src/FS/NeFS.cc | 1 | ||||
| -rw-r--r-- | dev/modules/MBCI/MBCI.h | 100 | ||||
| -rw-r--r-- | dev/modules/MFlash/MFlash.h | 25 |
11 files changed, 0 insertions, 315 deletions
diff --git a/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc b/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc deleted file mode 100644 index 94d20878..00000000 --- a/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef NE_USE_MBCI_FLASH - -#include <NewKit/Defines.h> -#include <ArchKit/ArchKit.h> -#include <modules/MFlash/MFlash.h> -#include <modules/MBCI/MBCI.h> - -/// @file MBCI+Flash.cc -/// @brief MBCI Flash support. - -#define MBCI_MAX_SLOTS (8U) - -namespace NeOS -{ - /// /Mount/Flash/n - constexpr auto kFlashBridgeMagic = 0x70768372; - constexpr auto kFlashBridgeRevision = 1; - - STATIC BOOL kFlashEnabled = NO; - STATIC SizeT kFlashSize[MBCI_MAX_SLOTS] = {}; - STATIC SizeT kFlashSectorSz[MBCI_MAX_SLOTS] = {}; - STATIC IMBCIHost* kFlashMetaPackets[MBCI_MAX_SLOTS] = {}; - STATIC IMBCIHost* kFlashDataPackets[MBCI_MAX_SLOTS] = {}; - - STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz); - - /// @brief Enable flash memory builtin. - STATIC Void drv_enable_flash(Int32 slot); - - /// @brief Disable flash memory builtin. - STATIC Void drv_disable_flash(Int32 slot); - - /// @brief get slot sector count. - /// @return slot sector count. - SizeT drv_get_sector_count(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return 0; - - return kFlashSectorSz[slot]; - } - - /// @brief get slot full size (in bytes). - /// @return drive slot size - SizeT drv_get_size(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return 0; - - return kFlashSize[slot]; - } - - /// @brief Enable flash memory at slot. - BOOL drv_enable_at(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return NO; - - kFlashMetaPackets[slot]->InterruptEnable = YES; - - kout << "Enabled hardware slot at: " << number(slot) << kendl; - - return YES; - } - - /// @brief Disable flash memory at slot. - BOOL drv_disable_at(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return NO; - - kFlashMetaPackets[slot]->InterruptEnable = NO; - - kout << "Disabled hardware slot at: " << number(slot) << kendl; - - return YES; - } - - STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - UInt64* packet_frame = (UInt64*)kFlashDataPackets[slot]->BaseAddressRegister; - - if (packet_frame[0] != (UInt64)kFlashBridgeMagic) - return; - - if (packet_frame[8] != (UInt64)kFlashBridgeRevision) - return; - - packet_frame[16 + 0] = lba; - packet_frame[16 + 4] = sector_sz; - packet_frame[16 + 8] = lba; - packet_frame[16 + 12] = buf_sz; - packet_frame[16 + 14] = (UIntPtr)HAL::hal_get_phys_address(buf); - - while (packet_frame[0] == lba) - ; - } - - Void drv_std_read(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - rt_set_memory(buf, 0, buf_sz); - - drv_std_io(slot, lba, buf, sector_sz, buf_sz); - } - - Void drv_std_write(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - drv_std_io(slot, lba, buf, sector_sz, buf_sz); - } - -} // namespace NeOS - -#endif // if NE_USE_MBCI_FLASH diff --git a/dev/kernel/HALKit/AXP/CR.s b/dev/kernel/HALKit/AXP/CR.s deleted file mode 100644 index 4d68257d..00000000 --- a/dev/kernel/HALKit/AXP/CR.s +++ /dev/null @@ -1,11 +0,0 @@ -.globl read_lr1 -.globl read_lr0 - -.section .text - read_lr0: - movq %r30, %cr3 - ret - - hal_read_cr0: - movq %r30, %cr0 - ret
\ No newline at end of file diff --git a/dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp b/dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp deleted file mode 100644 index e69de29b..00000000 --- a/dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp +++ /dev/null diff --git a/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp deleted file mode 100644 index f77186fd..00000000 --- a/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include <ArchKit/ArchKit.h> -#include <HALKit/AXP/Processor.h> - -/// @brief Internal call for syscall, to work with C++. -/// @param stack -/// @return nothing. -EXTERN_C void rt_syscall_handle(NeOS::HAL::StackFrame* stack) -{ - if (stack->Rcx <= (kSyscalls.Count() - 1)) - { - kout << "syscall: enter.\r"; - - if (kSyscalls[stack->Rcx].Leak().Leak().fHooked) - (kSyscalls[stack->Rcx].Leak().Leak().fProc)(stack); - - kout << "syscall: exit.\r"; - } -} diff --git a/dev/kernel/HALKit/AXP/HAL.s b/dev/kernel/HALKit/AXP/HAL.s deleted file mode 100644 index 0178527f..00000000 --- a/dev/kernel/HALKit/AXP/HAL.s +++ /dev/null @@ -1,13 +0,0 @@ -.globl rt_wait_400ns - -.section .text -rt_wait_400ns: - jmp .L -.L: - jmp .L2 - wtint ;; wait for interrupt -.L2: - - ret - - diff --git a/dev/kernel/HALKit/AXP/Processor.h b/dev/kernel/HALKit/AXP/Processor.h deleted file mode 100644 index bb14c9c6..00000000 --- a/dev/kernel/HALKit/AXP/Processor.h +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once diff --git a/dev/kernel/HALKit/AXP/SYSCALL.s b/dev/kernel/HALKit/AXP/SYSCALL.s deleted file mode 100644 index 19cab808..00000000 --- a/dev/kernel/HALKit/AXP/SYSCALL.s +++ /dev/null @@ -1,10 +0,0 @@ -.section .text -system_handle_user_call: - .cfi_startproc - - push %r0 - jmp %r1 - mov %r30, %r2 - - .cfi_endproc - retsys
\ No newline at end of file diff --git a/dev/kernel/HALKit/AXP/VM.s b/dev/kernel/HALKit/AXP/VM.s deleted file mode 100644 index 7024086b..00000000 --- a/dev/kernel/HALKit/AXP/VM.s +++ /dev/null @@ -1,5 +0,0 @@ -.global hal_flush_tlb - -.section .text -hal_flush_tlb: - swppal
\ No newline at end of file diff --git a/dev/kernel/src/FS/NeFS.cc b/dev/kernel/src/FS/NeFS.cc index 30d4fb85..00824122 100644 --- a/dev/kernel/src/FS/NeFS.cc +++ b/dev/kernel/src/FS/NeFS.cc @@ -11,7 +11,6 @@ #include <modules/AHCI/AHCI.h> #include <modules/ATA/ATA.h> -#include <modules/MFlash/MFlash.h> #include <KernelKit/LPC.h> #include <NewKit/Crc32.h> #include <NewKit/KernelPanic.h> diff --git a/dev/modules/MBCI/MBCI.h b/dev/modules/MBCI/MBCI.h deleted file mode 100644 index c774df30..00000000 --- a/dev/modules/MBCI/MBCI.h +++ /dev/null @@ -1,100 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _INC_MODULE_MBCI_H_ -#define _INC_MODULE_MBCI_H_ - -#include <NewKit/Defines.h> -#include <modules/ACPI/ACPI.h> - -/** -- VCC (IN) (OUT for MCU) -- CLK (IN) (OUT for MCU) -- ACK (BI) (Contains an Acknowledge Packet Frame) -- D0- (IN) (Starts with the Host Interface Packet Frame) -- D1- (IN) (Starts with the Host Interface Packet Frame) -- D0+ (OUT) (Starts with the Host Interface Packet Frame) -- D1+ (OUT) (Starts with the Host Interface Packet Frame) -- GND (IN) (OUT for MCU) - */ - -#define kMBCIZeroSz (8) - -namespace NeOS -{ - struct IMBCIHost; - - enum - { - kMBCISpeedDeviceInvalid, - kMBCILowSpeedDevice, - kMBCIHighSpeedDevice, - kMBCISpeedDeviceCount, - }; - - /// @brief MBCI Host header. - struct PACKED IMBCIHost final - { - UInt32 Magic; - UInt32 HostId; - UInt16 VendorId; - UInt16 DeviceId; - UInt8 MemoryType; - UInt16 HostType; - UInt16 HostFlags; - UInt8 Error; - UInt32 MMIOTest; - UInt16 State; - UInt8 Status; - UInt8 InterruptEnable; - UInt64 BaseAddressRegister; - UInt64 BaseAddressRegisterSize; - UInt32 CommandIssue; - Char Zero[kMBCIZeroSz]; - }; - - /// @brief MBCI host flags. - enum MBCIHostFlags - { - kMBCIHostFlagsSupportsNothing, // Invalid MBCI device. - kMBCIHostFlagsSupportsAPM, // Advanced Power Management. - kMBCIHostFlagsSupportsDaisyChain, // Is daisy chained. - kMBCIHostFlagsSupportsHWInterrupts, // Has HW interrupts. - kMBCIHostFlagsSupportsDMA, // Has DMA. - kMBCIHostFlagsExtended, // Extended flags table. - }; - - /// @brief MBCI host kind. - enum MBCIHostKind - { - kMBCIHostKindHardDisk, - kMBCIHostKindOpticalDisk, - kMBCIHostKindKeyboardLow, - kMBCIHostKindMouseLow, - kMBCIHostKindMouseHigh, - kMBCIHostKindKeyboardHigh, - kMBCIHostKindNetworkInterface, - kMBCIHostKindDaisyChain, - kMBCIHostKindStartExtended, // Extended vendor table limit. - }; - - enum MBCIHostState - { - kMBCIHostStateInvalid, - kMBCIHostStateReset, - kMBCIHostStateSuccess, - kMBCIHostStateReady, - kMBCIHostStateDmaStart, - kMBCIHostStateDmaEnd, - kMBCIHostStateFail, - kMBCIHostStateCount, - }; - - /// @brief An AuthKey is a context used to decrpy data from an MBCI packet. - typedef UInt64 MBCIAuthKeyType; -} // namespace NeOS - -#endif // ifndef _INC_MODULE_MBCI_H_ diff --git a/dev/modules/MFlash/MFlash.h b/dev/modules/MFlash/MFlash.h deleted file mode 100644 index a1846610..00000000 --- a/dev/modules/MFlash/MFlash.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#ifdef NE_USE_MBCI_FLASH - -#include <NewKit/Defines.h> - -NeOS::SizeT drv_get_sector_count(NeOS::Int32 slot); - -NeOS::SizeT drv_get_size(NeOS::Int32 slot); - -NeOS::Void drv_enable_at(NeOS::Int32 slot); - -NeOS::Void drv_disable_at(NeOS::Int32 slot); - -NeOS::Void drv_std_write(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -NeOS::Void drv_std_read(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -#endif // ifdef NE_USE_MBCI_FLASH |
