On Thu, 3 Jun 1999, Greg Haerr wrote:

> I see.  So the large code model is essentially implemented by combining
> functions together in a 64k segment until no more functions can be
> added, then starting another segment, with all functions being called
> using full seg:offset addressing mode.

The large model uses far addresses for both code and data.  Small uses
both near.  Medium and compact (I think only the MS compilers did the
latter) were, I think, small code, large data, and small data, large code
respectively. 

DOS supported all these by virtue of not supporting any of them.  Swapping
or relocating processes makes this rather harder. 

A reloc table in the binary (like DOS EXE files) could work for code at
least (as long as the binaries are immutable while a process is using
them, and the programs are careful about self-modifying code).

> Even with the data segment limited to 64k, the large code model would
> solve a number of problems.  In addition, it'd work on 8086's and 286's.

What about "anonymous" data, accessed through libc calls?  The segment
address of the data could be stored in a known part of the processes'
address space and if the program had to be relocated, the kernel would
check regs.{ds,es} and update them as necessary.

This would require said libc calls to observe some quite strict
restrictions, (never put the segment address into a "normal" register, for
example) but should otherwise be adequate.

Matthew.

Reply via email to