Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

software interrupt

Status
Not open for further replies.

nicovda

IS-IT--Management
Oct 4, 2004
19
0
0
BE
does anyone know why int 16h is impossible to execute in protected mode. It crashes the system , and the line says "EXCEPTION_KERNEL_MODE_TRAP.

If it's possible to make it work, please reply.

Thanks a lot.

Nico.
 
Hi nico,

do you mean bios int 16h?

regards,

Rick
 
yes!

do you know a way to execute this int? I am already in Ring0.

Nico.
 
Hi again,

Sorry, i know you can not use that interrupt directly once the Nt kernel is running, but i don´t know what can you use. I promise i will research further.
did you try scanning i/o ports for 8042 keyboard controller?

regards,

Rick


 
Yes, once I enter in Kernel Mode, I can easily mask IRQ1 on the PIC and do what ever I want directly whith IO ports 60 and 64 of the 8042 controller. Only problem, I have to, after that, send the carachters to the OS. Three possibilities :

- trigger int 9 : not allowed
- trigger int 16 : not allowed
- write all this in my own interrupt handler (which calls in the end the usual int 9) and modifying the IDT : no problem whith this, but my int9 is never called, while the offset of 9th entry in the IDT is effectively changed.

This leaves me quite puzzled, again.

Thanks for your help rwong.

Nico.
 
I found a way to bypass the problem, I use function 02Dh to send to IO port 64h, and this way I write anything I want in output of the 8042.

Actually, my program polls for data in output of the keyboard (not the best way, that's sure).

Only problem, I use this to mask IRQ1

in al, 21h
or al, 00000010b
out 21h, al

but after this, IRQ's still happen, I don't understand why.

Any ideas?
 
sorry i don´t get it. Can you rephrase your question?

btw that seems IRQ2...

Rick
 
i was wrong... it is irq1 sorry again

Rick
 
the port 21h is the port to the mask register of the master PIC. My routine is supposed to poll for characters, while IRQ disabled, change them, and send the changed scan code to the OS.

The problem is that if I type too quickly, it seems the processor can't follow. When this happens, some characters are not taken into account by my program, and the real characters typed are shown on the monitor. This means that IRQ1 has to be triggered. This shouldn't be the case, since I mask it whith the above code.

Thanks for your help Rick.

Nico.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top