From af8a516fc22865abd80d6e26f1541fa3d6bebfdc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 9 May 2024 00:42:44 +0200 Subject: MHR-23: :boom:, refactors. - Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss --- Kernel/HALKit/AXP/CR.s | 11 +++++++++++ Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp | 0 Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp | 20 ++++++++++++++++++++ Kernel/HALKit/AXP/HAL.s | 13 +++++++++++++ Kernel/HALKit/AXP/Processor.hpp | 7 +++++++ Kernel/HALKit/AXP/README | 1 + Kernel/HALKit/AXP/README.TXT | 1 + Kernel/HALKit/AXP/SYSCALL.s | 10 ++++++++++ Kernel/HALKit/AXP/VM.s | 5 +++++ 9 files changed, 68 insertions(+) create mode 100644 Kernel/HALKit/AXP/CR.s create mode 100644 Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp create mode 100644 Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp create mode 100644 Kernel/HALKit/AXP/HAL.s create mode 100644 Kernel/HALKit/AXP/Processor.hpp create mode 100644 Kernel/HALKit/AXP/README create mode 100644 Kernel/HALKit/AXP/README.TXT create mode 100644 Kernel/HALKit/AXP/SYSCALL.s create mode 100644 Kernel/HALKit/AXP/VM.s (limited to 'Kernel/HALKit/AXP') diff --git a/Kernel/HALKit/AXP/CR.s b/Kernel/HALKit/AXP/CR.s new file mode 100644 index 00000000..4d68257d --- /dev/null +++ b/Kernel/HALKit/AXP/CR.s @@ -0,0 +1,11 @@ +.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/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp b/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp new file mode 100644 index 00000000..c6ef29fc --- /dev/null +++ b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#include +#include + +NewOS::Array + kSyscalls; + +extern "C" void rt_syscall_handle(NewOS::HAL::StackFrame* stack) +{ + for (NewOS::SizeT index = 0UL; index < kKernelMaxSystemCalls; ++index) + { + (kSyscalls[index].Leak().Leak())(stack->ID, stack); + } +} diff --git a/Kernel/HALKit/AXP/HAL.s b/Kernel/HALKit/AXP/HAL.s new file mode 100644 index 00000000..0178527f --- /dev/null +++ b/Kernel/HALKit/AXP/HAL.s @@ -0,0 +1,13 @@ +.globl rt_wait_400ns + +.section .text +rt_wait_400ns: + jmp .L +.L: + jmp .L2 + wtint ;; wait for interrupt +.L2: + + ret + + diff --git a/Kernel/HALKit/AXP/Processor.hpp b/Kernel/HALKit/AXP/Processor.hpp new file mode 100644 index 00000000..38277317 --- /dev/null +++ b/Kernel/HALKit/AXP/Processor.hpp @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#pragma once \ No newline at end of file diff --git a/Kernel/HALKit/AXP/README b/Kernel/HALKit/AXP/README new file mode 100644 index 00000000..91e7b134 --- /dev/null +++ b/Kernel/HALKit/AXP/README @@ -0,0 +1 @@ +This is for DEC Alpha. diff --git a/Kernel/HALKit/AXP/README.TXT b/Kernel/HALKit/AXP/README.TXT new file mode 100644 index 00000000..03c2b816 --- /dev/null +++ b/Kernel/HALKit/AXP/README.TXT @@ -0,0 +1 @@ +A Toy HAL to test the Kernel portability. diff --git a/Kernel/HALKit/AXP/SYSCALL.s b/Kernel/HALKit/AXP/SYSCALL.s new file mode 100644 index 00000000..19cab808 --- /dev/null +++ b/Kernel/HALKit/AXP/SYSCALL.s @@ -0,0 +1,10 @@ +.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/Kernel/HALKit/AXP/VM.s b/Kernel/HALKit/AXP/VM.s new file mode 100644 index 00000000..7024086b --- /dev/null +++ b/Kernel/HALKit/AXP/VM.s @@ -0,0 +1,5 @@ +.global hal_flush_tlb + +.section .text +hal_flush_tlb: + swppal \ No newline at end of file -- cgit v1.2.3