Re: About mov instruction and gs register



leilei wrote:
I am writting a program for target board which have a 486 cpu, 512K
ram(0x0 to 0x7ffff), 512k flash (0x80000 to 0xFFFFF).My program will
be burned into flash.
My program is to initialize the GDT, IDT, TSS, move them to memory.
Now I can enter protected model and mov GDT, IDT correctly.But when I
am about to mov TSS, some exception came out, and the CPU reset
automaticly. The code casue the problem is like this:
mov cx, gdt_idx
mov gs, cx
when cpu run to the instuction 'mov gs, cx', CPU will reset.
i can assure the value in cx is correctly.

can any one give me some tips about how can this be happend?


This seems to have nothing to do with TSS, yet.
The CPU is not happy with the selector attempted
to load GS with.

Please check that the number in CX is a valid GDT
selector within the table range.

It also seems that there is no handler available
for the exception generated by the segment loading.

--

Tauno Voipio
tauno voipio (at) iki fi
.



Relevant Pages

  • About mov instruction and gs register
    ... I am writting a program for target board which have a 486 cpu, ... My program is to initialize the GDT, IDT, TSS, move them to memory. ... Now I can enter protected model and mov GDT, IDT correctly.But when I ...
    (comp.arch.embedded)
  • About mov instruction and gs register Options
    ... I am writting a program for target board which have a 486 cpu, ... My program is to initialize the GDT, IDT, TSS, move them to memory. ... Now I can enter protected model and mov GDT, IDT correctly.But when I ...
    (comp.lang.asm.x86)
  • Re: About mov instruction and gs register Options
    ... My program is to initialize the GDT, IDT, TSS, move them to memory. ... Now I can enter protected model and mov GDT, ... when cpu run to the instuction 'mov gs, cx', CPU will reset. ...
    (comp.lang.asm.x86)
  • Re: About mov instruction and gs register Options
    ... My program is to initialize the GDT, IDT, TSS, move them to memory. ... Now I can enter protected model and mov GDT, IDT correctly.But when I ...
    (comp.lang.asm.x86)
  • i386 spinlock fairness: bizarre test results
    ... When using the 'mov' instruction to do the unlock I was able to reproduce ... hogging of the spinlock by a single CPU even on Pentium II under some ... while using 'xchg' always allowed the other CPU to get the ... parent CPU 1, child CPU 0, using xchg instruction for unlock ...
    (Linux-Kernel)