On Apr 30, 9:55 am, leilei <spamt...@[EMAIL PROTECTED]
> 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.
I'm not sure if I should interpret "Now I can enter protected model
and mov GDT, IDT correctly" as a claim that implies that the following
is true:
1. MOV DS/ES/SS, non-NULL selector doesn't cause any exceptions
2. the exceptions are actually caught by the exception handlers
That's because of this statement: "when cpu run to the instuction 'mov
gs, cx', CPU will reset".
Most likely your GDT is incorrect and your exception handlers don't
work either (if they exist at all).
Finally, I have no idea what you mean by "But when I am about to mov
TSS". There's no MOV TSS instruction (only LTR). Did you mean you
relocated the TSS in memory from one place to another?
Alex


|