Board index » delphi » Redirect app text output

Redirect app text output

averk...@cc.Helsinki.FI (Anatoly M Verkhovski) wrote:

Quote
>I want to control application's text output, normally printing to screen
>is done by writing to memory in seg $B800, i want to be able to trap when
>ever application is ouputing something, and copy all output to the
>location where i wnat it.  Obviously the program that will do this will
>have to be resident, but how do i actually trap the event of writing to
>screen?  

You can trap all output to the screen when you make your applications use the BIOS to put
their text on the screen. What you need to do is redirect the BIOS interrupt (10h) which
outputs the characters to the screen. Alternatively, you can set up your own text device in
Borland Pascal and make all the Write and WriteLn statements write to this text device. All
text will then end up going through your device and then your in control. If the applications
you talk about are not under your control (i.e. you can change them) then I don't know how to
solve your problem.

Ciao,
s795...@dutiwy.twi.tudelft.nl

 

Re:Redirect app text output


Anatoly M Verkhovski (averk...@cc.Helsinki.FI) wrote:

Quote
> I want to control application's text output, normally printing to screen
> is done by writing to memory in seg $B800, i want to be able to trap when
> ever application is ouputing something, and copy all output to the
> location where i wnat it.  Obviously the program that will do this will
> have to be resident, but how do i actually trap the event of writing to
> screen?  

I believe that it is impossible to trap a writing to a specific memory
location (OK, at least at seg $B800 in real mode).

Check whether the program whose output you try to control has options to
display its output using standard method (standard dos device, or BIOS, or
int 29h).  If it is the case, then you can control the output by trapping
the concerned interrupt.

--
-Eddy

Re:Redirect app text output


I want to control application's text output, normally printing to screen
is done by writing to memory in seg $B800, i want to be able to trap when
ever application is ouputing something, and copy all output to the
location where i wnat it.  Obviously the program that will do this will
have to be resident, but how do i actually trap the event of writing to
screen?  

--
 -------------------------------------------------------------------------
|            Let there be justice for all guilty and innocent             |
 -------------------------------------------------------------------------
                                        Anatoly M. Verkhovsky
                                        averk...@kruuna.helsinki.fi
                                        http://www.helsinki.fi/~averkhov

Re:Redirect app text output


On 8 Dec 1995, Anatoly M Verkhovski wrote:

Quote
> I want to control application's text output, normally printing to screen
> is done by writing to memory in seg $B800, i want to be able to trap when
> ever application is ouputing something, and copy all output to the
> location where i wnat it.  Obviously the program that will do this will
> have to be resident, but how do i actually trap the event of writing to
> screen?  

If you need to trap, you should intercept the BIOS interrupt 10h.  If the
program writes directly to the screen, you have two choices: have a TSR
that runs off of the clock tick, and every few seconds saves any changes
to the screen by reading the screen and comparing it to the old one (good
luck).  The other possibility would be to write a protected mode kernel
that spawned the system into V86 mode, then trapped all memory
read/writes to B800h (assuming >=386).  This would be the perfect
solution.  Also the one that requires a few weeks and is really pointless.

Re:Redirect app text output


OK, so generally there are 4 ways to write to screen:

1. Dos (i supose 21h function 02h or smth)
2. Bios (10h)
3. 29h (what the heck is that? and what uses it?)
4. Direct video memory access.

Out of these it's only reasonable to trap 1 and 2 maybe 3.
So how how can i do it? Would anyone care to post some _actual_ code?

--
 -------------------------------------------------------------------------
|            Let there be justice for all guilty and innocent             |
 -------------------------------------------------------------------------
                                        Anatoly M. Verkhovsky
                                        averk...@kruuna.helsinki.fi
                                        http://www.helsinki.fi/~averkhov

Other Threads