Mail Archives: djgpp/2000/04/02/11:12:40
On Mon, 27 Mar 2000, Jonathan Meunier wrote:
> void install_keyboard() {
> if(kb_installed == TRUE)
> return;
>
> new_kb_seginfo.pm_offset = (int)new_keyboard_int;
> new_kb_seginfo.pm_selector = _go32_my_cs();
>
> kb_installed = TRUE;
>
> _go32_dpmi_get_protected_mode_interrupt_vector(0x09, &old_kb_seginfo);
> _go32_dpmi_allocate_iret_wrapper(&new_kb_seginfo);
> _go32_dpmi_set_protected_mode_interrupt_vector(0x09, &new_kb_seginfo);
> }
Beware: this code doesn't lock the code and data used inside the
interrupt handler. So it will most probably crash, especially on
memory-starved systems.
I suggest to read section 18.9 of the FAQ for more details.
- Raw text -