Mail Archives: djgpp/1997/06/19/03:34:43
On Mon, 16 Jun 1997 sar AT maties DOT sun DOT ac DOT za wrote:
> Since memory
> protection is there to prevent different programs in the same physical
> memory of stepping on each other, and DJGPP always runs as the only
> program in its memory space, what is the problem?
This is a common misconception. DOS is described as a single-tasked OS
and people therefore think that it always runs only one program. But
that is not true. First, DOS itself is always loaded resident in memory
and you don't want to step on its code or data. Second, there are TSRs
and device drivers that are loaded and sometimes active (CWSDPMI, loaded
by the DJGPP startup code, is one of them). Third, your current active
DJGPP program itself could have been spawned by another program (e.g.,
when you run it from RHIDE) and you don't want the child to kill its
parent, right?
Nearptrs let your program write to any address in the 4GB address space,
so a runaway program can clobber anything and everything.
- Raw text -