flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Debug register |
Author |
|
revolution 14 Dec 2018, 16:35
I think the best place to see how the x86 debug registers are used is in the official Intel and AMD documents.
|
|||
14 Dec 2018, 16:35 |
|
Fulgurance 15 Dec 2018, 13:28
I just use Intel. I have search on Intel Book, i have found section about Debug Register, but i don't understand when this register are writting by processor and how.
How i use this interrupt? It's not very clear https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf Is it with stack only ? I don't understand very well |
|||
15 Dec 2018, 13:28 |
|
revolution 15 Dec 2018, 14:20
You can use the MOV instruction read and write the debug registers.
Code: mov dr0,eax mov ebx,dr1 |
|||
15 Dec 2018, 14:20 |
|
Fulgurance 15 Dec 2018, 17:32
Okay. And how I interpret value of this register ? And when ?
|
|||
15 Dec 2018, 17:32 |
|
revolution 16 Dec 2018, 00:55
The layout of DR0..7 is quite complicated. Some registers enable various features with bit settings, and others hold linear breakpoint addresses.
Your code would write to the registers and the CPU will fault/trap when all the conditions are met. Then you catch the fault/trap with the normal exception mechanisms in your OS and show the user a breakpoint was reached. |
|||
16 Dec 2018, 00:55 |
|
Fulgurance 17 Dec 2018, 10:09
No example ?
Without example, it's quite difficult, this fonction isn't very documented... |
|||
17 Dec 2018, 10:09 |
|
revolution 17 Dec 2018, 10:33
I assume you are writing your own OS based upon the forum you selected. So any example will rely upon how your OS works when exceptions happen, and how you interface with applications to allow setting the DR registers.
At the CPU level it is just a matter of setting the registers and waiting for the triggers to fire. Everything else is handled by the OS/debugger/application code. |
|||
17 Dec 2018, 10:33 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.