flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > OS Construction > GDTR and GDT

Author
Thread Post new topic Reply to topic
system error



Joined: 01 Sep 2013
Posts: 673
GDTR and GDT
I don't know where to ask this question. This has nothing to do with OS construction btw. Just out of curiosity.

I was told that GDTR is 10 bytes for 64-bit CPU and 6 bytes for 32-bit. I got some informative returns when I used it from 64-bit, but zeros from 32-bit. Any particular reason why? I tested this on Win64.


Code:
mov rax,gdt_val
sgdt [rax]

gdt_val rb 16

ReturnsBASE=0xFFFFxxxxxxxxxxxxLIMIT=87



But the same 32-bit setting returns nothing.


Code:
mov eax,gdt_val
sgdt [eax]

gdt_val rb 8

ReturnsBASE=0LIMIT=0



Did I miss something?
Post 26 Jul 2017, 18:40
View user's profile Send private message Reply with quote
Azagaros



Joined: 18 Jan 2013
Posts: 14
The 64 bit version does not hardware task switching so the four bytes of the TSS of the GDT entry is consumed to accommodate the 64 bit address. OSdev wiki pages have a pretty good difference in the 32 bit models and the 64 bit models.
Post 02 Aug 2017, 22:37
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.