Hardware debuging

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
nukthem
Posts: 1
Joined: Tue Mar 21, 2006 12:00 am

Hardware debuging

Post by nukthem »

Hi!

I am trying to write my own debugging software for my kernel.
I have managed to get the 'single step' mode to work. (after each instruction a debug exception is fired)
Now I want to get a debug exception when an instruction at a specific memory location is executed.
Here's my code:

Code: Select all

mov eax, break_loc ; the code segment starts at linear mem location 0x0, so offset of break_loc = linear address of break_loc
mov dr0, eax
mov eax, dr7
and eax, 0x0000fc00
or eax, 0x00000202
mov dr7, eax
But when I run the code in Bochs or other vms there comes no debug exception when the code at 'break_loc' is executed.
I think the linear address of 'break_loc' in dr0 should be valid. So where's the mistake?
Post Reply