Page 1 of 1

CS Address of GDt

Posted: Mon Mar 29, 2010 12:55 am
by Annie
Hi,

I need help. In Tutorial 8, the section where we need to make a far jump to fix the CS address (making sure it contains the Code descriptor address)

Code: Select all

 	cli				; clear interrupts
	mov	eax, cr0		; set bit 0 in cr0--enter pmode
	or	eax, 1
	mov	cr0, eax

	jmp	08h:Stage3		; far jump to fix CS. Remember that the code selector is 0x8!
instead of a far jump, if we do this

Code: Select all

 		  mov ax, 08h
        mov cs, ax
        jmp Stage3
Would it be ok?

And is there any rule on choosing the starting address for the stack?

Thank guys

Re: CS Address of GDt

Posted: Mon Mar 29, 2010 9:01 pm
by exor
Annie wrote: instead of a far jump, if we do this

Code: Select all

 		  mov ax, 08h
        mov cs, ax
        jmp Stage3
Would it be ok?
you can't to set cs segment with mov instruction, it will triple fault.
Annie wrote: And is there any rule on choosing the starting address for the stack?
You can to choose every address, the only rule is that these addresses should be never overwritten