Here's my problem. I have the following structure defined
struct idt_reg{
unsigned short limit;
unsigned int base;
}__attribute__((packed));
In my code I do the following assignment
unsigned short num_ids = idtr.limit >> 3;
Now upon execution, when the value stored in idtr.limit
is equal to 2047(0x7FF), what I expected to happen was a right shift of 3 bits (divide by 8) and get the value of 255 written to num_ids. Instead the value of num_ids
is always 0.
Any help I would really appreciate.