Problem with GDT pointer

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.
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Post by nekros »

billion_boi wrote:Since in the code i haven't used thr LGDT instruction, or called the function that sets up the descriptors.... rather just set the limit and base address in the pointer. Why or how is it that I'm running the GDT?
Advice: Please, RTFM, Practice your programming knowledge, and RTFM :!:

I really can't be much clearer than I,Jeremiah Griffin, and Combuster have been.

List of Things to do:
RTFM
RTFW
STFW
STFF

There are already a million examples of setting up the GDT. The GDT is one of the easier parts of OSDev, if you can't figure that out, you don't belong here.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
jzgriffin
Member
Member
Posts: 190
Joined: Tue Sep 26, 2006 1:40 pm
Libera.chat IRC: Nokurn
Location: Ontario, CA, USA
Contact:

Post by jzgriffin »

Go read up on Assembly, and memorize the Intel manuals. :-)
User avatar
Philip
Member
Member
Posts: 59
Joined: Thu Mar 06, 2008 11:37 pm
Location: Singapore

Re: Problem with GDT pointer

Post by Philip »

billion_boi wrote:hey,
Ive managed to compile my bootloader using NASM with no errors , but the code doesnt run beyond the GDTpointer that ive marked below...I can print a string befor the line...but not after...Any ideas as to why?

Its not like ive loaded the segment register that my string function uses with the descriptor offsett yet...

Code: Select all

GDT:

.Gdt_null:

	Dw 0

	Dw 0

	Dw 0

	Dw 0

.Gdt_code:

	Dw 1

	Dw 0

	Db 0

	Db 10011010

	Db 11011111

	Db 0

.Gdt_data:

	Dw 1

	Dw 0

	Db 0

	Db 10010010

	Db 11011111

	Db 0

.Gdt_end:

.Gdt_pointer:

	Dw .Gdt_end - .Gdt_code -1 ;****Error here

	Dd .Gdt_code
at the last line: why Dd .Gdt_code instead of Gdt_null?
because Gdt_null is the start point of the gdt
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:

Post by Combuster »

homework:
1) follow a series of assembly tutorials
2) write a DOS app in assembly that sets a video mode and draws a nice image.
"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 ]
Post Reply