seting Local descriptor
I am new to kernel programming. I am set out to remove the protection domain between the kernel and the user applications. For this I want to set privilege level of each descriptor to 0.
I am looking into the kernel code for finding where should I make changes. I came across some cryptic code for seting local descriptor table:
I have done assembly code previously, but am not able to understand following code. What does %%ax mean, what does rorl instruction do?
What does 2(%2) as an operand stand for? Is there any tutorial which explains this?
#define _set_tssldt_desc(n,addr,limit,type) \
__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
"movw %%ax,2(%2)\n\t" \
"rorl $16,%%eax\n\t" \
"movb %%al,4(%2)\n\t" \
"movb %4,5(%2)\n\t" \
"movb $0,6(%2)\n\t" \
"movb %%ah,7(%2)\n\t" \
"rorl $16,%%eax" \
: "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type))
Any help in this direction will be appreciated.
About my main task, I am removing protection domain, so that we can have system calls as light as procedure calls. Doing this as a class project. Is there any other better way in which I can achieve the solution?
Thanks in advance,