Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!hpcuhb!hpsmtc1!swh From: swh@hpsmtc1.HP.COM (Steve Harrold) Newsgroups: comp.os.minix Subject: Re: Cross Compiling under TurboC Professional Package Message-ID: <11680003@hpsmtc1.HP.COM> Date: 9 Mar 89 17:31:04 GMT References: <10426@louie.udel.EDU> Organization: Hewlett Packard, Cupertino Lines: 66 Re: TurboC and MINIX Some additional info on using the TurboC compiler for producing MINIX code. Many (dozens) of the .ASM files are not needed for the TurboC environment because these files are actually extensions of the "cc" command packaged with MINIX. What this means that when the compiler wants to do something like multiply two longs together it makes a call to one of these .ASM routines instead of emitting the code inline. When using TurboC you have to have a different set of such "extension" routines. (BTW, the example of multiplying two longs may not be appropriate, but I hope you get the idea.) I determined by trial and error what .ASM files you actually need (i.e. which files contain routines explicitly invoked by actual MINIX source code): kernel\ klib88.asm mpx88.asm lib\ catchsig.asm getutil.asm head.asm sendrec.asm setjmp tools\ bootblok.asm diskio.asm fsck1.asm Then, you have to build a .LIB file that contains the TurboC "extensions": This is a section from my makefile. The names are files within the TurboC CS.LIB file. You have to use the TLIB command to extract them from the official file and re-package them into your own .LIB file. This step is important because you must never LINK with the actual TurboC libraries, otherwise you'll pick up MSDOS-specific code that is guaranteed to fail in the MINIX runtime environment. OBJS = ldiv.obj \ llsh.obj \ lrsh.obj \ lursh.obj \ lxmul.obj \ oldlrsh.obj \ overflow.obj \ pada.obj \ padd.obj \ pcmp.obj \ pina.obj \ psbp.obj \ scopy.obj \ spush.obj If all this does not make sense I'm sorry, but if you're about to build an operating system, then you had better understand a little bit about compiler construction and a LOT about your linkers and librarians. -- --------------------- Steve Harrold swh@hpsmtc1.hp.com ...hplabs!hpsmtc1!swh HPG200/11 (408) 447-5580 ---------------------