I'm trying to enable IDT, I'm followed a tutorial from osdever.net to implement it, the rest comes from the wiki's basic setup (can't remember the actual URL, so I included it in Source.zip attachment) written for C. So far as I can tell after reading up about the IDT it should work - at least the assembly (tested through the use of dividing by 0).
I've included the source for my "first" OS, which has basic text output, I'm not sure if it's an oversight or something else that I'm missing. If anyone would be willing to look at it to tell me what's wrong I'd appreciate it a lot, or link me to another tutorial for setting it up in C++ I'd appreciate it as well
Source.zip - includes both the source and the tutorial
[solved] C++ - Implementing interupts doesn't work
[solved] C++ - Implementing interupts doesn't work
Last edited by max9403 on Fri Apr 11, 2014 8:34 am, edited 1 time in total.
Re: C++ - Implementing interupts doesn't work
what you've done is essentially do a "here's my source code fix my game", albeit slightly more civilised and packaged in a zip file.
Try to debug the situation yourself first, then post only the relevant source files.
Try to debug the situation yourself first, then post only the relevant source files.
[nx] kernel: http://github.com/zhiayang/nx
Re: C++ - Implementing interupts doesn't work
That's the problem I don't know what is wrong, I've spend time looking for information on it, if you don't want to fix it send me to place where they have a tutorial on how it should be done. I posted all of it as I'm sure I making an oversight somewhere (as it compiles without error).
Edit: Apparently I fixed it somehow as it no longer straight out crashes in bochs when dividing by 0 it just spams a lot of LOCK prefix unallowed so I'm guessing the wrong thing is being called - before bochs would just straight out crash which let me to think that the exception handling wasn't working, sorry I jumped to the wrong conclusion
Edit2: Found the issue (Why allows do you find it when you post for help!):
anyway here was wrong:
changing that to just:
fixed it, now to figure out the keyboard XD
edit3: btw the reason I included the tutorial is because it doesn't compile for me with the source they give you "out the box" for me so maybe if someone had come across it before they could say that I shouldn't have even touched it or that just a couple of lines where wrong in the tutorial
Edit: Apparently I fixed it somehow as it no longer straight out crashes in bochs when dividing by 0 it just spams a lot of LOCK prefix unallowed so I'm guessing the wrong thing is being called - before bochs would just straight out crash which let me to think that the exception handling wasn't working, sorry I jumped to the wrong conclusion
Edit2: Found the issue (Why allows do you find it when you post for help!):
anyway here was wrong:
Code: Select all
mov %eax, %esp
push %eax
mov %eax, <function to handle exception>
call %eax
pop %eax
Code: Select all
call <function to handle exception>
edit3: btw the reason I included the tutorial is because it doesn't compile for me with the source they give you "out the box" for me so maybe if someone had come across it before they could say that I shouldn't have even touched it or that just a couple of lines where wrong in the tutorial