Register interrupt handlers once the APIC initialization is done
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 26s
Builds / ExectOS (i686) (push) Successful in 24s

This commit is contained in:
2023-11-28 14:20:23 +01:00
부모 c4ccf52782
커밋 d17b06a180
6개의 변경된 파일90개의 추가작업 그리고 3개의 파일을 삭제

39
xtoskrnl/ke/amd64/irqs.c Normal file
파일 보기

@@ -0,0 +1,39 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ke/amd64/irqs.c
* DESCRIPTION: Kernel interrupts support for amd64 architecture
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.h>
/**
* Sets new interrupt handler for the existing IDT entry.
*
* @param HalVector
* Supplies the HAL vector number.
*
* @param Handler
* Supplies the new interrupt handler.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
KeSetInterruptHandler(IN ULONG Vector,
IN PVOID Handler)
{
PKPROCESSOR_BLOCK ProcessorBlock;
/* Get current processor block */
ProcessorBlock = KeGetCurrentProcessorBlock();
/* Update interrupt handler */
ProcessorBlock->IdtBase[(UCHAR) Vector].OffsetLow = ((ULONG_PTR)Handler & 0xFFFF);
ProcessorBlock->IdtBase[(UCHAR) Vector].OffsetMiddle = (((ULONG_PTR)Handler >> 16) & 0xFFFF);
ProcessorBlock->IdtBase[(UCHAR) Vector].OffsetHigh = (ULONG_PTR)Handler >> 32;
}