Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

PSP manipulation from DPMI programs (Developers)

posted by tkchia Homepage, 16.02.2023, 11:18
(edited by tkchia on 16.02.2023, 11:32)

Hello Laaca,

> I have no problems to do it in real mode:
> 1) Get my PSP (INT 21h/62h)
> 2) from PSP:2Ch get the segment address of the buffer with environment
> 3) Copy it to new buffer, modify it and place the PSP:2Ch to my new

??? You do not need to modify your parent's PSP:0x2c to get your child process to use a different environment.

In real/V86 mode, the parameter block that you pass to int 0x21, ax = 0x4b00 will directly specify the environment block you want to pass to the child process:
Format of EXEC parameter block for AL=00h,01h,04h:
Offset  Size    Description     (Table 01590)
 00h    WORD    segment of environment to copy for child process (copy caller's
                  environment if 0000h)
 02h    DWORD   pointer to command tail to be copied into child's PSP
 06h    DWORD   pointer to first FCB to be copied into child's PSP
 0Ah    DWORD   pointer to second FCB to be copied into child's PSP
 0Eh    DWORD   (AL=01h) will hold subprogram's initial SS:SP on return
 12h    DWORD   (AL=01h) will hold entry point (CS:IP) on return
SeeAlso: #01591,#01592


In DPMI mode, it seems that different DOS extenders may accept different kinds of parameter blocks for ax = 0x4b00. But most likely they will also offer a way to directly specify what environment variables you want the child to use.

You probably need to look up the documentation — or the source code — of FreePascal's DOS extender (go32?) to see what it does; then work out what to do from there.

(Alternatively, use DPMI's int 0x31, ax = 0x300 ("Simulate Real Mode Interrupt") to do the call. This should work under all DPMI hosts, but is troublesome to set up.)

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

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