Separate data and function address spaces

Chip Salzenberg chip at ateng.com
Sat Nov 18 05:16:30 AEST 1989


According to palowoda at fiver.UUCP (Bob Palowoda):
>According to chip at ateng.com (Chip Salzenberg):
>> Unlike SysV, SCO Xenix/286 and Xenix/386 versions 2.2 and 2.3 create
>> disjoint code and data segments.  The exceptions are called "impure"
>> binaries.  I've never seen impure binaries except for the '286/186/8086,
>> and such 16-bit binaries limit code and data to a total of 64K.
> 
>   Does this mean the the 386 version (a 32bit version of Xenix) has 
>limitations on huge array sizes?  I was under the impression that the
>386 version of Xenix C compilier was a non-segmented 32bit compilier 
>in all respects.

Not quite.  As long as a program runs on a '386 it is "segmented", since the
'386 uses segments for all memory references.  However, since small model on
the '386 (one code segment, one data segment) provides 4G of code and 4G of
data, no one bothers with the more complicated models.

To state plainly what I described in convoluted way above:

	'286 tiny model         code+data 64K, executable data
	'286 small model        code 64K, data 64K, no executable data
	'386 tiny model         code+data 4G, executable data
	'386 small model        code 4G, data 4G, no executable data

It seems that SysV/386 uses tiny model, whereas Xenix/386 uses small model.
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip at ateng.com> or <uunet!ateng!chip>
    "Did I ever tell you the Jim Gladding story about the binoculars?"



More information about the Comp.lang.c mailing list