Messages in this thread | | | Date | Fri, 7 Oct 2011 07:54:24 -0400 | Subject | Re: x86: gdt_page and debugging from gdb against /proc | From | Brian Gerst <> |
| |
On Fri, Oct 7, 2011 at 7:18 AM, myname <33user@gmail.com> wrote: > in kernel/cpu/kernel/common.c, the initialization for the gdt_table symbol is like the following: > > [GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xc09a, 0, 0xfffff), > [GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc092, 0, 0xfffff), > [GDT_ENTRY_DEFAULT_USER_CS] = GDT_ENTRY_INIT(0xc0fa, 0, 0xfffff), > [GDT_ENTRY_DEFAULT_USER_DS] = GDT_ENTRY_INIT(0xc0f2, 0, 0xfffff), > > so, that the gtd_page[12] should have base = 0, and limit = 0xffffff, and so on for the next 3 slots in the array. > > now if i do: `sudo gdb -q ~/linux-3.0.3/vmlinux /proc/kcore' and in gdb ask for the command p/t gdt_table, i get, which obviously if you check for base and limit in member 12, 13 and so on, doesn't fit the above description. why?
gdt_page is a per-cpu variable, so you are looking at the original location in init mem that has been overwritten with other data.
-- Brian Gerst -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |