PSP manipulation from DPMI programs (Developers)
I am trying to debug my test program which should create a new environment variable and then call the child process with normal Exec call.
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 buffer.
OK.
But when I try to follow this scheme in DPMI (Freepascal) I am not able to get it to work.
I thought that oroginal PSP:2Ch is a segment somewhere to low DOS memory and my new buffer bust be also in the DOS memory.
But after some googling I found this article:
http://www.delorie.com/djgpp/doc/dpmi/ch4.1.html
And mainly this part is confusing to me:
The environment pointer in the client program's PSP is automatically converted to a selector during the mode switch. If the client wishes to free the memory occupied by the environment, it should do so before entering protected mode and zero the word at PSP:2CH (segment address of the environment>. The client may change the environment point in the PSP after entering protected mode but it must restore it to the selector created by the DPMI host before terminating. The client should not modify or free the PSP or environment descriptors supplied by the DPMI host.
So this means that the PSP:2Ch does not point to common DOS memory pool but to some own selector?
Why?
And if I want to create a new environment variable I have to do all the boring stuff with allocating DPMI selector, set its base, limit and so on?
---
DOS-u-akbar!
Complete thread:
- PSP manipulation from DPMI programs - Laaca, 16.02.2023, 00:02 (Developers)
- 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