[comp.unix.microport] CTeX and DOS or XENIX or Microport

samperi@mancol.UUCP (Dominick Samperi) (04/24/88)

I've been trying to get CTeX 2.9 running under DOS or Xenix or Microport. In the
DOS  environment, the progem will compile and link in the large memory model,
provided that two arrays are declared huge (mem[] and font_info[]).
Unfortunately, the resulting executable file is more than 900K, even when
the -Os (keep the program small) switch is used. Consequently, it is too big
to fit in DOS's limited memory.

In the Microport environment, after breaking up a few modules, it is possible
to compile all of the source files, but the link fails, even when I change
the declared size of some of the arrays so they are not bigger than 64K.

It was possible to compile and link the program in the Xenix environment,
and the resulting executable is less than 300K (what is going on with the
Microsoft DOS C compiler??? - 900K!!!). The huge memory model was used.
The program runs, but it seems to dump core when it tries to manipulate
a few numbers that are too big to fit in a 16 bit integer. These large
numbers are hardwired into the code, apparently under the assumption that
the target machine will have 32 bit ints. I have not been able to load
any of the standard fonts either.

There have been postings here stating that people have been able to
compile and run CTeX under DOS and Microport, and this is what motivated
me to try. Perhaps the posters could provide a little more information,
give pointers to documentation, more details, etc.? Thanks.

-- 
Dominick Samperi, Manhattan College, NYC
    manhat!samperi@NYU.EDU           ihnp4!rutgers!nyu.edu!manhat!samperi
    philabs!cmcl2!manhat!samperi     ihnp4!rutgers!hombre!samperi
              (^ that's an ell)      uunet!swlabs!mancol!samperi

phil@dhw68k.cts.com (Phil Suematsu) (04/27/88)

In article <377@mancol.UUCP> samperi@mancol.UUCP (Dominick Samperi) writes:
>I've been trying to get CTeX 2.9 running under DOS or Xenix or Microport. In
>the DOS environment, the progem will compile and link in the large memory
>model, provided that two arrays are declared huge (mem[] and font_info[]).
>Unfortunately, the resulting executable file is more than 900K, even when
>the -Os (keep the program small) switch is used. Consequently, it is too big
>to fit in DOS's limited memory.

I assume you are working with Common TeX 2.9, and not CTeX (CTeX is 
not Common TeX).

If you have compiled Common TeX 2.9 under MS-DOS using Microsoft C
5.0, then you know that you have to replace occurrences of the
'interrupt' identifier with 'interrupt_flag', to avoid using the MSC
5.0 reserved word 'interrupt'.  References to time values in 'tex.c'
should be typed with the 'time_t' to get the correct time displayed
in the '.log' files.  The switch statement blocks in 'cmds.c' have to
be broken up into seperate functions to avoid running out of compiler
heap space.
 
Array dimensions are all conveniently located in 'tex.h'.  To avoid
'huge' arrays and to get the executables under 545k, I have reduced
many of the numbers in 'tex.h'.  I have based the numbers on those
found in 'tex.dos' of Common TeX 2.1.  It seems that Common TeX was
developed with MS-DOS limitations in mind (thanks Pat).
 
The last modification I have made, as a precaution, is the inclusion
of the all global function declarations into 'tex.h'.  These may be
generated with 'cl -AL -Zg filename.c > filename.def',  just in case
Pat forgot to cast an 'int' to a 'long', or 'long' to 'int', in a
function call somewhere.
 
I don't want to release diffs to the net quite yet, because I have
not had the opportunity to fully test the modified Common TeX.  This
is because _I do not have the Computer Modern font '.pxl' files_ to
display the DVI output with.  It is possible that someone out there
has a Common TeX 2.9 working under MS-DOS which has already been
torture tested.  It would be better to post diffs from that source
rather than from my untested version.  But if you are desperate, you
can mail me a request for my context diffs and use them at your own
risk.  I have successfully executed 'initex' and 'virtex' on
'plain.tex' and 'story.tex', respectively.  I have decided to obtain
the '.pxl' files before continuing any testing.
 
While I'm here, I'll repeat my previous plea:  If anyone has the
'.pxl' files for the Computer Modern fonts at 300 dpi in the most 
common sizes and magnifications, please let me know how I can pick 
them up other than using ftp (anonymous uucp, a BBS, US Mail, 
homing pigeon...).  Since the files are so large, the closer the 
site is to California, the better it would be if phone connections 
are necessary (the Channel 1 BBS is quite a long-distance call for 
me).
 
     Thanks once again, Phil Suematsu
-- 
---------------+------------------------------------------------------
Phil Suematsu  | InterNet: phil@dhw68k.cts.com or phil@turnkey.tcc.com
(714) 633-0876 | or  uucp: ...{trwrb,hplabs}!felix!dhw68k!phil
---------------+------------------------------------------------------
-- 
---------------+------------------------------------------------------
Phil Suematsu  | InterNet: phil@dhw68k.cts.com or phil@turnkey.tcc.com
(714) 633-0876 | or  uucp: ...{trwrb,hplabs}!felix!dhw68k!phil
---------------+------------------------------------------------------