Mail Archives: djgpp/1999/03/04/15:04:18
On Mon, 1 Mar 1999, Eli Zaretskii wrote:
>
> > The interrupts rate is so high (up to 20 kHZ), that I have to
> > install both real mode and protected mode handlers.
>
> Are you sure? Did you try to get away with a protected-mode handler
> alone? (See section 18.11 of the FAQ for some hints.) The dual RM/PM
> setup is a lot of work (see below), so you want to be sure you actually
> need it before you embark on that journey...
>
Well, I think I'll try to use just the protected mode handler.
However I still have a problem.
At the begining of my handler's code I have to set the DS register
(I'd like to avoid using the "go32" wrappers, because they used unlocked
memory), so I should start with something like this (in NASM):
[SECTION .text]
apps_cs resw 1
irq_handler push eax
mov ax,[cs:apps_cs]
mov ds,ax
However I don't know how to fill the "apps_cs" variable. It has to
be located in the code segment (because at the begining of the interrupt
CS is the only segment register with known contents), but I can not write
to the code segment :-(.
I can create an alias selector with write access but it is a "dirty"
solution.
Is there any documented variable located in code segment which holds the
DS for my application?
Looking into libc sources I have found "___djgpp_ds_alias",
"___djgpp_our_DS" and ___djgpp_app_DS", but none of them is documented...
Particularly the "___djgpp_app_DS" seems to be very promissing. Is it safe
to use it?
Thanks for any hints
Wojtek Zabolotny
wzab AT ise DOT pw DOT edu DOT pl
- Raw text -