Is there a way to debug my kernel at source level?

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
Peterbjornx
Member
Member
Posts: 116
Joined: Thu May 06, 2010 4:34 am
Libera.chat IRC: peterbjornx
Location: Leiden, The Netherlands
Contact:

Is there a way to debug my kernel at source level?

Post by Peterbjornx »

I am working on a OS kernel and i got a nasty bug i cant seem to fix with bochs internal debugger, and of course i cannot use MSVC's built-in debugger, so what can i use for this purpose??
TylerH
Member
Member
Posts: 285
Joined: Tue Apr 13, 2010 8:00 pm
Contact:

Re: Is there a way to debug my kernel at source level?

Post by TylerH »

You would have to build the debugging into your kernel, AFAIK.
User avatar
MDM
Member
Member
Posts: 57
Joined: Wed Jul 21, 2010 9:05 pm

Re: Is there a way to debug my kernel at source level?

Post by MDM »

Generally under such a situation, I decompile the code, and write out on a piece of paper what is happening according to the op code. Depending on the level of the bug you may have to rely on this technique.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Is there a way to debug my kernel at source level?

Post by gravaera »

You'll never know how amazing and awesome "printf()" and infinite loops are until you try them :)
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Is there a way to debug my kernel at source level?

Post by gerryg400 »

MDM wrote:Generally under such a situation, I decompile the code, and write out on a piece of paper what is happening according to the op code.
gravaera wrote:You'll never know how amazing and awesome "printf()" and infinite loops are until you try them :)
Concur. The only debugging methods you'll ever need.
If a trainstation is where trains stop, what is a workstation ?
Peterbjornx
Member
Member
Posts: 116
Joined: Thu May 06, 2010 4:34 am
Libera.chat IRC: peterbjornx
Location: Leiden, The Netherlands
Contact:

Re: Is there a way to debug my kernel at source level?

Post by Peterbjornx »

I fixed the bug now, and indeed i just had to make my dprintf's a little more detailed :)
Post Reply