I am new to learning os development, and am working on a little hobby OS. Over the last couple days, I have finally been able to create a higher half kernel using limine as the bootloader. I am currently working on trying to get keyboard input and put it on the screen, however, I keep getting a weird page fault issue. I've spent all day on it, so I am hoping somebody else can see the issue I am unable to. I have a working GDT, IDT, and PIC, and the keystrokes will put a simple '.' on the screen. However, if I press 2 keys at the same time, the kernel halts in the page fault exception handler. I found a way around it by just reenabling interrupts in the handler, but something seems very bizzarre to me that it is even throwing the page fault exception.
This is what qemu debug displays:
Code: Select all
check_exception old: 0xffffffff new 0xe
13: v=0e e=0010 i=0 cpl=0 IP=0028:0000000000000028 pc=0000000000000028 SP=0030:ffff800007b20de8 CR2=0000000000000028
RAX=0000000000000020 RBX=0000000000000000 RCX=0000000000000009 RDX=0000000000000020
RSI=0000000000000020 RDI=0000000000000020 RBP=ffff800007b20ff0 RSP=ffff800007b20de8
R8 =0000000000000028 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000
RIP=0000000000000028 RFL=00000216 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0030 0000000000000000 00000fff 00a09300 DPL=0 DS [-WA]
CS =0028 0000000000000000 20000fff 00a29a00 DPL=0 CS64 [-R-]
SS =0030 0000000000000000 00000fff 00a09300 DPL=0 DS [-WA]
DS =0030 0000000000000000 00000fff 00a09300 DPL=0 DS [-WA]
FS =0030 0000000000000000 00000fff 00a09300 DPL=0 DS [-WA]
GS =0030 0000000000000000 00000fff 00a09300 DPL=0 DS [-WA]
LDT=0000 0000000000000000 00000000 00008200 DPL=0 LDT
TR =0048 ffffffff80012560 00000068 00208900 DPL=0 TSS64-avl
GDT= ffffffff800024a0 00000057
IDT= ffffffff800125e0 00000fff
CR0=80010011 CR2=0000000000000028 CR3=0000000007b10000 CR4=00000020
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=0000000000000018 CCD=0000000007b28000 CCO=ADDL
EFER=0000000000000d00
(It is a mess right now while I am trying to debug this issue)
https://github.com/Programatic/PokerOS