I apologize in advance if this is a basic or stupid question. However, I was curious if there was a way to verify that the GDT is set up properly. I assume it would have something to do with the GDTR register but I wasn't sure.
Thanks
Verifying the GDT
-
- Member
- Posts: 61
- Joined: Tue Sep 13, 2022 9:29 pm
- Libera.chat IRC: FunnyGuy9796
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Verifying the GDT
The easiest way to verify your GDT is to use it. If it works, you must have done something right.
You can use "info gdt" in the Bochs debugger to decode the contents of the current GDT. It doesn't quite display everything, but it's good for a quick sanity check.
You can use "sreg" in the Bochs debugger or "info registers" in the QEMU monitor to decode the contents of the segment registers. Of course, you have to load descriptors from your GDT into the segment registers before you can see them this way.
Other virtual machines probably have similar tools, but I'm not familiar with any of them.
You can use "info gdt" in the Bochs debugger to decode the contents of the current GDT. It doesn't quite display everything, but it's good for a quick sanity check.
You can use "sreg" in the Bochs debugger or "info registers" in the QEMU monitor to decode the contents of the segment registers. Of course, you have to load descriptors from your GDT into the segment registers before you can see them this way.
Other virtual machines probably have similar tools, but I'm not familiar with any of them.