Higher-half kernel causes exception

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
arraystock
Posts: 4
Joined: Sun Feb 03, 2019 8:30 am
Location: Minnesota
Contact:

Higher-half kernel causes exception

Post 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!
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Higher-half kernel causes exception

Post 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".)
Post Reply