"Wolfgang Kern" <spamtrap@[EMAIL PROTECTED]
> wrote in news:fvc02f$9s$1
@[EMAIL PROTECTED]
> "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.
>
> A MOV GS, with whatsoever value wont raise an exception except
> if the CPU don't got a GS (EXCeption06 on x286 and previous).
> 512 KB RAM ? mmh, are you sure you have a 486 CPU ?
Not sure where you got this. According to the Intel programming manual:
If the destination operand is a segment register (DS, ES, FS,
GS, or SS), the source operand must be a valid segment selector.
In protected mode, moving a segment selector into a segment
register automatically causes the segment descriptor information
associated with that segment selector to be loaded into the
hidden (shadow) part of the segment register. While loading this
information, the segment selector and segment descriptor
information is validated (see the "Operation" algorithm below).
The segment descriptor data is obtained from the GDT or LDT
entry for the specified segment selector.
GH


|