Page 1 of 1

Higher-half kernel causes exception

Posted: Thu Apr 08, 2021 1:40 pm
by arraystock
Hello everyone,

Recently I have begun working on my higher half kernel. It was able to boot and print some output through QEMU, and I began working on my GDT.

However, I came across a problem: When I include my GDT code in the kernel, the kernel triggers an exception. The GDT code isn't even running, it happens somewhere in the initialization where the kernel maps itself above the 3GB marker. I think it is due to the increased size, but the kernel is only ~25KiB.

I have been struggling to tackle this problem.

My code is here: https://github.com/JonArcherII/mobius

Thanks in advance!

Re: Higher-half kernel causes exception

Posted: Thu Apr 08, 2021 9:00 pm
by Octocontrabass
arraystock wrote:When I include my GDT code in the kernel, the kernel triggers an exception.
Which exception?

What's the CPU state when the exception occurs?

(You can find the answers to both questions by adding "-d int" to your QEMU command line. You may need to disable hardware acceleration. You might also want to add "-no-reboot".)