Mail Archives: djgpp-workers/2001/05/23/23:55:06
> I don't want to get fancy here, just print some legible message and
> exit. But it ain't easy: without _dos_ds set, we cannot use dosmemput
> and such likes to put the message text into the transfer buffer. A
> bummer.
> (I originally considered to use the PSP selector, since the transfer
> buffer follows the PSP, but that selector seems to have a 100h-byte
> limit, or at least could be like that according to the DPMI spec.)
You could use the 128 bytes of the command line area, overwriting it
with the message string, since you are getting ready to exit. This
should be guaranteed to be enough for a message, and fit in the limit.
> Question: is it safe to overwrite the program's environment by using
> the environment block as the transfer buffer? Note that I don't want
> to modify the selector itself -- this is verboten by the DPMI rules --
> only to write over the environment strings accessing them via the
> selector stuffed by the DPMI host at offset 2Ch in the PSP.
This would probably work also, since I don't think the environment will
be needed anymore. But what if the environment is very short? Probably
unlikely (especially if you are in an environment which runs out of
selectors), but the possibility of dos memory block corruption.
- Raw text -