IDT example
-
- Posts: 3
- Joined: Thu Jan 30, 2014 5:09 pm
IDT example
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?
Please, Can anyone give me an example of a bootloader that starts, install the IDT and call an interrupt?
-
- Member
- Posts: 283
- Joined: Mon Jan 03, 2011 6:58 pm
Re: IDT example
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
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
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: IDT example
EDIT: Spoon feeding is bad
-Bender
-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)
(R3X Runtime VM)(CHIP8 Interpreter OS)
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: IDT example
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 ]
[ Project UDI ]
-
- Posts: 3
- Joined: Thu Jan 30, 2014 5:09 pm
Re: IDT example
RafaelCor is my friend, we are working in a simple OS to learn about them.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.
P.S.: Is bad to accuse in public without proof.
The next time send me a private message before.
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: IDT example
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?RafaelCor is my friend, we are working in a simple OS to learn about them.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
(R3X Runtime VM)(CHIP8 Interpreter OS)
-
- Posts: 3
- Joined: Thu Jan 30, 2014 5:09 pm
Re: IDT example
Yes, your reply helped us, now we are looking for the Keyboard and IRQ's.
Thanks for all of you .
Thanks for all of you .
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: IDT example
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
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)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: IDT example
Since we're posting informational responses, i'll chime in.
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.ezequielpereira wrote:RafaelCor is my friend, we are working in a simple OS to learn about them.
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.Bender wrote:Hi,
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.ezequielpereira wrote:Yes, your reply helped us
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: IDT example
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 ]
[ Project UDI ]
Re: IDT example
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.Even you should know spoon feeding is a bad habit
So, good for the ego (possibly) but bad for in every other respect.