Re: [Freedos-devel] Calling a software interrupt from hardware interrupt

2007-06-14 Thread Arkady V.Belousov
Hi!

13-Июн-2007 14:34 [EMAIL PROTECTED] (Ladislav Lacina) wrote to
:

LL> Is possible to call a software interrupt from hardware
LL> interrupt?

 Possible - but you should avoid this as much, as possible. Because
hardware interrupts are asynchronous and calling services, which was already
called and not finished, may mess anything. For example, almost all DOS
functions are not reentrant.

LL> I want to call INT33h/AX=3 from INT 1Ch handler.

 This should be safe. Especially, with CTMOUSE - I pay much attention to
make CTMOUSE safe in sense of reentrancy.

LL> And this all works in
LL> protected mode.
LL> I tried to call INT33h through DPMI service 31h but it crashed. Is it
LL> possible at all?

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] Calling a software interrupt from hardware interrupt

2007-06-13 Thread Bart Oldeman
On 6/13/07, Ladislav Lacina <[EMAIL PROTECTED]> wrote:
> Thank you, I'll try these possibilities. Support for 4th and 5th mouse
> button might be useful for someone but I don't have such mouse and don't
> remember if I have ever seen it .
> But very interresting would be some mouse protect mode interface. Something
> similar like VESA VBE protect mode interface is. Because moving mouse eats
> much CPU power in protected mode.

Did you try to register a mouse interrupt subroutine (int33/ax=c in
combination with int31/ax=303)?

The 4th and 5th button often refer to scroll-up and scroll-down of the
mouse wheel.

Bart

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] Calling a software interrupt from hardware interrupt

2007-06-13 Thread Ladislav Lacina
Thank you, I'll try these possibilities. Support for 4th and 5th mouse
button might be useful for someone but I don't have such mouse and don't
remember if I have ever seen it .
But very interresting would be some mouse protect mode interface. Something
similar like VESA VBE protect mode interface is. Because moving mouse eats
much CPU power in protected mode.


- Original Message -
From: "Eric Auer" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, June 13, 2007 2:39 PM
Subject: Re: [Freedos-devel] Calling a software interrupt from hardware
interrupt


>
> Hi Ladislav,
>
> > Is possible to call a software interrupt from hardware interrupt? I
> > want to call INT33h/AX=3 from INT 1Ch handler. And this all works in
> > protected mode. I tried to call INT33h through DPMI service 31h but
> > it crashed. Is it possible at all?
>
> Yes, sure, but you must avoid calling int33 while int33 is already
> active. The usual way to do this is:
>
> - write an own int33 handler which just calls the original int33
>   handler but which increments a counter before calling the
>   old int33 and decrements it when the old int33 returns. Make
>   sure not to mess with the flags returned by the old int33.
>
> - write a test in your int1c handler which makes it avoid the
>   int33 call if the counter is found to be nonzero
>
> - you could also write a test in your int33 handler to do the same,
>   but it is more polite to make only your int1c handler wait and
>   not all int33 users
>
> - the int1c handler should not really WAIT until int33 is ready.
>   instead, it should skip over the whole mouse stuff when int33
>   is busy... there will always be a next int1c clock tick :-)
>
> Of course things might get more complicated because you use
> protected mode (do you need it?), but the idea stays the same.
>
> Eric
>
> PS: Would you be interested in support for 4th and 5th PS2 mouse
> buttons for your mouse handler? :-)
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] Calling a software interrupt from hardware interrupt

2007-06-13 Thread Eric Auer

Hi Ladislav,

> Is possible to call a software interrupt from hardware interrupt? I
> want to call INT33h/AX=3 from INT 1Ch handler. And this all works in
> protected mode. I tried to call INT33h through DPMI service 31h but
> it crashed. Is it possible at all?

Yes, sure, but you must avoid calling int33 while int33 is already
active. The usual way to do this is:

- write an own int33 handler which just calls the original int33
  handler but which increments a counter before calling the
  old int33 and decrements it when the old int33 returns. Make
  sure not to mess with the flags returned by the old int33.

- write a test in your int1c handler which makes it avoid the
  int33 call if the counter is found to be nonzero

- you could also write a test in your int33 handler to do the same,
  but it is more polite to make only your int1c handler wait and
  not all int33 users

- the int1c handler should not really WAIT until int33 is ready.
  instead, it should skip over the whole mouse stuff when int33
  is busy... there will always be a next int1c clock tick :-)

Of course things might get more complicated because you use
protected mode (do you need it?), but the idea stays the same.

Eric

PS: Would you be interested in support for 4th and 5th PS2 mouse
buttons for your mouse handler? :-)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


[Freedos-devel] Calling a software interrupt from hardware interrupt

2007-06-13 Thread Ladislav Lacina
Is possible to call a software interrupt from hardware interrupt?
I want to call INT33h/AX=3 from INT 1Ch handler. And this all works in 
protected mode.
I tried to call INT33h through DPMI service 31h but it crashed. Is it possible 
at all?

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel