Why not use the I/O stack (char_api_tos)? When process0 terminates & the
this may be possible but tricky in C. As the code must make sure it doesn't use any stack that it relies from before int21/ah=4b after int21/ah=4b.
I don't understand:
When process0 is about to be spawned, no other stack is in use. The only stack that can be activated is in case of a Critical Error.
When DOS-4C jumps to the termination address, which lays in the resident kernel space, it runs on the disk_api or user stack I haven't checked, so no conflict. But before DOS-4C jumps there, it restores SS:SP, pokes the return address there, then pops all the registers and iret's <-> from this point on no other stack, no other values are of interest, because all that counts is that the process0's termination handler is activated.
Why would that be tricky? The framework uses more or less the same mechanism as entry.asm and the usual DOS-4B/4C functions with faked entries for SS:SP,& int22/23/24 in the system PSP. (OK, DOS_PSP->SS:SP := char_api_tos - sizeof(user registers), I forgot about the restoring of the registers by return_user()).
All that needs to be done is to have to right values in the system PSP, when process0 is spawned by the DOS-4B routine -- hence, setup by the init code? And because those values are not modified by DOS-4B/4C, once setup you can re-use them for every load-again attempt. (DOS_PSP->SS:SP is not changed, because this is done by entry.asm, which is bypassed when spawning process0 via the internal DOS-4B rather than an INT-21 system call.)
Once return_user() has been performed, I see no difference as when the kernel had been activated through entry.asm? Because you have no caller, you won't return and, hence, need not preserve the registers. All that's not equal is the DS frame and the InDOS flag, but both can be handled right at the top of the termination handler.
Bye,
-- Steffen Kaiser
The current maintainer of [EMAIL PROTECTED] http://freedos.sourceforge.net/freecom/FreeCOM.html
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel