I decided my OS needed a complete gdt/idt/irq rewrite before I continued any farther into multitasking. So I stripped my kernel to the barebones and started from there. I then backported it to the main kernel.
In doing this, I had the code setup so I only changed one line of code for my PIT and keyboard drivers. After I had done this, I fired it up in bochs and all interrupts die. I could tell this because I had my interrupt handler print a ! to the screen every time an interrupt was fired. The PIT just stopped, and keyboard didn't work.
I then tried my image in qemu, vmware, and bare metal. All worked flawlessly. Can anyone help me get my driver going in bochs again? I really need to be able to use the debugger when the time comes.
The code, disk images, and instructions on compiling can be found here: http://www.codymays.net/content/2006/01 ... long-time/
Any help would be greatly appreciated.
Keyboard driver kills interrupts on bochs.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Keyboard driver kills interrupts on bochs.
what about turning on "trace-one" feature of bochs and see where the code is blocking ?
Re:Keyboard driver kills interrupts on bochs.
That would take over 30 minutes to get to the part of my os where it dies. :/ Someone on irc said it was due to the fact that bochs may be putting a few characters in the keyboard buffer and that just reading them fixed it for him. It fixed it for him, but not me and I'm really 100% clueless as what to do here.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Keyboard driver kills interrupts on bochs.
then place a breakpoint where it still works (e.g. in the interrupt handler) and trace-on from that breakpoint only. that's a pretty convenient approach i use often ...Cody Mays wrote: That would take over 30 minutes to get to the part of my os where it dies.
Re:Keyboard driver kills interrupts on bochs.
If it crashes in the interrupt handler, put a breakpoint there and turn tracing on there. If it crashes at an unknown location, start it up, turn on tracing and do whatever makes it crash.
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:Keyboard driver kills interrupts on bochs.
Put a:
__asm hlt
__asm nop
__asm nop
Right, before where it dies - or you think it dies.
Use bochsdbg.exe - Wait until you think execution
reaches the hlt. Then press CTRL + C. If you waited
long enough you will see the NOP opcode in the debugger
Hopefully. You can step right into the point where bochs tries the call the interrupt handler.
If not. Try putting a:
__asm int <keybd int>
And, force it to call the ISR.
__asm hlt
__asm nop
__asm nop
Right, before where it dies - or you think it dies.
Use bochsdbg.exe - Wait until you think execution
reaches the hlt. Then press CTRL + C. If you waited
long enough you will see the NOP opcode in the debugger
Hopefully. You can step right into the point where bochs tries the call the interrupt handler.
If not. Try putting a:
__asm int <keybd int>
And, force it to call the ISR.