Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!husc6!cmcl2!beta!myxm From: myxm@beta.UUCP (Mike Mitchell) Newsgroups: comp.os.minix Subject: Re: (really MSC cross-compiling) now TurboC Message-ID: <6395@beta.UUCP> Date: Tue, 16-Jun-87 10:31:37 EDT Article-I.D.: beta.6395 Posted: Tue Jun 16 10:31:37 1987 Date-Received: Sun, 21-Jun-87 06:40:17 EDT References: <114@jc3b21.UUCP> <421@psu-cs.UUCP> <1433@bcsaic.UUCP> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 55 Keywords: minix cross compile MSC libraries TURBOC Summary: kind of simple -- experience with turbo c In a development of Minix under DOS, I have been using the Microsoft Assembler and the new Turbo C Compiler from Borland. Initially there have been problems in getting a Minix library put together and working. I have compiled various bits of the .../commands directory and had them successfully work after a bit of tweaking. The first thing that I had to do was compile a library of routines for use under Minix. The routines come from the file libsrc.a and in order to extract them I had to compile ar.c using the TurboC libraries. I then used ar.exe to extract the Minix libray routines (crypt, chmod, getpwent,...). After getting a subdirectory of C files, I used the C compiler to turn them into object modules (both tiny and small memory models). I also took the .ASM source from the C86 directory, changed the segment definitions for use with code generated by TurboC, and assembled them. The crtso.asm module from the C86 directory is the start up module that I use. I then used lib.exe to place all of the object modules (except crtso.obj and its counterpart head.obj) into a library--minixt.lib (tiny model) and minixs.lib (small model). The order of the modules is quite important. I ordered them the same way they were in the /lib/libc.a library on the Minix floppy. The next project was to get the program dos2out.exe working. Fairly simple, compile and try it. I then proceded to pick a few commands from the .../commands directory and proceed to compile them. I compiled them in such a manner that when the compiler was done, all that I had was an .obj file of the correct memory model. I then linked this object module with crtso.obj and specified that the library that I wished to use was the minix.lib (instead of the TurboC). After that I had an .exe file which I ran through dos2out.exe. Now, there was an .out file. Copy it to a floppy; boot Minix; dosread the .out file into the Minix directory structure; run it! And it ran! Now, I did suffer a few hitches in doing all of this, and as it turns out the most difficulty is in getting the .ASM files correct. I had all kinds of problems with the segments and how they should load. As it turns out, the TurboC book is not as complete as it could be in this respect. I managed to get it figured out though by looking at the startup code that Borland supplied for use with their compiler. Ah, what's this, more segments and segments with different names??!? I would greatly appreciate hearing about other people's efforts at bringing up a Minix system with DOS as the development system. Oh, by the way, TurboC is fantastic and the .out files it compiles are smaller than those produced by the Minix compiler. *=*=*= Mike Mitchell myxm@lanl.gov {backbone}!cmcl2!lanl!myxm