Setting GDT Base and Limit [split]

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
RajivKumarSrivastav
Member
Member
Posts: 26
Joined: Wed Sep 28, 2011 6:46 am
Location: Bangalore - India

Setting GDT Base and Limit [split]

Post 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)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Setting GDT Base and Limit [split]

Post by Combuster »

segment end != segment size
up to end != including end
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
RajivKumarSrivastav
Member
Member
Posts: 26
Joined: Wed Sep 28, 2011 6:46 am
Location: Bangalore - India

Re: Setting GDT Base and Limit [split]

Post 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
Post Reply