Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!lll-lcc!ptsfa!well!msudoc!crlt!russ From: russ@crlt.UUCP Newsgroups: comp.os.minix Subject: Re: Minix and compiler models Message-ID: <631@crlt.UUCP> Date: Wed, 11-Feb-87 12:58:27 EST Article-I.D.: crlt.631 Posted: Wed Feb 11 12:58:27 1987 Date-Received: Fri, 13-Feb-87 05:36:32 EST References: <966@ulowell.cs.ulowell.edu> <1565@cit-vax.Caltech.Edu> <500@bobkat.UUCP> Organization: CRLT , Ann Arbor, MI Lines: 52 Summary: Correction on 8086/88 memory models. In article <500@bobkat.UUCP>, m5d@bobkat.UUCP writes: >I have BIG BIG problems believing that Minix allows separate code, >data, and stack segments. This is NOT small model, at least not as >defined by Intel. In fact, it's no model at all: > > Small: one code seg, one data seg (incl. data, stack, and constants) > Compact: code, data, stack, and "memory" > Medium: one code seg. per module, only one each data, stack, "memory" > Large: one code seg & one data seg per module, one stack and > one "memory" Memory models supported by Lattice C: S (small): 64K code, 64K data/stack. 16 bit pointers. P (Prog): To 1 MB code, 64K data/stack. 16 bit data pointers. Function pointers by lookup table. D (data): 64K code, to 1 MB data, 64K stack. 32 bit pointers. L (large): To 1 MB code, 1 MB data, 64K stack. 32 bit pointers. >[...] It could be that PC-DOS calls >this 8085 model "small". Nope, the combined I&D (64K total) model is called the 8080 model. >In all the models except "small" (or 8085 model, which is almost the >same for the purposes of this discussion), pointers MUST be 32 bits. >Why? Because otherwise the location referenced by the pointer cannot >be determined. The 8080, small and P models can use 16-bit pointers, because they have only 64K of data/stack space. Separate I & D segments do not affect the required pointer size unless you want to do something silly like write over your code. The P model (with more than 64K of code) can still use 16 bit pointers to data; its pointers to functions are indirect through a table of function addresses (32 bits/entry, of course). So far as relocatability is concerned, any 8080 or S model program can be shoved to an arbitrary segment address dynamically and all pointers will still be valid. A P model program could survive relocation of its data segment; if the code was re-entrant and re-used, then a P model program could also be fork()ed without difficulty. D and L model programs, forget it. It looks like Minix supports the 8080 and S models only, which is not suprising. -- The above opinions and figures are mine; my employer endorses them implicitly. "They that can give up essential liberty to Russ Cage, Robust Software Inc. gain a little temporary safety, deserve neither ihnp4!itivax!m-net!russ liberty nor safety." -- Ben Franklin (Do not reply to me at CRLT, it loses news and mail regularly. Use path above.) NSA food>terrorist DES RSA KGB cocaine cryptography RSA TEMPEST fnord Hail Eris!