What do i put in gdt_start and idt_start?

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
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: What do i put in gdt_start and idt_start?

Post by Love4Boobies »

Although I don't think the answers you got were particularly reasonable (WHY ALL THE SHOUTING?), you'd get a lot more respect if you actually followed the advice people are giving you about the learning process. They're not just empty words, you know. You're not the first one to think he's clever, ignore them, and think the easy way out will work just fine if you just figure out a few more technical details---it's actually not right around the corner at all. And you won't be the last to think it either. So far, you're setting yourself up for failure in a big way but don't know enough to see it and the rest of the forum is watching it happen. It's up to you to change that.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: What do i put in gdt_start and idt_start?

Post by matt11235 »

NunoLava1998 wrote:Can't you just (and other OSDevers in the forum) treat me like a normal user? Can't i just get a nice answer?
Yes. You need to do a bit of research yourself though.
I don't think people mind helping you, but sometimes you need to help yourself.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: What do i put in gdt_start and idt_start?

Post by iansjack »

NunoLava1998 wrote:Can't you just (and other OSDevers in the forum) treat me like a normal user? Can't i just get a nice answer?
It's a two-way street; to be treated as a normal user first you have to act like a normal user. A normal user does not post over and over about every line of code they are trying to write. A normal user does not expect others to do all the work for them and to baby-sit them through the basics of processor operation. A normal user does a bit of research first. A normal user pays some heed to the advice they are given.

No-one can give you a nice answer to your question because no-one, you least of all, know what you are really asking. You have such a lack of understanding - and an inability, it seems, to learn - of what is involved that you really don't know what you are asking for.

Example - you are testing your IDT by doing an interrupt 0. And it fails; of course it does. You haven't defined an interrupt routine to handle this interrupt and you haven't made an entry in the IDT for it. So a triple fault is the only possible result (as you don't have handlers for GPF and PF exceptions either).

You are not ready for OS development yet; you need to understand better what it is that you are trying to do.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: What do i put in gdt_start and idt_start?

Post by Kevin »

NunoLava1998 wrote:
Kevin wrote:He is just copying code from http://wiki.osdev.org/LGDT without understanding it.

And as the comment there says, what you should put there is "Some GDT entries, like null, kernel code, kernel data, user code, user data, TSS..."
So? I don't know what those are. I implemented a big part of my IDT/GDT almost-complete loader, not copy pasting.
Besides, i wasn't copy pasting, i was actually chatting with some os devers for 3 hours trying to get IDT to work.
Okay, first of all: Forget about the IDT for now, get a working GDT first. Once that works, the IDT shouldn't be too hard because its structure is similar. The way to check whether your GDT is valid is to reload the segment registers.

The other thing is: How did you implement a "big part of my IDT/GDT" without knowing what GDT entries are? The GDT is literally just an array of GDT entries, so without entries you shouldn't have anything. Each GDT entry is a 64 bit integer, whose meaning is described in the wiki article.

Next step: Now you try and figure out how many entries you need in your GDT and which numbers to put there. Then tell us those numbers and we'll check them. Don't come back before you haven't made at least an attempt at them. The wiki describes everything you need, and checking the Intel manual can't hurt either.
Developer of tyndur - community OS of Lowlevel (German)
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: What do i put in gdt_start and idt_start?

Post by iansjack »

Kevin wrote:get a working GDT first. Once that works, the IDT shouldn't be too hard because its structure is similar.
I'm not so sure about that. I don't think that the OP realizes that he has to write interrupt routines for the interrupt descriptors to point to. In reality it seems pretty clear that he only understands interrupts as software interrupts (and even then doesn't seem to know that he needs a handler for the descriptor to point to). Exceptions and hardware interrupts are still unknowns; unfortunately they are not "things that we know that we don't know".
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: What do i put in gdt_start and idt_start?

Post by Kevin »

Well, possibly. Anyway, one problem at a time. And without a GDT, you can't get a working IDT, so GDT is first.
Developer of tyndur - community OS of Lowlevel (German)
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: What do i put in gdt_start and idt_start?

Post by NunoLava1998 »

Yeah, i really had no idea what i was doing.
I'm now loading the GDT/IDT properly.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: What do i put in gdt_start and idt_start?

Post by DixiumOS »

I just look at this thread and say "was I really that stupid so little ago?".
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What do i put in gdt_start and idt_start?

Post by dozniak »

DixiumOS wrote:I just look at this thread and say "was I really that stupid so little ago?".
And you still are! Imagine that.
Learn to read.
Post Reply