home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vxworks / 1154 < prev    next >
Encoding:
Text File  |  1992-12-29  |  4.1 KB  |  120 lines

  1. Newsgroups: comp.os.vxworks,comp.solaris
  2. Path: sparky!uunet!mcsun!ub4b!info-sparc1.info.ucl.ac.be!fynu.ucl.ac.be!nina
  3. From: Ninane@fynu.ucl.ac.be (Alain Ninane - FYNU)
  4. Subject: New Year's gift - VxWorks and Solaris (LONG)
  5. Message-ID: <1992Dec29.114845.17660@info.ucl.ac.be>
  6. Followup-To: comp.os.vxworks
  7. Originator: nina@ids1.fynu.ucl.ac.be
  8. Sender: news@info.ucl.ac.be (News Administrator)
  9. Nntp-Posting-Host: fynu0
  10. Organization: University of Louvain (LLN) - Nuclear Physics Dept.
  11. Date: Tue, 29 Dec 1992 11:48:45 GMT
  12. Lines: 106
  13.  
  14. Hello everybody,
  15. We have received our SPARCclassic one week ago.  The machine is
  16. running the new operating system Solaris 2.1.  Unfortunately, we
  17. forgot to order a C compiler (we didn't know that they were no more
  18. delivered with the system :-(.  Because my primary task is to develop
  19. data acquisition software with VxWorks, I had first to build a
  20. cross-environment to 68k target.  This message describes the
  21. procedure that I have followed.
  22.  
  23. Note: The installations instructions are mine.  They certainly don't fit
  24.     your own architecture; they are just given as indications.
  25.  
  26. 1. If you don't have one, get a compiler.  You can download, from ftp.uu.net,
  27. the gcc binaries pre-compiled by cygnus. The file is:
  28.         vendor/cygnus/cygnus-sol2-1.0.bin.tar.Z (5851617 bytes)
  29. Just follow the instruction in INSTALL.
  30. Hints : - add /opt/cygnus/bin and /usr/ccs/bin in your path
  31.         - install everything (or symlinks) in /opt/cygnus
  32.  
  33. 2. Now, you are ready to build a cross-compiler for your VME targets;
  34. in my case: Motorola 68030, 68040 CPUs.
  35.  
  36.     a) Get gcc-2.3.2 from your preferred gnu source.
  37.     b) configure --host=sparc-solaris --target=m68k-sun-sunos \
  38.         -- with-gnu-ld --with-gnu-as --nfp
  39.     c) Modify the Makefile to remove the `-g' option (otherwise some
  40.     files will not compile).
  41.     d) Optional. In c-decl.c, initialize int flag_no_builtin = 1.
  42.     e) make LANGUAGES=c
  43.     f) installation
  44.         gcc-cross -> /usr/local/bin/cc68k
  45.         cc1          -> /usr/local/lib/gcc-lib/m68k-sun-sunos/2.3.2/cc1
  46.         cpp          -> /usr/local/lib/gcc-lib/m68k-sun-sunos/2.3.2/cpp
  47.  
  48. 3. You will need also a cross assembler.  Get gas-1.38.
  49.     a) ln -s m-sun3.h m68k.h
  50.     b) configure the makefile for a system V machine.
  51.     c) make a68
  52.     d) installation
  53.         a68 -> /usr/local/bin/as68k
  54.         in /usr/local/lib/gcc-lib/m68k-sun-sunos/2.3.2/, make a symlink
  55.         `as' to /usr/local/bin/as68k
  56.  
  57. 4. binutils-1.9 provides you some other cross-tools.  I'm interested only
  58. by some of them (ar68k, ld68k, nm68k, size68k, strip68k).
  59. CFLAGS in the Makefile must be modified.  I have used:
  60.     CFLAGS=-I. -traditional -DVPRINTF_MISSING -Dm68k -DPORTAR \
  61.                                         -DCROSS_LINKER  -DUSG -Usparc 
  62.     make ar ld nm size strip
  63.     install the tools in /usr/local/bin/...68k
  64.  
  65. 5. To compile a VxWorks kernel, you will also need a program to extract
  66. the symbol table.  It's easy to do:
  67.  
  68. Note: a.out.h comes from binutils-1.9
  69.  
  70. <---------------------- xsym.c -------------------------------->
  71. #include    <stdio.h>
  72. #include    <unistd.h>
  73.  
  74. #define m68k
  75. #define PORTAR
  76.  
  77. #include    "a.out.h"
  78.  
  79. main()
  80. {   struct exec exec;
  81.     off_t offset;
  82.     char data;
  83.  
  84.     if( read(0,&exec,sizeof(struct exec)) != sizeof(struct exec) )
  85.     {   fprintf(stderr,"struct exec read error\n");
  86.         exit(1);
  87.     }
  88.     offset = N_SYMOFF(exec);
  89.     lseek(0,offset,SEEK_SET);
  90.  
  91.     exec.a_text  = 0;
  92.     exec.a_data  = 0;
  93.     exec.a_bss   = 0;
  94.     exec.a_entry = 0;
  95.  
  96.     write(1,&exec,sizeof(struct exec));
  97.  
  98.     while( read(0,&data,1) > 0 )
  99.                         write(1,&data,1);
  100.  
  101.     _exit(0);
  102. }
  103. <---------------------- END ----------------------------------->
  104.  
  105. 6. Have fun.  Because I never use debuggers or other VxWorks tools, I have
  106. not ported them to solaris.  My purpose was to be able to compile and load
  107. my VxWorks software on the new SPARCclassic.
  108.  
  109. Alain
  110. -----------
  111. Dr. Alain H. Ninane     | Tel : +32-10-47.32.32 - Fax: +32-10-45.21.83
  112. University of Louvain   | Internet: Ninane@fynu.ucl.ac.be
  113. Nuclear Physics Dept.   | Ch. du Cyclotron, 2
  114. B-1348 Louvain-la-Neuve | BELGIUM               
  115. -- 
  116. Dr. Alain H. Ninane     | Tel : +32-10-47.32.32 - Fax: +32-10-45.21.83
  117. University of Louvain   | Internet: Ninane@fynu.ucl.ac.be
  118. Nuclear Physics Dept.   | Ch. du Cyclotron, 2
  119. B-1348 Louvain-la-Neuve | BELGIUM               
  120.