Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: About mov i...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 9 Topic 4639 of 4728
Post > Topic >>

Re: About mov instruction and gs register Options

by leilei <spamtrap@[EMAIL PROTECTED] > May 1, 2008 at 07:54 AM

On May 1, 8:43 am, Frank Kotler  <spamt...@[EMAIL PROTECTED]
> wrote:
> 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.
>
> Your system appears to have a different opinion. Better show us how you
> calculate "gdt_idx".
>
> I wouldn't "expect" the system to reboot until you try to *use* gs. Does
> it still reboot if you put "here: jmp here" right after "mov gs, cx"? I
> suppose you've tried that... Only thing I can think of...
>
> Best,
> Frank

Hi, I calculate the gdt_idx like this:


gdt_idx equ 1 * SIZEOF(DESC)    ;DESC is a struct of Segment
Descriptor.
....
mov cx, gdt_idx
mov gs, cx
;CPU can not even run to here after 'mov gs, cx', because it already
restarted.

I tried to change gs to es, but it still not work.

I even use a valide selector which executed successfully before to
replace gdt_idx, the CPU still reboot at this place.
 




 9 Posts in Topic:
About mov instruction and gs register Options
leilei <spamtrap@[EMA  2008-04-30 09:55:11 
Re: About mov instruction and gs register Options
Frank Kotler <spamtra  2008-05-01 00:43:59 
Re: About mov instruction and gs register Options
"Alexei A. Frounze&q  2008-04-30 20:04:51 
Re: About mov instruction and gs register Options
"Wolfgang Kern"  2008-05-01 10:05:03 
Re: About mov instruction and gs register Options
Gil Hamilton <spamtra  2008-05-01 15:17:08 
Re: About mov instruction and gs register Options
"Wolfgang Kern"  2008-05-01 22:27:21 
Re: About mov instruction and gs register Options
leilei <spamtrap@[EMA  2008-05-01 07:55:45 
Re: About mov instruction and gs register Options
"Wolfgang Kern"  2008-05-01 23:13:59 
Re: About mov instruction and gs register Options
leilei <spamtrap@[EMA  2008-05-01 07:54:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:40:33 CDT 2008.