Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Tolga
Post
by Tolga » Wed Jul 05, 2006 2:21 am
Hi. I don't know AT&T assembly. So, i will ask 2 question:
1. I have GDTR Structure;
struct tgdtr
{
unsigned short limit;
unsigned long base;
};
How can load this GDTR structure to GDTR with inline assembly?
2. I have IDTR Structure
struct tidtr
{
unsigned short limit;
unsigned long base;
};
How can load this IDTR structure to IDTR with inline assembly?
Thanks.
viral
Post
by viral » Wed Jul 05, 2006 2:56 am
Hello..
How can load this GDTR structure to GDTR with inline assembly?
Let GdtDesc is object of your "struct tgdtr"
Code: Select all
asm volatile ("lgdt %0" : "=m" (GdtDesc));
How can load this IDTR structure to IDTR with inline assembly?
Let IdtDesc is object of your "struct tidtr"
Code: Select all
asm volatile ("lidt (%%eax)" : : "a"(&IdtDesc));
Tolga
Post
by Tolga » Wed Jul 05, 2006 3:56 am
Thanks and where can i learn AT&T assembly for GCC? I want to learn it for only Kernel development in GCC.
viral
Post
by viral » Wed Jul 05, 2006 10:49 am
Hi...
You can find the tutorial about inline assembly in GCC at "tutorial" section of
www.osdever.net ..
All the best.....