Re: Strange Problem of my OS only with Bochs
Posted: Tue Jan 13, 2009 6:54 am
It's odd that this is only happening in Bochs. When an emulated environment behaves differently from a real one, the usual first thing you should look at is whether you have initialised all your variables correctly (don't assume that a newly declared variable contains zero).
I am (almost!) willing to bet that something (like an uninitialised variable) has trashed you stack or stack pointer. Your timer interrupt really shouldn't be doing very much - perhaps updating a tick counter and returning. Ensure that your IRQ handlers have symmetrical PUSH / POP counts (or you add to ESP as appropriate). Set up the keyboard IRQ - does that do the same?
To verify that it really is a corrupted stack, put JMP $ just before your IRQ IRET. If the system hangs at that point without falting, investigate every minute detail of your IRQ stack manipulation.
Cheers,
Adam
I am (almost!) willing to bet that something (like an uninitialised variable) has trashed you stack or stack pointer. Your timer interrupt really shouldn't be doing very much - perhaps updating a tick counter and returning. Ensure that your IRQ handlers have symmetrical PUSH / POP counts (or you add to ESP as appropriate). Set up the keyboard IRQ - does that do the same?
To verify that it really is a corrupted stack, put JMP $ just before your IRQ IRET. If the system hangs at that point without falting, investigate every minute detail of your IRQ stack manipulation.
Cheers,
Adam