0

I'm working on x86 architecture , I would like to set a breakpoint on global descriptor table entry or the interpret descriptor table entry or ldt- it means that, for example, every time a specific entry being read from idt/gdt/ldt a breakpoint will be triggered.

I'm trying to emulate this scenario with bochs x86 emulator, but i am having a trouble to do it.

Thanks.

IceCube
  • 405
  • 1
  • 5
  • 12

1 Answers1

2

I succeeded to put breakpoints only on idt entry (if someone know how to debug the gdt or ldt I would like to know as well)

1. I turned on the interrupt trace by: show int

(show, when interrupt is happens)

2. I let bochs run with Linux "dos".

00200280100: iret 0010:0017937b (0xc017937b)

00200280101: exception (not softint) 0010:0010c8dd (0xc010c8dd)

00200281076: iret 0010:0017937b (0xc017937b)

00200281119: exception (not softint) 0x0010:0010aa30 (0xc010aa30)

3. I looked for an exception address that is also entry in the idt I found that 0010:0010aa30 is the address of entry number 0x0e witch is the "page fault" interupt.

Interrupt Descriptor Table (base=0x00000000c0106060, limit=2047): IDT[0x0e]=32-Bit Trap Gate target=0x0010:0010aa30, DPL=0

4. I put a break point in the virtual address: 0x0010:0x0010aa30

vbreak 0x0010:0010aa30

5. I let the machine to run and got:

00200302058: exception (not softint) 0010:0010aa30 (0xc010aa30)

(0) Breakpoint 5684127, in 0010:0010aa30 (0xc010aa30) Next at t=200302058

(0) [0x00000010aa30] 0010:000000000010aa30 (unk. ctxt): push 0x00110200 ; 6800021100

  • Thanks! I don't think this method will work for gdt/ldt, we need to find out how to trigger gdt/ldt read/write scenario – IceCube Feb 16 '15 at 13:04