3 ms·
> specifically, it had no "process management"; no concept of "processes" at all, in fact. I don't know if that statement is quite true. In MS-DOS, each PSP se
by skissane 6y ago
> specifically, it had no "process management"; no concept of "processes" at all, in fact.
I don't know if that statement is quite true. In MS-DOS, each PSP segment is arguably a process. Processes can spawn sub-processes, albeit the parent process is mostly suspended while the child process runs. (Not entirely suspended, because a child process can call back to a parent process – most commonly by invoking software interrupts for which the parent process has installed handlers.) While only one process can be executing in the foreground at a time, multiple processes can coexist in memory. TSRs rely on this ability to have multiple processes in memory at once.
By contrast, some other operating systems, for example CP/M-80 1.x and 2.x, only supported loading one program into memory at a time, and had no support for spawning subprocesses. (Later versions of CP/M did develop some support for spawning subprocesses, although arguably it was less polished and cohesive than that provided by MS-DOS.)
Microsoft BASICs for DOS (BASICA, GW-BASIC, QBASIC, etc) provide a SHELL statement which runs a subprocess and then continues executing the BASIC program when it has finished. Microsoft BASIC for CP/M (MBASIC) has no SHELL statement, because the earlier versions of CP/M it was developed for lacked that facility.
You can actually implement the equivalent of "ps" for MS-DOS by walking the MCB chain and checking which MCBs look like valid PSPs. (One can look for signs that an MCB contains a valid PSP – for example, that it starts with the bytes 0xCD 0x20.)
- h2odragon 6y agoI implemented time shared multitasking in a DOS TSR... Had a modem tender sending and receiving files in the background. Thanks for reminding me about the existence of Program Segment Prefixes and Memory Control Blocks. twitch