SvarDOS / edrdos

Enhanced DR-DOS kernel and command interpreter ported to JWasm and OpenWatcom C
http://svardos.org/
Other
40 stars 4 forks source link

set PSP environment segment to 60h for process 0 #88

Closed mateuszviste closed 3 months ago

mateuszviste commented 3 months ago

This follows https://github.com/SvarDOS/bugz/issues/93

Bernd says:

setting PSP environment segment to 60h for process 0 (and of course filling it with sane value) and leave the config environment thing as it is for backwards compatibilty, so this would be an additional setting. Executable filename should then be appended to the environment at 60h.

I think this would be a very positive change. The only drawback I see is that the shell will have to detect that it is initial boot time (and hence time to reach to the config environement for F5/F8 detection) in a different way. Currently SvarCOM checks for a zeroed environment in its PSP. The easy way would be to change this and check it the PSP mentions seg 0x60 instead... but is it robust/clean enough? There is also this (potential) issue that the config environment is overwritten before the shell has a chance to read it (typically if a driver or config.sys-loadable TSR allocates high memory).

boeckmann commented 3 months ago

There is also this (potential) issue that the config environment is overwritten before the shell has a chance to read it (typically if a driver or config.sys-loadable TSR allocates high memory).

Yes, this might be a problem. Perhaps we could relocate the initial environment to 60h from the start, without setting the PSP environment, but returning 60h via the 4458h and adding a COMSPEC. I think this would ensure maximum compatibility with older software while having the initial environment at a safe place. Then SvarCOM still would have to differentiate between EDR and FD kernels, building its own master environment from the config environment, but at least environment invalidation would not be an issue, I guess.

mateuszviste commented 3 months ago

Perhaps we could relocate the initial environment to 60h from the start, without setting the PSP environment, but returning 60h via the 4458h and adding a COMSPEC.

I agree this would be a very good compromise. Useful for new usages and still retro-compatible.

boeckmann commented 3 months ago

config environment is now moved to 60h 8d769e6