GDT advice

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
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

GDT advice

Post by System123 »

I have finally got my OS to boot without any triple faults. Now I was just wondering, does the GDT have to be set up before the Protected mode Jump? and would you recommend setting it up in assembler code or Pascal code??
Gizmic OS
Currently - Busy with FAT12 driver and VFS
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Re: GDT advice

Post by JackScott »

Even if it doesn't theoretically have to (not sure about this) it's definitely a good idea to have one set up. You can build the table in either assembly or Pascal, doesn't matter. But the LGDT instruction will have to be done in assembly, obviously.
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: GDT advice

Post by ru2aqare »

System123 wrote:I have finally got my OS to boot without any triple faults. Now I was just wondering, does the GDT have to be set up before the Protected mode Jump? and would you recommend setting it up in assembler code or Pascal code??
It has to be set up before you reload any of the segment registers in protected mode. If by "protected mode jump" you mean the usual "jmp 0x08:12345678" instruction, then yes, it has to be set up before that.
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: GDT advice

Post by System123 »

Thanks.. I have it set up an running now.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Post Reply