I really don't know why LTR gives me #GP.
Here's the code:
Code: Select all
mov ax, (5 * 8) | 3
ltr ax
Here's my TSS:
Code: Select all
tss = {
limit_low = 0x1000, base_low = 0x5000, base_middle = 0x11,
access = 0xe9, granularity = 0x0, base_high = 0x0}
accessed: 1
read_write: 0
conforming_expand_down: 0
code: 1
code_data_segment: 0
DPL: 3 = 11
present: 1
Here you have my whole GDT:
Code: Select all
{null = {limit_low = 0xffff, base_low = 0x0, base_middle = 0x0,
access = 0x0, granularity = 0x1, base_high = 0x0}, code0 = {
limit_low = 0x0, base_low = 0x0, base_middle = 0x0, access = 0x9a,
granularity = 0xaf, base_high = 0x0}, data0 = {limit_low = 0x0,
base_low = 0x0, base_middle = 0x0, access = 0x93, granularity = 0x8f,
base_high = 0x0}, code3 = {limit_low = 0x0, base_low = 0x0,
base_middle = 0x0, access = 0xfa, granularity = 0xaf, base_high = 0x0},
data3 = {limit_low = 0x0, base_low = 0x0, base_middle = 0x0,
access = 0xf2, granularity = 0x8f, base_high = 0x0}, tss = {
limit_low = 0x1000, base_low = 0x5000, base_middle = 0x11,
access = 0xe9, granularity = 0x0, base_high = 0x0}, pointer = {
limit = 0x2f, base = 0x100100130}}