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.
I've seen the light in switching to trap gates after reads from the console device failed miserably thanks to the read function being called via a syscall (interrupt gate) and hence blocking all other interrupts (including the keyboard).
This is what I've tried to do to get trap gates working:
I always enable interrupts before dispatching from my 'catch-all' exception handler to the code that will actually handle the exception. Then I disable them again when it finishes.
I've seen the light in switching to trap gates after reads from the console device failed miserably thanks to the read function being called via a syscall (interrupt gate) and hence blocking all other interrupts (including the keyboard).
normally i would make the syscall read not dependand on the keyboard read. I would have an interrupt service routine that will put the keyboard pressed in a keyboard buffer. And the read function uses that buffer for handling its state.