Hi Tony,

> If I remember correctly, the mouse comes in on Int 15h (if PS/2)

No int15 is the BIOS based driver... The data comes in via an IRQ
handler. Some mouse drivers use int15, others use their own IRQ
handler... To reduce the number of context switches, you can make
your own IRQ handler which runs in protected mode. Neither int15
nor a DOS mouse driver will be in use then. Apart from calling
int15 a few times to send configuration data to the mouse, maybe.

> Calling a real mode mouse driver in protected mode
> is going to eat CPU time just on the context switch

It depends on how often you call it... Remember that mouse
drivers also allow callbacks: Then the real mode mouse
driver calls YOU when a mouse event happens, so you do not
have to call IT for polling :-).

You also get context switches to the driver when a mouse
hardware event happens, because the driver is running in
real mode / v86 mode.

> , and if you're polling for position, that's a lot
> of switching going on to update a cursor.

This can be solved by using callbacks - or polling less frequently.

> I think it definitely makes more
> sense to roll your own protected mode version of the driver
> to minimize the context switches.

I would not recommend that unless your software is very time-
critical and/or you only want to support one type of mouse.
Luckily most PS2 mice "talk the same language", which is quite
simple in non-wheel mode. On the other hand, programming the
keyboard/ps2/mouse controller is tedious.

Another relevant point is that modern BIOSes also support USB
mice via int15, some even so well that they forward the data
to the ps2 controller. This can be really slow and it will be
really complicated to write your own direct USB access driver
if you want to avoid context switches. You better use real PS2.

Eric



-------------------------------------------------------------------------
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

Reply via email to