PSP manipulation from DPMI programs (Developers)
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:
- PSP manipulation from DPMI programs - Laaca, 16.02.2023, 00:02
- PSP manipulation from DPMI programs - Japheth, 16.02.2023, 05:25
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 11:18
- PSP manipulation from DPMI programs - Laaca, 16.02.2023, 19:46
- PSP manipulation from DPMI programs - tom, 16.02.2023, 20:16
- PSP manipulation from DPMI programs - Laaca, 16.02.2023, 20:48
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 21:23
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 21:28
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 21:35
- PSP manipulation from DPMI programs - Rugxulo, 17.02.2023, 08:35
- PSP manipulation from DPMI programs - tkchia, 17.02.2023, 11:21
- PSP manipulation from DPMI programs - marcov, 17.02.2023, 16:00
- PSP manipulation from DPMI programs - tkchia, 17.02.2023, 11:21
- PSP manipulation from DPMI programs - Laaca, 17.02.2023, 08:56
- PSP manipulation from DPMI programs - tkchia, 17.02.2023, 11:07
- PSP manipulation from DPMI programs - Laaca, 18.02.2023, 00:52
- PSP manipulation from DPMI programs - marcov, 17.02.2023, 16:02
- PSP manipulation from DPMI programs - tkchia, 17.02.2023, 11:07
- PSP manipulation from DPMI programs - Rugxulo, 17.02.2023, 08:35
- PSP manipulation from DPMI programs - tom, 16.02.2023, 20:16
- PSP manipulation from DPMI programs - Laaca, 16.02.2023, 19:46
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 11:26
- PSP manipulation from DPMI programs - tkchia, 16.02.2023, 17:14