Keyboard driver kills interrupts on bochs.

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.
Post Reply
Cody Mays

Keyboard driver kills interrupts on bochs.

Post by Cody Mays »

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.
User avatar
Pype.Clicker
Member
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.

Post by Pype.Clicker »

what about turning on "trace-one" feature of bochs and see where the code is blocking ?
Cody Mays

Re:Keyboard driver kills interrupts on bochs.

Post by Cody Mays »

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.
User avatar
Pype.Clicker
Member
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.

Post by Pype.Clicker »

Cody Mays wrote: That would take over 30 minutes to get to the part of my os where it dies.
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 ...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Keyboard driver kills interrupts on bochs.

Post by Candy »

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.
User avatar
Kevin McGuire
Member
Member
Posts: 843
Joined: Tue Nov 09, 2004 12:00 am
Location: United States
Contact:

Re:Keyboard driver kills interrupts on bochs.

Post by Kevin McGuire »

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.
Post Reply