Page 1 of 1
gdt question
Posted: Fri Aug 10, 2007 1:16 pm
by sancho1980
hi
i have a question to ask:
suppose i load my gdt with
and then load my ds with
.
now suppose that i modify that same descriptor whose selector is currently loaded in ds. when should this change become effective:
1) immediately
2) the next time i do
3) the next time i do
???
Posted: Fri Aug 10, 2007 1:40 pm
by urxae
The next time you load the register.
Posted: Fri Aug 10, 2007 1:54 pm
by sancho1980
do you just say that or are you 100% sure? the reason being that i am doing that and i dont see how my newly written descriptor is having any effect on my active segment, so im trying to figure out if its because i am not correctly writing to the descriptor or if i have to load the gdt anew...
should i be able to do lgdt once i am in 32-pm? or can i do that only in preparation, i.e. BEFORE switching to pm?
Posted: Fri Aug 10, 2007 2:04 pm
by jnc100
The hidden parts of the segment register are loaded from the gdt when you load the selector into the register (see the Intel manual on mov). You can change the gdt at any time with lgdt (either real mode or protected mode) although the hidden parts of the segment registers will still have their old values.
Regards,
John.
Posted: Fri Aug 10, 2007 2:41 pm
by sancho1980
is there a way to find out what the values in the hidden parts are?
Posted: Fri Aug 10, 2007 2:53 pm
by jnc100
Bochs debugger? Try 'info cpu'.
Regards,
John.
Posted: Fri Aug 10, 2007 4:35 pm
by sancho1980
im using qemu
ive tried to compile bochs under linux w/o success
then i ran bochs under windows, but everytime i specify a floppy image to boot from (one that works perfectly with qemu), i get "couldnt load boot disk error"
bochs hates me
is there anything i can do to read these registers in qemu?
Posted: Fri Aug 10, 2007 5:13 pm
by Brynet-Inc
Use QEMU monitor, if in a Unix environment just invoke QEMU with the "-monitor stdio" flag..
Perhaps next time, you should try reading the documentation for something you're about to use.. makes sense right?
http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC12
As mentioned in the
QEMU Documentation, You can also view the monitor directly inside the SDL display window by using the key combo Ctrl-Alt-2 and then Ctrl-Alt-1 to return.
Posted: Sat Aug 11, 2007 2:22 am
by sancho1980
i know that document
i couldnt find anywhere in there that describes how to view the content of cpu registers (especially the hidden ones, as all the others can be printed out at runtime)
the only thing said about debugging is that you can use gdb in your host machine and somehow connect to your vm on qemu
i got it working once or twice but found it pretty complicated and not very useful so i ditched it
nevermind, for some strange reason the bochs god was nice to me yesterday and i was able to compile
*yeah
Posted: Sat Aug 11, 2007 8:12 am
by Brynet-Inc
Are you blind? read it!
"info registers" - show the cpu registers
I posted a direct link to the QEMU monitor FAQ, QEMU "does" have debugging features beyond the GDB backend..