Code: Select all
init_descriptor(&gdt[INDEX_LDT_FIRST],
vir2phys(seg2phys(SELECTOR_KERNEL_DS), proc_table[0].ldts),
LDT_SIZE * sizeof(DESCRIPTOR) - 1,
DA_LDT);
Code: Select all
PUBLIC t_32 seg2phys(t_16 seg)
{
DESCRIPTOR* p_dest = &gdt[seg >> 3];
return (p_dest->base_high << 24) | (p_dest->base_mid << 16) | (p_dest->base_low);
}
1. Should I use gdb protect.o(executable file compiled with protect.c) or gdb boot.bin(boot file which is loaded in 0x7c00h) to start the gdb at first?
2. I have run the command gdb protect.o to start the gdb and connected to bochs successfully using target remote localhost:1234. Then I set a breakpoint(b seg2phys) successfully, but when I continue the os with command continue, gdb didn't stop at that breakpoint and bochs continued to run without any stop. I'm quite sure that the function will be executed in os running. But why didn't it stop? Is there any place that I go wrong?
3. Is there any website that illustrates how to use bochs with gdbstub in detail? I have searched the Internet for a long time, but only found some simple tutorials.
Thanks
MarkZar