Mail Archives: djgpp/2000/03/27/23:44:05
Simply look at mine:
----------------8<------------------
extern  ___djgpp_ds_alias
extern  _irq1_isr
GLOBAL  _IRQ1_ISR
[section .data]
o_ESP           dd      0
o_SS            dw      0
[section .bss]
stack_area      resb    4096
stack_top:
[section .text]
[bits 32]
_IRQ1_ISR:
        cli
        push    ds
        push    es
        push    fs
        push    gs
        pushad
        mov     ax, [cs:___djgpp_ds_alias]
        mov     ds, ax
        mov     es, ax
        mov     fs, ax
        mov     gs, ax
        mov     [o_ESP], esp
        mov     word [o_SS], ss
        mov     ss, ax
        mov     esp, stack_top
        cld
        call    _irq1_isr
        cli
        mov     ss, word [o_SS]
        mov     esp, [o_ESP]
        popad
        pop     gs
        pop     fs
        pop     es
        pop     ds
        iretd
----------------8<------------------
It saves all the registers, sets up segment registers, sets up own
stack, calls C handler, restores everything back.
CLI and CLD is put for more reliability.
Alexei A. Frounze
--
Homepage: http://alexfru.chat.ru
Mirror:   http://members.xoom.com/alexfru
Jonathan Meunier wrote:
> 
> Actually, you can (look my other post), but DJGPP doesn't allow
> reentrant interrupts.. Which means that you can either take over the
> interrupt, or just run code before the interrupt (after your code is
> done it automatically calls the BIOS one). It doesn't really matter for
> keyboard handler, unless you want to use stdio function (eg: getch())..
> Though, for timer interrupts, it's trivial to call the BIOS handler 18.2
> times per second.
> 
> My question is, where can I find information on those wrappers? Like,
> what they do, and what to put in them? As you can see from the other
> post, I use a _go32 function to make the wrapper for me, but in the case
> of timer interrupts, I read somewhere that I would need to make my own
> wrapper..
- Raw text -