Rework trap handling to access registers
Some checks failed
Builds / ExectOS (i686) (push) Failing after 28s
Builds / ExectOS (amd64) (push) Failing after 29s

This commit is contained in:
Rafal Kupiec 2024-04-19 16:49:40 +02:00
parent cf408519ad
commit 92ee74b494
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
9 changed files with 850 additions and 192 deletions

View File

@ -381,88 +381,43 @@ typedef struct _KSWITCH_FRAME
/* Trap frame definition */ /* Trap frame definition */
typedef struct _KTRAP_FRAME typedef struct _KTRAP_FRAME
{ {
ULONG64 P1Home; ULONGLONG Dr0;
ULONG64 P2Home; ULONGLONG Dr1;
ULONG64 P3Home; ULONGLONG Dr2;
ULONG64 P4Home; ULONGLONG Dr3;
ULONG64 P5; ULONGLONG Dr6;
KPROCESSOR_MODE PreviousMode; ULONGLONG Dr7;
KRUNLEVEL PreviousRunLevel; ULONGLONG Cr2;
UCHAR FaultIndicator; ULONGLONG Cr3;
UCHAR ExceptionActive;
ULONG MxCsr;
ULONG64 Rax;
ULONG64 Rcx;
ULONG64 Rdx;
ULONG64 R8;
ULONG64 R9;
ULONG64 R10;
ULONG64 R11;
union
{
ULONG64 GsBase;
ULONG64 GsSwap;
};
M128 Xmm0;
M128 Xmm1;
M128 Xmm2;
M128 Xmm3;
M128 Xmm4;
M128 Xmm5;
union
{
ULONG64 FaultAddress;
ULONG64 ContextRecord;
ULONG64 TimeStampCKCL;
};
ULONG64 Dr0;
ULONG64 Dr1;
ULONG64 Dr2;
ULONG64 Dr3;
ULONG64 Dr6;
ULONG64 Dr7;
union
{
struct
{
ULONG64 DebugControl;
ULONG64 LastBranchToRip;
ULONG64 LastBranchFromRip;
ULONG64 LastExceptionToRip;
ULONG64 LastExceptionFromRip;
};
struct
{
ULONG64 LastBranchControl;
ULONG LastBranchMSR;
};
};
USHORT SegDs; USHORT SegDs;
USHORT SegEs; USHORT SegEs;
USHORT SegFs; USHORT SegFs;
USHORT SegGs; USHORT SegGs;
ULONG64 TrapFrame; ULONGLONG Rax;
ULONG64 Rbx; ULONGLONG Rbx;
ULONG64 Rdi; ULONGLONG Rcx;
ULONG64 Rsi; ULONGLONG Rdx;
ULONG64 Rbp; ULONGLONG Rsi;
union ULONGLONG Rdi;
{ ULONGLONG Rbp;
ULONG64 ErrorCode; ULONGLONG R8;
ULONG64 ExceptionFrame; ULONGLONG R9;
ULONG64 TimeStampKlog; ULONGLONG R10;
ULONGLONG R11;
ULONGLONG R12;
ULONGLONG R13;
ULONGLONG R14;
ULONGLONG R15;
ULONGLONG Vector;
union {
ULONGLONG ErrorCode;
ULONGLONG ExceptionFrame;
}; };
ULONG64 Rip; ULONGLONG Rip;
USHORT SegCs; ULONGLONG Cs;
UCHAR Fill0; ULONGLONG RFlags;
UCHAR Logging; ULONGLONG Rsp;
USHORT Fill1[2]; ULONGLONG SegSs;
ULONG EFlags;
ULONG Fill2;
ULONG64 Rsp;
USHORT SegSs;
USHORT Fill3;
ULONG CodePatchCycle;
} KTRAP_FRAME, *PKTRAP_FRAME; } KTRAP_FRAME, *PKTRAP_FRAME;
/* Thread initialization frame definition */ /* Thread initialization frame definition */

View File

@ -382,41 +382,32 @@ typedef struct _KSWITCH_FRAME
/* Trap frame definition */ /* Trap frame definition */
typedef struct _KTRAP_FRAME typedef struct _KTRAP_FRAME
{ {
ULONG DbgEbp;
ULONG DbgEip;
ULONG DbgMark;
ULONG DbgPointer;
ULONG TempSegCs;
ULONG TempEsp;
ULONG Dr0; ULONG Dr0;
ULONG Dr1; ULONG Dr1;
ULONG Dr2; ULONG Dr2;
ULONG Dr3; ULONG Dr3;
ULONG Dr6; ULONG Dr6;
ULONG Dr7; ULONG Dr7;
ULONG SegGs; ULONG Cr2;
ULONG SegEs; ULONG Cr3;
ULONG SegDs; USHORT SegDs;
ULONG Edx; USHORT SegEs;
ULONG Ecx; USHORT SegFs;
USHORT SegGs;
ULONG Eax; ULONG Eax;
ULONG PreviousMode;
PEXCEPTION_REGISTRATION_RECORD ExceptionList;
ULONG SegFs;
ULONG Edi;
ULONG Esi;
ULONG Ebx; ULONG Ebx;
ULONG Ecx;
ULONG Edx;
ULONG Esi;
ULONG Edi;
ULONG Ebp; ULONG Ebp;
ULONG ErrCode; ULONG Vector;
ULONG ErrorCode;
ULONG Eip; ULONG Eip;
ULONG SegCs; ULONG Cs;
ULONG EFlags; ULONG EFlags;
ULONG HardwareEsp; ULONG Esp;
ULONG HardwareSegSs; ULONG SegSs;
ULONG V86Es;
ULONG V86Ds;
ULONG V86Fs;
ULONG V86Gs;
} KTRAP_FRAME, *PKTRAP_FRAME; } KTRAP_FRAME, *PKTRAP_FRAME;
/* Thread initialization frame definition */ /* Thread initialization frame definition */

View File

@ -8,6 +8,7 @@ include_directories(
# Specify list of source code files # Specify list of source code files
list(APPEND XTOSKRNL_SOURCE list(APPEND XTOSKRNL_SOURCE
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/archsup.S
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/cpufunc.c ${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/cpufunc.c
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/globals.c ${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/globals.c
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/procsup.c ${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/procsup.c

122
xtoskrnl/ar/amd64/archsup.S Normal file
View File

@ -0,0 +1,122 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ar/amd64/archsup.S
* DESCRIPTION: Provides AMD64 architecture features not implementable in C.
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
.altmacro
.text
/**
* This macro creates a trap handler for the specified vector.
*
* @param Vector
* Supplies a trap vector number.
*
* @return This macro does not return any value.
*
* @since XT 1.0
*/
.macro ArpCreateTrapHandler Vector
.global ArpTrap\Vector
ArpTrap\Vector:
/* Push fake error code for non-error vectors */
.if \Vector != 8 && \Vector != 10 && \Vector != 11 && \Vector != 12 && \Vector != 13 && \Vector != 14 && \Vector != 17 && \Vector != 30
push $0
.endif
/* Push vector number */
push $\Vector
/* Push General Purpose Registers */
push %r15
push %r14
push %r13
push %r12
push %r11
push %r10
push %r9
push %r8
push %rbp
push %rdi
push %rsi
push %rdx
push %rcx
push %rbx
push %rax
/* Push Segments */
mov %gs, %ax
push %ax
mov %fs, %ax
push %ax
mov %es, %ax
push %ax
mov %ds, %ax
push %ax
/* Push Control Registers */
mov %cr3, %rax
push %rax
mov %cr2, %rax
push %rax
/* Push Debug Registers */
mov %dr7, %rax
push %rax
mov %dr6, %rax
push %rax
mov %dr3, %rax
push %rax
mov %dr2, %rax
push %rax
mov %dr1, %rax
push %rax
mov %dr0, %rax
push %rax
/* Push Frame Pointer, clear direction flag and pass to trap dispatcher */
mov %rsp, %rcx
cld
call ArpDispatchTrap
/* Skip space occupied by Debug Registers */
add $(6 * 8), %rsp
/* Skip space occupied by CR2 and CR3 */
add $(2 * 8), %rsp
/* Skip space occupied by Segments */
add $(4 * 2), %rsp
/* Pop General Purpose Registers */
pop %rax
pop %rbx
pop %rcx
pop %rdx
pop %rsi
pop %rdi
pop %rbp
pop %r8
pop %r9
pop %r10
pop %r11
pop %r12
pop %r13
pop %r14
pop %r15
/* Skip error code and vector number, then return */
add $(2 * 8), %rsp
iretq
.endm
/* Populate common trap handlers */
.irp i,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
.irp j,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
ArpCreateTrapHandler 0x\i\j
.endr
.endr

View File

@ -235,27 +235,30 @@ ArpInitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
} }
/* Setup IDT handlers for known interrupts and traps */ /* Setup IDT handlers for known interrupts and traps */
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x00, ArpHandleTrap00, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x00, ArpTrap0x00, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x01, ArpHandleTrap01, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x01, ArpTrap0x01, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x02, ArpHandleTrap02, KGDT_R0_CODE, KIDT_IST_PANIC, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x02, ArpTrap0x02, KGDT_R0_CODE, KIDT_IST_PANIC, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x03, ArpHandleTrap03, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x03, ArpTrap0x03, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x04, ArpHandleTrap04, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x04, ArpTrap0x04, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x05, ArpHandleTrap05, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x05, ArpTrap0x05, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x06, ArpHandleTrap06, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x06, ArpTrap0x06, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x07, ArpHandleTrap07, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x07, ArpTrap0x07, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x08, ArpHandleTrap08, KGDT_R0_CODE, KIDT_IST_PANIC, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x08, ArpTrap0x08, KGDT_R0_CODE, KIDT_IST_PANIC, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x09, ArpHandleTrap09, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x09, ArpTrap0x09, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0A, ArpHandleTrap0A, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0A, ArpTrap0x0A, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0B, ArpHandleTrap0B, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0B, ArpTrap0x0B, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0C, ArpHandleTrap0C, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0C, ArpTrap0x0C, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0D, ArpHandleTrap0D, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0D, ArpTrap0x0D, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0E, ArpHandleTrap0E, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0E, ArpTrap0x0E, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x10, ArpHandleTrap10, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x10, ArpTrap0x10, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x11, ArpHandleTrap11, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x11, ArpTrap0x11, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x12, ArpHandleTrap12, KGDT_R0_CODE, KIDT_IST_MCA, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x12, ArpTrap0x12, KGDT_R0_CODE, KIDT_IST_MCA, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x13, ArpHandleTrap13, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x13, ArpTrap0x13, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2C, ArpHandleTrap2C, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x1F, ArpTrap0x1F, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2D, ArpHandleTrap2D, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2C, ArpTrap0x2C, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2D, ArpTrap0x2D, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2F, ArpTrap0x2F, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0xE1, ArpTrap0xE1, KGDT_R0_CODE, KIDT_IST_RESERVED, KIDT_ACCESS_RING0);
} }
/** /**

View File

@ -9,6 +9,126 @@
#include <xtos.h> #include <xtos.h>
/**
* Dispatches the trap provided by common trap handler.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpDispatchTrap(IN PKTRAP_FRAME TrapFrame)
{
/* Check vector and call appropriate handler */
switch(TrapFrame->Vector)
{
case 0x00:
/* Divide By Zero exception */
ArpHandleTrap00(TrapFrame);
break;
case 0x01:
/* Debug exception */
ArpHandleTrap01(TrapFrame);
break;
case 0x02:
/* Non-Maskable Interrupt (NMI) */
ArpHandleTrap02(TrapFrame);
break;
case 0x03:
/* INT3 instruction executed */
ArpHandleTrap03(TrapFrame);
break;
case 0x04:
/* Overflow exception */
ArpHandleTrap04(TrapFrame);
break;
case 0x05:
/* Bound Range Exceeded exception */
ArpHandleTrap05(TrapFrame);
break;
case 0x06:
/* Invalid Opcode exception */
ArpHandleTrap06(TrapFrame);
break;
case 0x07:
/* Device Not Available exception */
ArpHandleTrap07(TrapFrame);
break;
case 0x08:
/* Double Fault exception */
ArpHandleTrap08(TrapFrame);
break;
case 0x09:
/* Segment Overrun exception */
ArpHandleTrap09(TrapFrame);
break;
case 0x0A:
/* Invalid TSS exception */
ArpHandleTrap0A(TrapFrame);
break;
case 0x0B:
/* Segment Not Present exception */
ArpHandleTrap0B(TrapFrame);
break;
case 0x0C:
/* Stack Segment Fault exception */
ArpHandleTrap0C(TrapFrame);
break;
case 0x0D:
/* General Protection Fault (GPF) exception*/
ArpHandleTrap0D(TrapFrame);
break;
case 0x0E:
/* Page Fault exception */
ArpHandleTrap0E(TrapFrame);
break;
case 0x10:
/* X87 Floating-Point exception */
ArpHandleTrap10(TrapFrame);
break;
case 0x11:
/* Alignment Check exception */
ArpHandleTrap11(TrapFrame);
break;
case 0x12:
/* Machine Check exception */
ArpHandleTrap12(TrapFrame);
break;
case 0x13:
/* SIMD Floating-Point exception */
ArpHandleTrap13(TrapFrame);
break;
case 0x1F:
/* Software Interrupt at APC level */
ArpHandleTrap1F(TrapFrame);
break;
case 0x2C:
/* Assertion raised */
ArpHandleTrap2C(TrapFrame);
break;
case 0x2D:
/* Debug-Service-Request raised */
ArpHandleTrap2D(TrapFrame);
break;
case 0x2F:
/* Software Interrupt at DISPATCH level */
ArpHandleTrap2F(TrapFrame);
break;
case 0xE1:
/* InterProcessor Interrupt (IPI) */
ArpHandleTrapE1(TrapFrame);
break;
default:
/* Unknown/Unexpected trap */
ArpHandleTrapFF(TrapFrame);
break;
}
}
XTCDECL XTCDECL
VOID VOID
ArpHandleSystemCall32(VOID) ArpHandleSystemCall32(VOID)
@ -26,13 +146,16 @@ ArpHandleSystemCall64(VOID)
/** /**
* Handles the trap 0x00 when a Divide By Zero exception occurs. * Handles the trap 0x00 when a Divide By Zero exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap00(VOID) ArpHandleTrap00(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Division-By-Zero Error (0x00)!\n"); DebugPrint(L"Handled Division-By-Zero Error (0x00)!\n");
for(;;); for(;;);
@ -41,13 +164,16 @@ ArpHandleTrap00(VOID)
/** /**
* Handles the trap 0x01 when Debug exception occurs. * Handles the trap 0x01 when Debug exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap01(VOID) ArpHandleTrap01(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Debug exception (0x01)!\n"); DebugPrint(L"Handled Debug exception (0x01)!\n");
for(;;); for(;;);
@ -56,13 +182,16 @@ ArpHandleTrap01(VOID)
/** /**
* Handles the trap 0x02 when Non-Maskable Interrupt (NMI) occurs. * Handles the trap 0x02 when Non-Maskable Interrupt (NMI) occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap02(VOID) ArpHandleTrap02(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Non-Maskable-Interrupt (0x02)!\n"); DebugPrint(L"Handled Non-Maskable-Interrupt (0x02)!\n");
for(;;); for(;;);
@ -71,13 +200,16 @@ ArpHandleTrap02(VOID)
/** /**
* Handles the trap 0x03 when the INT3 instruction is executed. * Handles the trap 0x03 when the INT3 instruction is executed.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap03(VOID) ArpHandleTrap03(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled INT3 (0x03)!\n"); DebugPrint(L"Handled INT3 (0x03)!\n");
for(;;); for(;;);
@ -86,13 +218,16 @@ ArpHandleTrap03(VOID)
/** /**
* Handles the trap 0x04 when the INTO instruction is executed and overflow bit is set. * Handles the trap 0x04 when the INTO instruction is executed and overflow bit is set.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap04(VOID) ArpHandleTrap04(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Overflow exception (0x04)!\n"); DebugPrint(L"Handled Overflow exception (0x04)!\n");
for(;;); for(;;);
@ -101,13 +236,16 @@ ArpHandleTrap04(VOID)
/** /**
* Handles the trap 0x05 when the Bound Range Exceeded exception occurs. * Handles the trap 0x05 when the Bound Range Exceeded exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap05(VOID) ArpHandleTrap05(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Bound-Range-Exceeded exception (0x05)!\n"); DebugPrint(L"Handled Bound-Range-Exceeded exception (0x05)!\n");
for(;;); for(;;);
@ -116,13 +254,16 @@ ArpHandleTrap05(VOID)
/** /**
* Handles the trap 0x06 when the Invalid Opcode exception occurs. * Handles the trap 0x06 when the Invalid Opcode exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap06(VOID) ArpHandleTrap06(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Invalid Opcode exception (0x06)!\n"); DebugPrint(L"Handled Invalid Opcode exception (0x06)!\n");
for(;;); for(;;);
@ -131,13 +272,16 @@ ArpHandleTrap06(VOID)
/** /**
* Handles the trap 0x07 when the Device Not Available exception occurs. * Handles the trap 0x07 when the Device Not Available exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap07(VOID) ArpHandleTrap07(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Device Not Available exception (0x07)!\n"); DebugPrint(L"Handled Device Not Available exception (0x07)!\n");
for(;;); for(;;);
@ -146,13 +290,16 @@ ArpHandleTrap07(VOID)
/** /**
* Handles the trap 0x08 when Double Fault exception occurs. * Handles the trap 0x08 when Double Fault exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap08(VOID) ArpHandleTrap08(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Double-Fault exception (0x08)!\n"); DebugPrint(L"Handled Double-Fault exception (0x08)!\n");
for(;;); for(;;);
@ -161,13 +308,16 @@ ArpHandleTrap08(VOID)
/** /**
* Handles the trap 0x09 when the Segment Overrun exception occurs. * Handles the trap 0x09 when the Segment Overrun exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap09(VOID) ArpHandleTrap09(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Segment-Overrun exception (0x09)!\n"); DebugPrint(L"Handled Segment-Overrun exception (0x09)!\n");
for(;;); for(;;);
@ -176,13 +326,16 @@ ArpHandleTrap09(VOID)
/** /**
* Handles the trap 0x0A when the Invalid TSS exception occurs. * Handles the trap 0x0A when the Invalid TSS exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0A(VOID) ArpHandleTrap0A(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Invalid-TSS exception (0x0A)!\n"); DebugPrint(L"Handled Invalid-TSS exception (0x0A)!\n");
for(;;); for(;;);
@ -191,13 +344,16 @@ ArpHandleTrap0A(VOID)
/** /**
* Handles the trap 0x0B when the Segment Not Present exception occurs. * Handles the trap 0x0B when the Segment Not Present exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0B(VOID) ArpHandleTrap0B(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Segment-Not-Present exception (0x0B)!\n"); DebugPrint(L"Handled Segment-Not-Present exception (0x0B)!\n");
for(;;); for(;;);
@ -206,13 +362,16 @@ ArpHandleTrap0B(VOID)
/** /**
* Handles the trap 0x0C when the Stack Segment Fault exception occurs. * Handles the trap 0x0C when the Stack Segment Fault exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0C(VOID) ArpHandleTrap0C(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Stack-Segment-Fault exception (0x0C)!\n"); DebugPrint(L"Handled Stack-Segment-Fault exception (0x0C)!\n");
for(;;); for(;;);
@ -221,13 +380,16 @@ ArpHandleTrap0C(VOID)
/** /**
* Handles the trap 0x0D when General Protection Fault (GPF) exception occurs. * Handles the trap 0x0D when General Protection Fault (GPF) exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0D(VOID) ArpHandleTrap0D(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled General-Protection-Fault (0x0D)!\n"); DebugPrint(L"Handled General-Protection-Fault (0x0D)!\n");
for(;;); for(;;);
@ -236,13 +398,16 @@ ArpHandleTrap0D(VOID)
/** /**
* Handles the trap 0x0E when the Page Fault (PF) exception occurs. * Handles the trap 0x0E when the Page Fault (PF) exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0E(VOID) ArpHandleTrap0E(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Page-Fault exception (0x0E)!\n"); DebugPrint(L"Handled Page-Fault exception (0x0E)!\n");
for(;;); for(;;);
@ -251,13 +416,16 @@ ArpHandleTrap0E(VOID)
/** /**
* Handles the trap 0x10 when the X87 Floating-Point exception occurs. * Handles the trap 0x10 when the X87 Floating-Point exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap10(VOID) ArpHandleTrap10(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled x87 Floating-Point exception (0x10)!\n"); DebugPrint(L"Handled x87 Floating-Point exception (0x10)!\n");
for(;;); for(;;);
@ -266,13 +434,16 @@ ArpHandleTrap10(VOID)
/** /**
* Handles the trap 0x11 when the Alignment Check exception occurs. * Handles the trap 0x11 when the Alignment Check exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap11(VOID) ArpHandleTrap11(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Alignment-Check exception (0x11)!\n"); DebugPrint(L"Handled Alignment-Check exception (0x11)!\n");
for(;;); for(;;);
@ -281,13 +452,16 @@ ArpHandleTrap11(VOID)
/** /**
* Handles the trap 0x12 when the Machine Check exception occurs. * Handles the trap 0x12 when the Machine Check exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap12(VOID) ArpHandleTrap12(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Machine-Check exception (0x12)!\n"); DebugPrint(L"Handled Machine-Check exception (0x12)!\n");
for(;;); for(;;);
@ -296,20 +470,26 @@ ArpHandleTrap12(VOID)
/** /**
* Handles the trap 0x13 when the SIMD Floating-Point exception occurs. * Handles the trap 0x13 when the SIMD Floating-Point exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap13(VOID) ArpHandleTrap13(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled SIMD Floating-Point exception (0x13)!\n"); DebugPrint(L"Handled SIMD Floating-Point exception (0x13)!\n");
for(;;); for(;;);
} }
/** /**
* Handles the trap 0x2C when an assertion is raised. * Handles the trap 0x1F when software interrupt gets generated at APC_LEVEL.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
* *
* @return This routine does not return any value. * @return This routine does not return any value.
* *
@ -317,7 +497,24 @@ ArpHandleTrap13(VOID)
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap2C(VOID) ArpHandleTrap1F(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled software interrupt at APC level (0x1F)!\n");
}
/**
* Handles the trap 0x2C when an assertion is raised.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrap2C(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Assertion (0x2C)!\n"); DebugPrint(L"Handled Assertion (0x2C)!\n");
for(;;); for(;;);
@ -326,20 +523,26 @@ ArpHandleTrap2C(VOID)
/** /**
* Handles the trap 0x2D when a debug service is being requested. * Handles the trap 0x2D when a debug service is being requested.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap2D(VOID) ArpHandleTrap2D(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Debug-Service-Request (0x2D)!\n"); DebugPrint(L"Handled Debug-Service-Request (0x2D)!\n");
for(;;); for(;;);
} }
/** /**
* Handles the trap 0xFF then Unexpected Interrupt occurs. * Handles the trap 0x2F when a software interrupt gets generated at DISPATCH_LEVEL.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
* *
* @return This routine does not return any value. * @return This routine does not return any value.
* *
@ -347,7 +550,41 @@ ArpHandleTrap2D(VOID)
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrapFF(VOID) ArpHandleTrap2F(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled software interrupt at DISPATCH level (0x2F)!\n");
}
/**
* Handles the trap 0xE1 when InterProcessor Interrupt (IPI) occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrapE1(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled IPI interrupt (0xE1)!\n");
}
/**
* Handles the trap 0xFF when Unexpected Interrupt occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrapFF(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Unexpected-Interrupt (0xFF)!\n"); DebugPrint(L"Handled Unexpected-Interrupt (0xFF)!\n");
for(;;); for(;;);

109
xtoskrnl/ar/i686/archsup.S Normal file
View File

@ -0,0 +1,109 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ar/i686/archsup.S
* DESCRIPTION: Provides i686 architecture features not implementable in C.
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
.altmacro
.text
/**
* This macro creates a trap handler for the specified vector.
*
* @param Vector
* Supplies a trap vector number.
*
* @return This macro does not return any value.
*
* @since XT 1.0
*/
.macro ArpCreateTrapHandler Vector
.global _ArpTrap\Vector
_ArpTrap\Vector:
/* Push fake error code for non-error vectors */
.if \Vector != 8 && \Vector != 10 && \Vector != 11 && \Vector != 12 && \Vector != 13 && \Vector != 14 && \Vector != 17 && \Vector != 30
push $0
.endif
/* Push vector number */
push $\Vector
/* Push General Purpose Registers */
push %ebp
push %edi
push %esi
push %edx
push %ecx
push %ebx
push %eax
/* Push Segments */
mov %gs, %ax
push %ax
mov %fs, %ax
push %ax
mov %es, %ax
push %ax
mov %ds, %ax
push %ax
/* Push Control Registers */
mov %cr3, %eax
push %eax
mov %cr2, %eax
push %eax
/* Push Debug Registers */
mov %dr7, %eax
push %eax
mov %dr6, %eax
push %eax
mov %dr3, %eax
push %eax
mov %dr2, %eax
push %eax
mov %dr1, %eax
push %eax
mov %dr0, %eax
push %eax
/* Push Frame Pointer, clear direction flag and pass to trap dispatcher */
push %esp
cld
call _ArpDispatchTrap
/* Clean up the stack */
add $4, %esp
/* Skip space occupied by Debug Registers */
add $(6 * 4), %esp
/* Skip space occupied by CR2 and CR3 */
add $(2 * 4), %esp
/* Skip space occupied by Segments */
add $(4 * 2), %esp
/* Pop General Purpose Registers */
pop %eax
pop %ebx
pop %ecx
pop %edx
pop %esi
pop %edi
pop %ebp
/* Skip error code and vector number, then return */
add $(2 * 4), %esp
iretl
.endm
/* Populate common trap handlers */
.irp i,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
.irp j,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
ArpCreateTrapHandler 0x\i\j
.endr
.endr

View File

@ -233,27 +233,30 @@ ArpInitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
} }
/* Setup IDT handlers for known interrupts and traps */ /* Setup IDT handlers for known interrupts and traps */
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x00, ArpHandleTrap00, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x00, ArpTrap0x00, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x01, ArpHandleTrap01, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x01, ArpTrap0x01, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x02, ArpHandleTrap02, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x02, ArpTrap0x02, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x03, ArpHandleTrap03, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x03, ArpTrap0x03, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x04, ArpHandleTrap04, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x04, ArpTrap0x04, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x05, ArpHandleTrap05, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x05, ArpTrap0x05, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x06, ArpHandleTrap06, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x06, ArpTrap0x06, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x07, ArpHandleTrap07, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x07, ArpTrap0x07, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x08, ArpHandleTrap08, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x08, ArpTrap0x08, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x09, ArpHandleTrap09, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x09, ArpTrap0x09, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0A, ArpHandleTrap0A, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0A, ArpTrap0x0A, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0B, ArpHandleTrap0B, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0B, ArpTrap0x0B, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0C, ArpHandleTrap0C, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0C, ArpTrap0x0C, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0D, ArpHandleTrap0D, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0D, ArpTrap0x0D, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0E, ArpHandleTrap0E, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x0E, ArpTrap0x0E, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x10, ArpHandleTrap10, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x10, ArpTrap0x10, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x11, ArpHandleTrap11, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x11, ArpTrap0x11, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x12, ArpHandleTrap12, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x12, ArpTrap0x12, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x13, ArpHandleTrap13, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x13, ArpTrap0x13, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING0);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2C, ArpHandleTrap2C, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2A, ArpTrap0x2A, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2D, ArpHandleTrap2D, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3); ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2B, ArpTrap0x2B, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2C, ArpTrap0x2C, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2D, ArpTrap0x2D, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
ArpSetIdtGate(ProcessorBlock->IdtBase, 0x2E, ArpTrap0x2E, KGDT_R0_CODE, 0, KIDT_INTERRUPT | KIDT_ACCESS_RING3);
} }
/** /**

View File

@ -10,7 +10,10 @@
/** /**
* Handles the trap 0x00 when a Divide By Zero exception occurs. * Dispatches the trap provided by common trap handler.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
* *
* @return This routine does not return any value. * @return This routine does not return any value.
* *
@ -18,7 +21,127 @@
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap00(VOID) ArpDispatchTrap(IN PKTRAP_FRAME TrapFrame)
{
/* Check vector and call appropriate handler */
switch(TrapFrame->Vector)
{
case 0x00:
/* Divide By Zero exception */
ArpHandleTrap00(TrapFrame);
break;
case 0x01:
/* Debug exception */
ArpHandleTrap01(TrapFrame);
break;
case 0x02:
/* Non-Maskable Interrupt (NMI) */
ArpHandleTrap02(TrapFrame);
break;
case 0x03:
/* INT3 instruction executed */
ArpHandleTrap03(TrapFrame);
break;
case 0x04:
/* Overflow exception */
ArpHandleTrap04(TrapFrame);
break;
case 0x05:
/* Bound Range Exceeded exception */
ArpHandleTrap05(TrapFrame);
break;
case 0x06:
/* Invalid Opcode exception */
ArpHandleTrap06(TrapFrame);
break;
case 0x07:
/* Device Not Available exception */
ArpHandleTrap07(TrapFrame);
break;
case 0x08:
/* Double Fault exception */
ArpHandleTrap08(TrapFrame);
break;
case 0x09:
/* Segment Overrun exception */
ArpHandleTrap09(TrapFrame);
break;
case 0x0A:
/* Invalid TSS exception */
ArpHandleTrap0A(TrapFrame);
break;
case 0x0B:
/* Segment Not Present exception */
ArpHandleTrap0B(TrapFrame);
break;
case 0x0C:
/* Stack Segment Fault exception */
ArpHandleTrap0C(TrapFrame);
break;
case 0x0D:
/* General Protection Fault (GPF) exception*/
ArpHandleTrap0D(TrapFrame);
break;
case 0x0E:
/* Page Fault exception */
ArpHandleTrap0E(TrapFrame);
break;
case 0x10:
/* X87 Floating-Point exception */
ArpHandleTrap10(TrapFrame);
break;
case 0x11:
/* Alignment Check exception */
ArpHandleTrap11(TrapFrame);
break;
case 0x12:
/* Machine Check exception */
ArpHandleTrap12(TrapFrame);
break;
case 0x13:
/* SIMD Floating-Point exception */
ArpHandleTrap13(TrapFrame);
break;
case 0x2A:
/* Tick Count service request */
ArpHandleTrap2A(TrapFrame);
break;
case 0x2B:
/* User-mode callback return */
ArpHandleTrap2B(TrapFrame);
break;
case 0x2C:
/* Assertion raised */
ArpHandleTrap2C(TrapFrame);
break;
case 0x2D:
/* Debug-Service-Request raised */
ArpHandleTrap2D(TrapFrame);
break;
case 0x2E:
/* System call service request */
ArpHandleTrap2E(TrapFrame);
break;
default:
/* Unknown/Unexpected trap */
ArpHandleTrapFF(TrapFrame);
break;
}
}
/**
* Handles the trap 0x00 when a Divide By Zero exception occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrap00(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Division-By-Zero Error (0x00)!\n"); DebugPrint(L"Handled Division-By-Zero Error (0x00)!\n");
for(;;); for(;;);
@ -27,13 +150,16 @@ ArpHandleTrap00(VOID)
/** /**
* Handles the trap 0x01 when Debug exception occurs. * Handles the trap 0x01 when Debug exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap01(VOID) ArpHandleTrap01(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Debug exception (0x01)!\n"); DebugPrint(L"Handled Debug exception (0x01)!\n");
for(;;); for(;;);
@ -42,13 +168,16 @@ ArpHandleTrap01(VOID)
/** /**
* Handles the trap 0x02 when Non-Maskable Interrupt (NMI) occurs. * Handles the trap 0x02 when Non-Maskable Interrupt (NMI) occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap02(VOID) ArpHandleTrap02(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Non-Maskable-Interrupt (0x02)!\n"); DebugPrint(L"Handled Non-Maskable-Interrupt (0x02)!\n");
for(;;); for(;;);
@ -57,13 +186,16 @@ ArpHandleTrap02(VOID)
/** /**
* Handles the trap 0x03 when the INT3 instruction is executed. * Handles the trap 0x03 when the INT3 instruction is executed.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap03(VOID) ArpHandleTrap03(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled INT3 (0x03)!\n"); DebugPrint(L"Handled INT3 (0x03)!\n");
for(;;); for(;;);
@ -72,13 +204,16 @@ ArpHandleTrap03(VOID)
/** /**
* Handles the trap 0x04 when the INTO instruction is executed and overflow bit is set. * Handles the trap 0x04 when the INTO instruction is executed and overflow bit is set.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap04(VOID) ArpHandleTrap04(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Overflow exception (0x04)!\n"); DebugPrint(L"Handled Overflow exception (0x04)!\n");
for(;;); for(;;);
@ -87,13 +222,16 @@ ArpHandleTrap04(VOID)
/** /**
* Handles the trap 0x05 when the Bound Range Exceeded exception occurs. * Handles the trap 0x05 when the Bound Range Exceeded exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap05(VOID) ArpHandleTrap05(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Bound-Range-Exceeded exception (0x05)!\n"); DebugPrint(L"Handled Bound-Range-Exceeded exception (0x05)!\n");
for(;;); for(;;);
@ -102,13 +240,16 @@ ArpHandleTrap05(VOID)
/** /**
* Handles the trap 0x06 when the Invalid Opcode exception occurs. * Handles the trap 0x06 when the Invalid Opcode exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap06(VOID) ArpHandleTrap06(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Invalid Opcode exception (0x06)!\n"); DebugPrint(L"Handled Invalid Opcode exception (0x06)!\n");
for(;;); for(;;);
@ -117,13 +258,16 @@ ArpHandleTrap06(VOID)
/** /**
* Handles the trap 0x07 when the Device Not Available exception occurs. * Handles the trap 0x07 when the Device Not Available exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap07(VOID) ArpHandleTrap07(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Device Not Available exception (0x07)!\n"); DebugPrint(L"Handled Device Not Available exception (0x07)!\n");
for(;;); for(;;);
@ -132,13 +276,16 @@ ArpHandleTrap07(VOID)
/** /**
* Handles the trap 0x08 when Double Fault exception occurs. * Handles the trap 0x08 when Double Fault exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap08(VOID) ArpHandleTrap08(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Double-Fault exception (0x08)!\n"); DebugPrint(L"Handled Double-Fault exception (0x08)!\n");
for(;;); for(;;);
@ -147,13 +294,16 @@ ArpHandleTrap08(VOID)
/** /**
* Handles the trap 0x09 when the Segment Overrun exception occurs. * Handles the trap 0x09 when the Segment Overrun exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap09(VOID) ArpHandleTrap09(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Segment-Overrun exception (0x09)!\n"); DebugPrint(L"Handled Segment-Overrun exception (0x09)!\n");
for(;;); for(;;);
@ -162,13 +312,16 @@ ArpHandleTrap09(VOID)
/** /**
* Handles the trap 0x0A when the Invalid TSS exception occurs. * Handles the trap 0x0A when the Invalid TSS exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0A(VOID) ArpHandleTrap0A(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Invalid-TSS exception (0x0A)!\n"); DebugPrint(L"Handled Invalid-TSS exception (0x0A)!\n");
for(;;); for(;;);
@ -177,13 +330,16 @@ ArpHandleTrap0A(VOID)
/** /**
* Handles the trap 0x0B when the Segment Not Present exception occurs. * Handles the trap 0x0B when the Segment Not Present exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0B(VOID) ArpHandleTrap0B(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Segment-Not-Present exception (0x0B)!\n"); DebugPrint(L"Handled Segment-Not-Present exception (0x0B)!\n");
for(;;); for(;;);
@ -192,13 +348,16 @@ ArpHandleTrap0B(VOID)
/** /**
* Handles the trap 0x0C when the Stack Segment Fault exception occurs. * Handles the trap 0x0C when the Stack Segment Fault exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0C(VOID) ArpHandleTrap0C(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Stack-Segment-Fault exception (0x0C)!\n"); DebugPrint(L"Handled Stack-Segment-Fault exception (0x0C)!\n");
for(;;); for(;;);
@ -207,13 +366,16 @@ ArpHandleTrap0C(VOID)
/** /**
* Handles the trap 0x0D when General Protection Fault (GPF) exception occurs. * Handles the trap 0x0D when General Protection Fault (GPF) exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0D(VOID) ArpHandleTrap0D(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled General-Protection-Fault (0x0D)!\n"); DebugPrint(L"Handled General-Protection-Fault (0x0D)!\n");
for(;;); for(;;);
@ -222,13 +384,16 @@ ArpHandleTrap0D(VOID)
/** /**
* Handles the trap 0x0E when the Page Fault (PF) exception occurs. * Handles the trap 0x0E when the Page Fault (PF) exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap0E(VOID) ArpHandleTrap0E(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Page-Fault exception (0x0E)!\n"); DebugPrint(L"Handled Page-Fault exception (0x0E)!\n");
for(;;); for(;;);
@ -237,13 +402,16 @@ ArpHandleTrap0E(VOID)
/** /**
* Handles the trap 0x10 when the X87 Floating-Point exception occurs. * Handles the trap 0x10 when the X87 Floating-Point exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap10(VOID) ArpHandleTrap10(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled x87 Floating-Point exception (0x10)!\n"); DebugPrint(L"Handled x87 Floating-Point exception (0x10)!\n");
for(;;); for(;;);
@ -252,13 +420,16 @@ ArpHandleTrap10(VOID)
/** /**
* Handles the trap 0x11 when the Alignment Check exception occurs. * Handles the trap 0x11 when the Alignment Check exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap11(VOID) ArpHandleTrap11(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Alignment-Check exception (0x11)!\n"); DebugPrint(L"Handled Alignment-Check exception (0x11)!\n");
for(;;); for(;;);
@ -267,13 +438,16 @@ ArpHandleTrap11(VOID)
/** /**
* Handles the trap 0x12 when the Machine Check exception occurs. * Handles the trap 0x12 when the Machine Check exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap12(VOID) ArpHandleTrap12(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Machine-Check exception (0x12)!\n"); DebugPrint(L"Handled Machine-Check exception (0x12)!\n");
for(;;); for(;;);
@ -282,20 +456,26 @@ ArpHandleTrap12(VOID)
/** /**
* Handles the trap 0x13 when the SIMD Floating-Point exception occurs. * Handles the trap 0x13 when the SIMD Floating-Point exception occurs.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap13(VOID) ArpHandleTrap13(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled SIMD Floating-Point exception (0x13)!\n"); DebugPrint(L"Handled SIMD Floating-Point exception (0x13)!\n");
for(;;); for(;;);
} }
/** /**
* Handles the trap 0x2C when an assertion is raised. * Handles the trap 0x2A when Tick Count service request occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
* *
* @return This routine does not return any value. * @return This routine does not return any value.
* *
@ -303,7 +483,41 @@ ArpHandleTrap13(VOID)
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap2C(VOID) ArpHandleTrap2A(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled Tick Count service request (0x2A)!\n");
}
/**
* Handles the trap 0x2B when Callback return service request occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrap2B(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled Callback return service request (0x2B)!\n");
}
/**
* Handles the trap 0x2C when an assertion is raised.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrap2C(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Assertion (0x2C)!\n"); DebugPrint(L"Handled Assertion (0x2C)!\n");
for(;;); for(;;);
@ -312,20 +526,26 @@ ArpHandleTrap2C(VOID)
/** /**
* Handles the trap 0x2D when a debug service is being requested. * Handles the trap 0x2D when a debug service is being requested.
* *
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value. * @return This routine does not return any value.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrap2D(VOID) ArpHandleTrap2D(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Debug-Service-Request (0x2D)!\n"); DebugPrint(L"Handled Debug-Service-Request (0x2D)!\n");
for(;;); for(;;);
} }
/** /**
* Handles the trap 0xFF then Unexpected Interrupt occurs. * Handles the trap 0x2E when a system call is being requested.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
* *
* @return This routine does not return any value. * @return This routine does not return any value.
* *
@ -333,7 +553,24 @@ ArpHandleTrap2D(VOID)
*/ */
XTCDECL XTCDECL
VOID VOID
ArpHandleTrapFF(VOID) ArpHandleTrap2E(IN PKTRAP_FRAME TrapFrame)
{
DebugPrint(L"Unhandled system call (0x2E)!\n");
}
/**
* Handles the trap 0xFF then Unexpected Interrupt occurs.
*
* @param TrapFrame
* Supplies a kernel trap frame pushed by common trap handler on the stack.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
ArpHandleTrapFF(IN PKTRAP_FRAME TrapFrame)
{ {
DebugPrint(L"Handled Unexpected-Interrupt (0xFF)!\n"); DebugPrint(L"Handled Unexpected-Interrupt (0xFF)!\n");
for(;;); for(;;);