IDT example

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
ezequielpereira
Posts: 3
Joined: Thu Jan 30, 2014 5:09 pm

IDT example

Post 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?
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: IDT example

Post by FallenAvatar »

User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: IDT example

Post 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
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: IDT example

Post by Bender »

EDIT: Spoon feeding is bad
-Bender
Last edited by Bender on Wed Feb 05, 2014 2:55 am, edited 1 time in total.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: IDT example

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
ezequielpereira
Posts: 3
Joined: Thu Jan 30, 2014 5:09 pm

Re: IDT example

Post 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.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: IDT example

Post 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?
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
ezequielpereira
Posts: 3
Joined: Thu Jan 30, 2014 5:09 pm

Re: IDT example

Post by ezequielpereira »

Yes, your reply helped us, now we are looking for the Keyboard and IRQ's.
Thanks for all of you :) .
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: IDT example

Post 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
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: IDT example

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

Re: IDT example

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: IDT example

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