CS Address of GDt

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Annie
Posts:14
Joined:Thu Feb 12, 2009 9:11 pm
CS Address of GDt

Post by Annie » Mon Mar 29, 2010 12:55 am

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

exor
Posts:13
Joined:Tue Mar 23, 2010 11:01 am

Re: CS Address of GDt

Post by exor » Mon Mar 29, 2010 9:01 pm

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

Post Reply