In compatibility but not in 64-bit mode
Posted: Sat Jul 05, 2008 3:11 pm
Hello again.
After a lot of work I 've managed to enter long mode and I am now in compatibility code.
I think I 've defined an entry in the GDT for the 64-bit segment, but it seems that it is not interpreted as so.
1. Are there any differences between a 32-bit segment and a 64-bit segment in GDT apart from setting the D bit to 0?
2. Is the following code correct when jumping from compatibility mode (a 32-bit segment) do an 64-bit mode segment ?
db 0eah
dd LinearAddressOfStart64
dw code64_idx
3. When I want to go back to 32-bit compatibility segment, do I use:
db 0eah
dd AddressOfReturn32 (Not linear!)
dw code32_idx
4. Am I missing something ? It seems that my code64_idx is regarded as a simple 16-bit segment (D == 0) and therefore I cannot enter 64-bit mode, I am just moving around a 32-bit compatibility and a 16-bit compatibility segment.
Thanks a lot for any response.
Michael
After a lot of work I 've managed to enter long mode and I am now in compatibility code.
I think I 've defined an entry in the GDT for the 64-bit segment, but it seems that it is not interpreted as so.
1. Are there any differences between a 32-bit segment and a 64-bit segment in GDT apart from setting the D bit to 0?
2. Is the following code correct when jumping from compatibility mode (a 32-bit segment) do an 64-bit mode segment ?
db 0eah
dd LinearAddressOfStart64
dw code64_idx
3. When I want to go back to 32-bit compatibility segment, do I use:
db 0eah
dd AddressOfReturn32 (Not linear!)
dw code32_idx
4. Am I missing something ? It seems that my code64_idx is regarded as a simple 16-bit segment (D == 0) and therefore I cannot enter 64-bit mode, I am just moving around a 32-bit compatibility and a 16-bit compatibility segment.
Thanks a lot for any response.
Michael