Page 1 of 1
IDT example
Posted: Thu Jan 30, 2014 5:16 pm
by ezequielpereira
I'm trying to do a IDT and use interrupts but I can't get it to work.
Please, Can anyone give me an example of a bootloader that starts, install the IDT and call an interrupt?
Re: IDT example
Posted: Thu Jan 30, 2014 6:13 pm
by FallenAvatar
Re: IDT example
Posted: Thu Jan 30, 2014 6:55 pm
by JAAman
I don't see how that link is relevant to the question (doesn't even mention IDT at all)
the wiki should have everything you need, you need to be able to learn from documentation for OSdev with little or no example code, it is a skill, which you will gain from experience, but it is absolutely necessary to progress in this
try to use what you are learning, read carefully, research what you don't know/understand, and try to implement
ask if you have specific questions -- if you didn't understand enough to know exactly what to ask, you probably aren't ready to ask any questions yet, and should study more first (its ok to ask for more resources, as long as you mention where you have already looked, and that should include relevant pages in our wiki, and the Intel manuals), if you have trouble implementing it, ask about your problem specifically -- most of the people here don't like (and won't) answering vague or very general questions, the more specific your question the more likely you are to get a good answer (and we generally prefer to give pointers or information rather than a lot of code)
as for the IDT in boot code... the IDT is the very last part of a simple bootloader, so if anyone gave you an example of boot code that booted and loaded an IDT and executed an INT then you would basically have a full working bootloader
if you are trying to create your own bootloader: don't worry about the IDT just yet, since you generally don't need to worry about it until you are in PMode and have a working GDT -- doing that first will probably help you understand the parts you are struggling with (and if you can make yourself a GDT and still don't understand the IDT something is very wrong) -- start at the beginning loading more from disk, then setup GDT and enter PMode, don't worry about the IDT until then
if you are using GRUB: learn about the GDT first, as it should be installed first anyway (you should not rely on the one GRUB uses), and if you understand the GDT sufficiently, and can't understand the IDT, something is very wrong
Re: IDT example
Posted: Tue Feb 04, 2014 6:50 am
by Bender
EDIT: Spoon feeding is bad
-Bender
Re: IDT example
Posted: Tue Feb 04, 2014 6:55 am
by Love4Boobies
Something tells me this is rafaelcor with a new username. If I were an admin and this checked out during the login IP verification, I would ban both accounts.
Re: IDT example
Posted: Tue Feb 04, 2014 7:15 am
by ezequielpereira
Love4Boobies wrote:Something tells me this is rafaelcor with a new username. If I were an admin and this checked out during the login IP verification, I would ban both accounts.
RafaelCor is my friend, we are working in a simple OS to learn about them.
P.S.: Is bad to accuse in public without proof.
The next time send me a private message before.
Re: IDT example
Posted: Tue Feb 04, 2014 8:40 am
by Bender
RafaelCor is my friend, we are working in a simple OS to learn about them.
Love4Boobies obviously didn't know that, since both you are working on one project, you may have similar goals which can lead anyone into confusion. Did my previous reply solve your problem?
Re: IDT example
Posted: Tue Feb 04, 2014 8:49 am
by ezequielpereira
Yes, your reply helped us, now we are looking for the Keyboard and IRQ's.
Thanks for all of you
.
Re: IDT example
Posted: Tue Feb 04, 2014 9:04 am
by Bender
As a side note I would suggest you to look at the exceptions page,
While building the first 32 entries, you would need to create handlers
for CPU Exceptions. For example the divide by zero exception has 1 as the interrupt vector, so you will need to have the divide by zero handler as the first entry in your IDT. Also, you will need an unhandled interrupt handler as you would not be using all the 256 entries.
As for the exceptions page:
http://wiki.osdev.org/Exceptions
Re: IDT example
Posted: Tue Feb 04, 2014 9:09 am
by VolTeK
Since we're posting informational responses, i'll chime in.
ezequielpereira wrote:RafaelCor is my friend, we are working in a simple OS to learn about them.
That's what they all say, but this forum is fair. You will be guilty, when concretely proven guilty. For as far as you know, you have nothing to worry about unless you're a liar.
Bender wrote:Hi,
Even you should know spoon feeding is a bad habit. That technique won't weed out those who eventually stop trying because they find they "Must" read to continue. If you can use a link to the wiki, it would be ideal to save yourself time and let the experienced programmer read the well documented topic in the wiki. Chances are, what is said here, will be in the link.
ezequielpereira wrote:Yes, your reply helped us
Next time read the wiki, self teaching at this point is key to your projects future. Response number two was perfect, response number three was the best.
Re: IDT example
Posted: Tue Feb 04, 2014 9:29 am
by Love4Boobies
It did occur to me but asking the same simple questions (suggesting no desire whatsoever to do even basic research because this information is simply all over the place) in multiple threads is just a really bad sign on their part.
Re: IDT example
Posted: Tue Feb 04, 2014 9:59 am
by iansjack
Even you should know spoon feeding is a bad habit
I couldn't agree more. Apart from being a poor way of helping the person asking the question (unless you are prepared to hand-hold all the way through their development - even when they get to the hard parts) it ruins the forums. Noise in the system with people repeatedly answering the most basic questions in a verbose way makes the forum less useful for its real purpose. The only advantage is that it lets the spoon-feeder show how clever (or otherwise) they are.
So, good for the ego (possibly) but bad for in every other respect.