And when a dos program terminates it tries to do so nicely with some flavor of exit call to the system. When a linux program terminates it tries to do so nicely with some flavor of exit call to the system. Just like now as then when a windows program decides to terminate it tries to do it nicely with some flavor of exit call. Makes no difference if those instructions wear the name DOS or Linux or windows. At that period of time you for purposes of this discussion had a single execution unit, a single core executing the instructions, mostly in order. It doesnt matter whether you are running DOS or Windows or Linux or BSD or whatever on that processor it is all the same. Perhaps one of the famous ones was Borland Sidekick which was a personal information manager that would pop up instantly with a keypress.
Then, in response to certain events, that code would be run. Now there were things can could be said to run concurrently, DOS had plenty of TSR (terminate and stay resident) programs that would run, hook into an interrupt or DOS in some way, then exit but leaving some memory allocated (where its code was). In a similar way, vast tracts of MS-DOS (the kernel) stayed continuously in memory yet they weren't "running", unless called explicitly by a non-kernel program. The fact that some of the code remained resident in no way means that it was "running". When the program exited, it did so by calling code in the resident portion which would then reload the transient portion if necessary and continue.
When you ran a program, it typically got loaded in place of the transient portion and then run. No, they weren't executing simultaneously.ĬOMMAND.COM had a resident portion that was in memory all the time and a transient portion that could be tossed out at will.