Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DPMI code from .COM file? (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 11.05.2020, 23:05

> Wow!
> It is really impressive. But it is too complicated for me and do not
> understand the code much.

If you have any specific questions I can try to help you more.

> However - is possible to change the lines 313-314 from "mov ax,4c00h / int
> 21h" to RETF ?

Yes, that should be possible without problems.

However, you need to take care with the segmentation to properly address the current PSP (get using Int 21.51 if you don't have it available easily), the new PSP to be created, and your own data segments. And don't forget that after returning to the original process all register values except ss:sp may have changed, so put things on the stack (before calling Int 21.48 to allocate the process memory block) or into variables in the code segment.

Also, if you do use Int 21.48 to allocate the block for the process, you may want to make it self-owned (in line 61) so that it is freed by DOS when you terminate the child process.

Another bit to watch out for is that you may want to record into the child PSP the interrupt 23h and 24h handlers currently in use by your process. That is, use Int 21.3523 and .3524 and store the vectors into the child PSP. When the child terminates, DOS will set the vectors to those found in the child PSP. (My example just copies whatever vectors are in its own PSP, which is fine if you do not ever modify them. I guess Pascal may modify them.)

> Why I examine all this stuff - I have a quite nice pascal unit and I am
> proud that it is a amphiguous code - it compiles in DOS 32-bit Freepascal
> and 16-bit realmode turbopascal.
> I almost always use the Freepascal and 32-bit protected mode but anyway, in
> this unit I want to keep full compatibility with Turbo pascal.
> And in this unit I have a function Get_DPMI_Info.
> No problem in FreePascal as I simply call the DPMI function 400h and 401h.
> But in Turbopascal we are in real mode but the DPMI server may or may not
> be installed (although not active in this moment). And it would be nice to
> get some info about this non-active daemon.

That should be possible. Just a nitpick, if you have a DPMI server loaded "for the next client only" (I think HDPMI has such a mode) then your stint into protected mode will exhaust the DPMI server and it will uninstall itself when you terminate the DPMI client process. I guess you could expect a user to know what they are doing.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 251 users online (1 registered, 250 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum