Page 1 of 1

Setting GDT Base and Limit [split]

Posted: Wed Jun 13, 2012 4:33 am
by RajivKumarSrivastav
I am also facing the issue with GDT setting for CODE & DATA limit and base. I do not want Paging. I need code and data segment to be in range of 24k to 80k only.
Can any one please help and let me know why the below GDT setting does not work?

Code: Select all

// DATA Segment ranges from 0x6000(24K) to 0x14000(80K)
0x00419B0060004000; // CODE Segment ranges from 0x6000(24K) to 0x14000(80K)
0x0041930060004000; // DATA Segment ranges from 0x6000(24K) to 0x14000(80K)

Re: Setting GDT Base and Limit [split]

Posted: Wed Jun 13, 2012 9:21 am
by Combuster
segment end != segment size
up to end != including end

Re: Setting GDT Base and Limit [split]

Posted: Fri Jun 22, 2012 6:13 am
by RajivKumarSrivastav
Thanks for the reply. I found the solution.
I have Bootrom and Kernel as separate BINARY. And GDT setup was done for both, Which was causing little problem.

Actually i had built the BINARY with .text segment to start with 0x6000. When i built with 0x0, then it works.
The reason is for FAR JUMP, SS:OFFSET should result in a valid IP which we want to execute. So,
1- if i already build BIN with .text segment at 0x6000, then GDT base should be 0x0.
2- If i already build BIN with .text segment at 0x0, then GDT base can be 0x6000.

Similar info on below link:
http://forum.osdev.org/viewtopic.php?f=1&t=25465