[comp.sys.m68k] Romable C 68000

harper-m@mars.cis.ohio-state.edu (Matthew Hayden Harper) (03/09/90)

Newsgroups: comp.sources.wanted
Subject: Romable C libraries
Summary: 
Expires: 
Sender: 
Reply-To: Matthew Hayden Harper <harper-m@cis.ohio-state.edu>
Followup-To: 
Distribution: usa
Organization: Ohio State University Computer and Information Science
Keywords: 

Help!! I have made a program which converts Sun3 C executable files into
motorola hex records for my eprom programmer.  I am doing this so I can
execute C programs on a 68000/68010 board which I have made.  The program
uses my own startup code to load initialized data segments, and zero out
bss (unitialized data segments).  I have been successful in doing this with
commodore amiga executable files, however there are a few bugs in their 
compiler so I don't really trust it.  However, I have been successful in
using the floating point libraries and all of their string and math functions.

I then wrote a program which converts a Sun3 executable file (with my startup
code linked in) into an amiga executable file.  I then run it through my
amiga executable to motorola hex records program and everything works until
it hits a sscanf function or a ssprintf function, at which time the system
bus errors and crashes.  I looked at the dependincies of sscanf() and
sprintf() in /usr/libc.a and apparantly these functions are linking with some
type of buffering system in memory which itself requires malloc(). However,
my program uses floating point and did not crash when floating point routines
were used, but when I tried to sprintf() the values into a string, the system
crashes.  The libraries I have for the amiga are already compiled, so I don't
have source for them, and I don't trust them enough to convert to sun object
libraries because I have found some bugs in a few of the libraries.

If anyone has the source for C libraries which doesn't use operating system
calls, I would really appreciate it if you could mail them to me (particularly
the souce for sscanf and sprintf functions which don't use operating system
calls).  Also if you know how to cause floating point libraries to be
generated completely in software independent of the operating system and 
a coprocessor with either the cc sun compiler or the gcc sun compiler, I 
would like to know how to do it (I am currently using gcc with the
-mc68000 and -msoft-float options and I am not sure if this is correct).

Also if anyone has a Romable C 68000 compiler or a programs which converts a 
sun3 executable file to any type of hex record, I would appreciate finding out
where I could get a copy of the souce.

Thank you

-=-
Matthew Harper

valentin@cbmvax.commodore.com (Valentin Pepelea) (03/10/90)

In article <78040@tut.cis.ohio-state.edu> Matthew Hayden Harper <harper-m@cis.ohio-state.edu> writes:
>
>I have been successful in doing this with commodore amiga executable files,
>however there are a few bugs in their compiler so I don't really trust it.

Our compiler? Perhaps you mean the Lattice C compiler? What version? Send them
a bug report.

>but when I tried to sprintf() the values into a string, the system
>crashes.  The libraries I have for the amiga are already compiled, so I don't
>have source for them, and I don't trust them enough to convert to sun object
>libraries because I have found some bugs in a few of the libraries.

Well, I don't know whether you are talking about the amiga sprintf() function,
or the sun one. The Amiga sprintf() can be found in amiga.lib and uses a bss
hunk.

>If anyone has the source for C libraries which doesn't use operating system
>calls, I would really appreciate it if you could mail them to me (particularly
>the souce for sscanf and sprintf functions which don't use operating system
>calls).

Lattice provides source code to their libraries for a nominal fee. ($300 to 
$500 I think)

>Also if you know how to cause floating point libraries to be
>generated completely in software independent of the operating system and 
>a coprocessor with either the cc sun compiler or the gcc sun compiler, I 
>would like to know how to do it.

Lattice allows you to math functions that execute 68881 code.

Valentin
-- 
The Goddess of democracy? "The tyrants     Name:    Valentin Pepelea
may distroy a statue,  but they cannot     Phone:   (215) 431-9327
kill a god."                               UseNet:  cbmvax!valentin@uunet.uu.net
             - Ancient Chinese Proverb     Claimer: I not Commodore spokesman be

jharkins@sagpd1.UUCP (Jim Harkins) (03/14/90)

In article <10073@cbmvax.commodore.com> valentin@cbmvax (Valentin Pepelea) writes:
>Lattice provides source code to their libraries for a nominal fee. ($300 to 
>$500 I think)

Um, nominal to who?  $300-500 is nominal to a company trying to make and sell
a product, but to a hobbyist that kind of cash is anything but nominal.  Wish
I made enough to call that kind of money nominal, I'd trade my PC in for a
Sun.   Yes, I know the hazards/hassles involved in selling source, I just
think the phrasing needs to be adjusted.  Especially as I consider the Amiga
to be a hobbyist machine, whereas PCs tend to be buisness machines.  Not that
the PC is a superior machine, it just has superior marketing and momentum.


-- 
jim		jharkins@sagpd1

"My hope is that we can use tariffs to force Japan to open their markets to
 imported goods.  My fear is I'll be forced to buy lousy American made stuff."

fnf@estinc.UUCP (Fred Fish) (03/23/90)

In article <78040@tut.cis.ohio-state.edu> Matthew Hayden Harper <harper-m@cis.ohio-state.edu> writes:
>If anyone has the source for C libraries which doesn't use operating system
>calls, I would really appreciate it if you could mail them to me (particularly
>the souce for sscanf and sprintf functions which don't use operating system
>calls).  Also if you know how to cause floating point libraries to be
>generated completely in software independent of the operating system and 
>a coprocessor with either the cc sun compiler or the gcc sun compiler, I 
>would like to know how to do it (I am currently using gcc with the
>-mc68000 and -msoft-float options and I am not sure if this is correct).

Since it sounds like you already have access to an Amiga, you might try
using one of the freely redistributable compilers for the Amiga, or rehosting
it to another machine.  One possibility is the "zc" compiler, based on
Sozobon C, which includes full source for the compiler and runtime.  This
distribution is available on disk 314 of my library for the Amiga (AKA
"Fish Disks") widely available from Amiga user groups and dealers.  Below
is a "find" output for the zc distribution:

zc
zc/.info
zc/Ami
zc/Ami/Extra.asm
zc/Ami/Makefile
zc/Ami/obj
zc/Ami/obj/Extra.o
zc/Ami/obj/clist_lib.o
zc/Ami/obj/console_lib.o
zc/Ami/obj/diskfont_lib.o
zc/Ami/obj/dos_lib.o
zc/Ami/obj/exec_lib.o
zc/Ami/obj/expansion_lib.o
zc/Ami/obj/graphics_lib.o
zc/Ami/obj/icon_lib.o
zc/Ami/obj/intuition_lib.o
zc/Ami/obj/layers_lib.o
zc/Ami/obj/potgo_lib.o
zc/Ami/obj/romboot_lib.o
zc/Ami/obj/timer_lib.o
zc/Ami/obj/translator_lib.o
zc/Docs
zc/Docs/A68k.doc
zc/Docs/Blink.doc
zc/Docs/Make.doc
zc/Docs/cc.doc
zc/Docs/genstubs.doc
zc/Docs/zc.doc
zc/Docs/zc.lib.doc
zc/Examples
zc/Examples/Amiga
zc/Examples/Amiga/Balls
zc/Examples/Amiga/Balls/Makefile
zc/Examples/Amiga/Balls/balls
zc/Examples/Amiga/Balls/balls.c
zc/Examples/Amiga/Lav
zc/Examples/Amiga/Lav/POSTER
zc/Examples/Amiga/Lav/lav
zc/Examples/Amiga/Lav/lav.c
zc/Examples/Amiga/Pri
zc/Examples/Amiga/Pri/POSTER
zc/Examples/Amiga/Pri/Pri
zc/Examples/Amiga/Pri/Pri.c
zc/Examples/Amiga/Tilt
zc/Examples/Amiga/Tilt/POSTER
zc/Examples/Amiga/Tilt/tilt
zc/Examples/Amiga/Tilt/tilt.c
zc/Examples/Amiga/kd
zc/Examples/Amiga/kd/kd
zc/Examples/Amiga/kd/kd.c
zc/Examples/Amiga/kd/kd.doc
zc/Examples/Stdio
zc/Examples/Stdio/CCheck
zc/Examples/Stdio/CCheck/CCheck
zc/Examples/Stdio/CCheck/CCheck.c
zc/Examples/Stdio/CCheck/CCheck.doc
zc/Examples/Stdio/Cflow
zc/Examples/Stdio/Cflow/Cflow
zc/Examples/Stdio/Cflow/Cflow.c
zc/Examples/Stdio/Cflow/Cflow.doc
zc/Examples/Stdio/Cflow/Makefile
zc/Examples/Stdio/Hello
zc/Examples/Stdio/Hello/hello
zc/Examples/Stdio/Hello/hello.c
zc/Examples/Stdio/Sieve
zc/Examples/Stdio/Sieve/Sieve
zc/Examples/Stdio/Sieve/Sieve.aztec
zc/Examples/Stdio/Sieve/Sieve.c
zc/Examples/Stdio/Sieve/Sieve.doc
zc/Examples/Stdio/Tabs
zc/Examples/Stdio/Tabs/Makefile
zc/Examples/Stdio/Tabs/detab
zc/Examples/Stdio/Tabs/detab.c
zc/Examples/Stdio/Tabs/entab
zc/Examples/Stdio/Tabs/entab.c
zc/Examples/Stdio/Tabs/tabs.doc
zc/Examples/Stdio/Translit
zc/Examples/Stdio/Translit/translit
zc/Examples/Stdio/Translit/translit.c
zc/Examples/Stdio/Translit/translit.doc
zc/Examples/Stdio/Wc
zc/Examples/Stdio/Wc/POSTER
zc/Examples/Stdio/Wc/Wc.c
zc/Examples/Stdio/Wc/makefile
zc/Examples/Stdio/Wc/wc
zc/Examples/Stdio/Wc/wc.1
zc/Examples/Stdio/Wc/wc.man
zc/Examples/Stdio/Xref
zc/Examples/Stdio/Xref/Makefile
zc/Examples/Stdio/Xref/xrf
zc/Examples/Stdio/Xref/xrf.doc
zc/Examples/Stdio/Xref/xrf.h
zc/Examples/Stdio/Xref/xrf0.c
zc/Examples/Stdio/Xref/xrf1.c
zc/Examples/Stdio/Xref/xrf2.c
zc/Examples/Stdio/Xref/xrf3.c
zc/Examples/Stdio/Xref/xrfd.c
zc/Examples/Stdio/Xref/xrfi.c
zc/Getting_Started
zc/Getting_Started.info
zc/IOLib
zc/IOLib/Makefile
zc/IOLib/Math
zc/IOLib/Math/Makefile
zc/IOLib/Math/fp_prt.c
zc/IOLib/Math/fp_scan.c
zc/IOLib/Math/mathbas.a
zc/IOLib/Math/mathtrans.a
zc/IOLib/Math/printf.c
zc/IOLib/Math/scanf.c
zc/IOLib/crt
zc/IOLib/crt/Makefile
zc/IOLib/crt/begin.a
zc/IOLib/misc
zc/IOLib/misc/Chk_Abort.c
zc/IOLib/misc/Makefile
zc/IOLib/misc/abort.c
zc/IOLib/misc/catch.c
zc/IOLib/misc/chdir.c
zc/IOLib/misc/chmod.c
zc/IOLib/misc/cli_parse.c
zc/IOLib/misc/ctype.c
zc/IOLib/misc/getcwd.c
zc/IOLib/misc/getenv.c
zc/IOLib/misc/getopt.c
zc/IOLib/misc/getpid.c
zc/IOLib/misc/hsort.c
zc/IOLib/misc/lmath.a
zc/IOLib/misc/lsearch.c
zc/IOLib/misc/main.c
zc/IOLib/misc/malloc.c
zc/IOLib/misc/memavail.c
zc/IOLib/misc/mkdir.c
zc/IOLib/misc/msize.c
zc/IOLib/misc/pfindfil.c
zc/IOLib/misc/qsort.c
zc/IOLib/misc/rand.c
zc/IOLib/misc/realloc.c
zc/IOLib/misc/setjmp.a
zc/IOLib/misc/shell.c
zc/IOLib/misc/stime.c
zc/IOLib/misc/stksiz.c
zc/IOLib/misc/system.c
zc/IOLib/misc/time.c
zc/IOLib/misc/timer.c
zc/IOLib/misc/wb_parse.c
zc/IOLib/misc/wildcard.c
zc/IOLib/stdio
zc/IOLib/stdio/Makefile
zc/IOLib/stdio/access.c
zc/IOLib/stdio/creat.c
zc/IOLib/stdio/fclose.c
zc/IOLib/stdio/fdopen.c
zc/IOLib/stdio/fflush.c
zc/IOLib/stdio/fgetc.c
zc/IOLib/stdio/fgets.c
zc/IOLib/stdio/fopen.c
zc/IOLib/stdio/fprintf.c
zc/IOLib/stdio/fputc.c
zc/IOLib/stdio/fputs.c
zc/IOLib/stdio/fread.c
zc/IOLib/stdio/fscanf.c
zc/IOLib/stdio/fseek.c
zc/IOLib/stdio/fsetpos.c
zc/IOLib/stdio/fwrite.c
zc/IOLib/stdio/getbuf.c
zc/IOLib/stdio/gets.c
zc/IOLib/stdio/getw.c
zc/IOLib/stdio/isatty.c
zc/IOLib/stdio/lseek.c
zc/IOLib/stdio/open.c
zc/IOLib/stdio/perror.c
zc/IOLib/stdio/printf.c
zc/IOLib/stdio/prtfld.c
zc/IOLib/stdio/read.c
zc/IOLib/stdio/remove.c
zc/IOLib/stdio/rename.c
zc/IOLib/stdio/rmdir.c
zc/IOLib/stdio/scanf.c
zc/IOLib/stdio/setbuf.c
zc/IOLib/stdio/setvbuf.c
zc/IOLib/stdio/sprintf.c
zc/IOLib/stdio/sscanf.c
zc/IOLib/stdio/stat.c
zc/IOLib/stdio/write.c
zc/IOLib/strlib
zc/IOLib/strlib/Makefile
zc/IOLib/strlib/atol.c
zc/IOLib/strlib/bsearch.c
zc/IOLib/strlib/bzero.a
zc/IOLib/strlib/ctlcnv.c
zc/IOLib/strlib/lmemcpy.a
zc/IOLib/strlib/lmemmove.c
zc/IOLib/strlib/ltoa.c
zc/IOLib/strlib/memccpy.c
zc/IOLib/strlib/memchr.c
zc/IOLib/strlib/memcmp.c
zc/IOLib/strlib/memcpy.a
zc/IOLib/strlib/memicmp.c
zc/IOLib/strlib/memmove.a
zc/IOLib/strlib/memset.a
zc/IOLib/strlib/splitpat.c
zc/IOLib/strlib/stradj.c
zc/IOLib/strlib/strcat.c
zc/IOLib/strlib/strchr.a
zc/IOLib/strlib/strcmp.c
zc/IOLib/strlib/strcpy.a
zc/IOLib/strlib/strcspn.c
zc/IOLib/strlib/strdup.c
zc/IOLib/strlib/stricmp.c
zc/IOLib/strlib/strirpl.c
zc/IOLib/strlib/stristr.c
zc/IOLib/strlib/strlen.c
zc/IOLib/strlib/strlwr.c
zc/IOLib/strlib/strncat.c
zc/IOLib/strlib/strncmp.c
zc/IOLib/strlib/strncpy.c
zc/IOLib/strlib/strnicmp.c
zc/IOLib/strlib/strpbrk.c
zc/IOLib/strlib/strpcpy.c
zc/IOLib/strlib/strpos.c
zc/IOLib/strlib/strrchr.a
zc/IOLib/strlib/strrev.c
zc/IOLib/strlib/strrpbrk.c
zc/IOLib/strlib/strrpl.c
zc/IOLib/strlib/strrpos.c
zc/IOLib/strlib/strset.c
zc/IOLib/strlib/strspn.c
zc/IOLib/strlib/strstr.c
zc/IOLib/strlib/strtok.c
zc/IOLib/strlib/strtol.c
zc/IOLib/strlib/strtrim.c
zc/IOLib/strlib/strupr.c
zc/IOLib/strlib/substr.c
zc/IOLib/strlib/swab.c
zc/ReadME
zc/ReadME.info
zc/ReadMe.1st
zc/ReadMe.1st.info
zc/ReadMe.fnf
zc/ReadMe.fnf.info
zc/c
zc/c/A68k
zc/c/Blink
zc/c/cc
zc/c/genstubs
zc/c/make
zc/c/top
zc/c/zc
zc/cc
zc/cc/Makefile.azt
zc/cc/System0.asm
zc/cc/System0.obj
zc/cc/ccx.c
zc/cc/fexec.c
zc/cc/makefile
zc/cc/wb_parse.c
zc/genstubs
zc/genstubs/Makefile
zc/genstubs/genfunc.c
zc/genstubs/genstubs.c
zc/genstubs/genstubs.h
zc/genstubs/gettok.c
zc/genstubs/wb_parse.c
zc/include
zc/include/ar.h
zc/include/assert.h
zc/include/basepage.h
zc/include/ctype.h
zc/include/errno.h
zc/include/fcntl.h
zc/include/limits.h
zc/include/macros.h
zc/include/malloc.h
zc/include/math.h
zc/include/setjmp.h
zc/include/stat.h
zc/include/stdarg.h
zc/include/stddef.h
zc/include/stdio.h
zc/include/string.h
zc/include/time.h
zc/include/types.h
zc/lib
zc/lib/Ami.lib
zc/lib/ZC.lib
zc/lib/begin.o
zc/lib/m.lib
zc/make
zc/make/Makefile.AZTEC
zc/make/README
zc/make/README.amiga
zc/make/check.c
zc/make/h.h
zc/make/input.c
zc/make/macro.c
zc/make/main.c
zc/make/make.c
zc/make/reader.c
zc/make/rules.c
zc/src
zc/src/Makefile
zc/src/bstok.h
zc/src/cookie.h
zc/src/d2.c
zc/src/decl.c
zc/src/expr.c
zc/src/fix.c
zc/src/flags.h
zc/src/fun.c
zc/src/g2.c
zc/src/gen.c
zc/src/gen.h
zc/src/gsub.c
zc/src/gunk.c
zc/src/main.c
zc/src/md.c
zc/src/nodes.c
zc/src/nodes.h
zc/src/ops.h
zc/src/out.c
zc/src/p2.c
zc/src/param.h
zc/src/pre.c
zc/src/sttok.h
zc/src/subs.c
zc/src/tok.c
zc/src/tok.h
zc/src/tytok.h
zc/system
zc/system/System0.asm
zc/system/System0.doc
zc/system/System0.obj
zc/system/fexec.c
zc/top
zc/top/Makefile
zc/top/branch.c
zc/top/coalesce.c
zc/top/data.c
zc/top/func.c
zc/top/health.c
zc/top/inst.c
zc/top/inst.h
zc/top/io.c
zc/top/main.c
zc/top/opcodes.c
zc/top/opcodes.h
zc/top/peep.c
zc/top/sym.c
zc/top/top.h
zc/top/util.c

-Fred
-- 
# Fred Fish, 1835 E. Belmont Drive, Tempe, AZ 85284,  USA
# 1-602-491-0048           asuvax!{nud,mcdphx}!estinc!fnf

xm50@sdcc12.ucsd.edu (don bowmen) (03/24/90)

	I am looking for a C cross compiler / assembler for 68000
target to run on a  MAC II.  This needs to be a professional looking
product as it will be used on a DOD project.  

	DonB