OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:03 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Fault Occures on Key Press
PostPosted: Sat Mar 11, 2023 7:14 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
You were wondering where in virtual memory your kernel was, this answers that can be determined from 'IP=0028:ffffffff80000184' . Your kernel was loaded at ffffffff80000000. It also confirms that CS should be set to 0x28 in your interrupt handlers which is what the Limine documentation suggested.

On a side note: Division by zero can be caused by two things - division by zero and division overflow.


Top
 Profile  
 
 Post subject: Re: Fault Occures on Key Press
PostPosted: Sun Mar 12, 2023 2:39 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
FunnyGuy9796 wrote:
Indeed I did not remap the PIC. I, being new to this, accidentally overlooked the fact that the PIC needs to be initialized before the APIC. Thanks guy again for the help! (I know my questions and lack of understanding can be annoying)


I think you need to know if your system runs with the legacy PIC or with APIC. If you use APIC, you will normally not use the PIC, and if there is legacy support, the legacy PIC is typically disabled.

It's mostly old systems that require the use of PIC.


Top
 Profile  
 
 Post subject: Re: Fault Occures on Key Press
PostPosted: Sun Mar 12, 2023 8:14 am 
Offline
Member
Member

Joined: Tue Sep 13, 2022 9:29 pm
Posts: 61
Ok, everything now works as intended after remapping the PIC. Thank you guys for your help! I very much appreciated it.


Top
 Profile  
 
 Post subject: Re: Fault Occures on Key Press
PostPosted: Sun Mar 12, 2023 10:41 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
I'm going to recommend at this point that using a debugger will come in very handy moving forward. Although I had you use QEMU to dump out the interrupts and exceptions to narrow down your problem(s) that is just one method of getting info. Since you are using QEMU I recommend you start building all your assembly code and C/C++ code etc with debug info. You can attach GDB to QEMU using its remote interface. This would allow you to step through the code. The ability to use a debugger will probably be the most valuable skill as you continue your OSdev journey.

Since you don't say how you build everything, I can't offer explicit instructions on building a kernel for debugging so that it can be debugged in a QEMU session with GDB.


Top
 Profile  
 
 Post subject: Re: Fault Occures on Key Press
PostPosted: Sun Mar 12, 2023 10:43 am 
Offline
Member
Member

Joined: Tue Sep 13, 2022 9:29 pm
Posts: 61
Thanks for the advice! I was already looking in to setting up a GDB with QEMU but haven’t gotten around to it yet. Definitely will do it though!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group