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.
You probably need to provide more code. This code seems all correct (or rather logically correct). Go for Bochs and find out the exact reason why your os is crashing. There might be several reasons.
GhostSniper wrote:Works fine now. I just added more code like you suggested :p
I meant you should provide us more code to look at. If you just add more code for no reason, you are just covering a nasty bug temporarily that *will* surface later.
Have you actually set up a gdt/idt/isrs/irqs?
Because from the last few topics you've started you have been asking very basic questions.
Try this tutorial first: http://www.jamesmolloy.co.uk/tutorial_html/index.html
Come back after you've finished with it.
And if you have any questions read the wiki, try google, or whatever. But use this forum as a last resort.
BTW Ignore this post if you have a have gotten as far as the irqs.
What makes you think it's the for loop that causes the crash? It's more likely something wrong with your clear_screen or WriteText functions... and I have to assume that since your naming conventions for each function are different, that there's copy & pasting going on...
-m32 wrote:What makes you think it's the for loop that causes the crash? It's more likely something wrong with your clear_screen or WriteText functions... and I have to assume that since your naming conventions for each function are different, that there's copy & pasting going on...
I believe you are probably correct. I just hope he isn't cotton509 all over again...
Then again, this guy knows (supposedly) how to use a compiler.
I'm getting a little tired of these noobs that come in here, think they can do OS development, copy and paste some code, then complain to us that it doesn't work when they probably don't even know what it does.
OP: You should be checking port 0x64 to see if there's a scancode in the buffer. I've never heard of the lack of that causing a fault, but it's possible.
pinged wrote:I just hope he isn't cotton509 all over again...
The cotton legacy lives on... *wonders how someone that joined 5 months after the cotton fiasco knows about him*
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Troy Martin wrote:The cotton legacy lives on... *wonders how someone that joined 5 months after the cotton fiasco knows about him*
Haha, I know all about the cotton fiasco!
To the original poster: QEMU is nice, but for debugging purposes you should probably try Bochs. Run your original code with Bochs and see what happens. It will leave behind a log (whether it crashes or not) which you can inspect for any error conditions.