After building on Linux I could see that m68k-elf-gcc was also looking for GNU Assembler. After I built binutils the compiler works perfectly on OS X and Linux. I'm assuming when I tried executing m68k-elf-gcc on OS X that gcc failed to find as and defaulted to whatever is my environment variables i.e. The M5282EVB board does not have a serial EPROM or similar hardware providing a unique network MAC address. Instead a suitable address has to be programmed into flash via RedBoot's fconfig command. All configurations for the M5282EVB target include a serial device driver package CYGPKGDEVSSERIALMCFxxxx. Hi, I am trying to build a cross compiler for embedded 68K (CPU32). I have successfully done this in the past with gcc-2.7.2.1 and gcc-2.8.1 using the appropriate patches from cygnus. Download ZIP Launching GitHub Desktop. If nothing happens, download GitHub Desktop. This could be either an m68k-atari-mint toolchain or an m68k-elf gcc toolchain (see switches in the toplevel Makefile). These tools are available for all major platforms (Windows, Linux, Mac OS), and BaSgcc has been tested to compile fine on all of these.
This page presents a naive implementation of BOOTP and TFTP, the protocols to use to bootstrap a computer through a TCP/IP network. The source code is released under LGPL (Lesser GNU Public License).
Tftpnaive is available as source code, stable version 1.3.3.
The transfert speed has been improved greatly, see the Change history below.
The code is working on a big endian machine, Nicholas Lin sent me this patch and tested it on a little endian machine. Thanks for this contribution !
Scope
The current implementation is for a m68k board, using the CS8900 network chip. The source code of the network chip (cs89x.c) handles the hardware swap which some boards use. All the dependencies are resolved, there is no need for an external library even for libc (the libgcc is still needed but included with the compiler toolchain). The standard functions like printf and strcpy needed by the package are included in the baselib subdirectory. This software will *not* run under uClinux, it is designed to be standalone and to start a uClinux image or any other executable binary file. The memory footprint is quite small, about 7 KBytes for the test program on the DragonEngine. This software can be used as a starting point for your own bootstrap code, the bootp and tftp source code should be easy to reuse.
Files
README | a *very* short comment, mainly to send the reader to this page |
COPYING | LGPL license |
COMPILING | compilation/modification hints |
ChangeLog | what's new in this release |
tftpnaive/src/* | core files |
tftpnaive/de2/* | DragonEngine specific files |
tftpnaive/ucdimm/* | uCdimm specific files (not tested) |
baselib/* | a collection of basic functions |
Compiling
- DragonEngine II
- uCdimm
The provided Makefiles assume m68k-elf-gcc as compiler/linker. You may use the gcc toolchain at the uClinux distribution page to build this software.
You may have to modify the .ld file to relocate tftpnaive to a region not used by the downloaded file. The .ld contains also the stack address, tftpnaive needs around 12k for the data segment and 8k for the stack segment.
Setting up a BOOTP server
A linux DHCP server can act as a BOOTP server, you will have to install a dhcp server package on a linux machine and add some specific parameters for BOOTP. Add the lines below to your
/etc/dhcpd.conf
file :
The commented out next-server line can be used if the TFTP server is not the same as the BOOTP server. Replace the hardware MAC address by the real address of your board; set its IP address (I'm using a fixed one as an example).
The filename is formatted to allow tftpnaive to know the loading address and the starting address of the code to be downloaded. The filename should be formatted this way :
name.download-address.start-address-offset.ext
name
and ext
can be anything, the number are in hexadecimal without a leading 0x. In the example above, the download address is 0x10000
and the code will jump to the same address after successfull download. This is to download and run a uClinux kernel image on my board but any code can be downloaded and run. With a filename like 'de2.200000.400.bin
' the download address will be 0x200000
and the start address will be 0x200400
. The filename should not be longer than 127 characters.
Setting up a TFTP server
The TFTP server is the server which handle the download. It can be the same as the BOOTP server. You will have to install a tftpserver package on your machine and place the binary image to be downloaded into the directory used by TFTP. It may be /tftpboot or /boot.
Synopsis
The code starts by initializing the network card, if there is a fatal error (other than network cable problem) the code will exit. If it is a cable problem, the code will infinitely loop, trying each seconds to initialize the network chip.
The code will then broadcast a BOOTP request and wait for a reply. Without reply, it will wait 1 second then 2, 4 and 8 seconds and start over.
The reply will permit the code to get its IP address, the server's IP address and the filename to download. The code will check first if there is no IP conflict so it can actually use the given IP address.
Then a TFTP get will be issued, if there is an acknowledgement reply, the TFTP get will continue and a jump to the start-address will be issued at the successfull end of the download. There will be 5 tries to download the file; after that, the code will start over with a new BOOTP request.
The code will infinitely loop on the BOOTP requests if the download can not be done without error.
The code answer to ping (ICMP) requests as soon as it has a valid IP address from a BOOTP reply.
Changes / Bugs
If you modify this code, I will be more than happy to receive your comments and changes. My email address is in the README file and on the top level page of this web site. The BOOTP and TFTP source code should be stable now, but you might want to modify or add a new network adapter, or to adapt the source code to another platform. The main idea here is: keep it simple.
Change history
Version 1.3.3 - 2004-03-21
- optimizations : the previous version was able to download at 50kB/s, this new version does 210kB/s (on the DragonEngine : 68VZ328 @ 33MHz), do not activate the CRC memory check if you want this speed.
- re-ordered the packet processing code to give priority to TFTP packets so that ping request are responded only if there is no TFTP packet waiting to be processed.
Version 1.3.2 - 2003-10-30
- added an option to check the memory written using a crc, this is slowing down the transfert a lot, activate only for debugging a download issue.
- reworked the Makefiles
- added a flash.ld linker script for the DragonEngine (see Makefile)
Version 1.3.1 - 2002-10-30
- make use of the stdarg version of printf to improve portability
- bug fixes: fixed a bug which caused the BOOTP reply from some DHCP/BOOTP servers to be ignored. If you tried tftpnaive before and it did not work, you should try again with this version.
Version 1.3 - 2002-08-31
- reorganize source code with libraries to simplify code reuse.
- added the request of the time of the day to the bootp server through ICMP
- now displays ICMP error message
- shutdown of the network interface before starting the downloaded binary
- added HW address check on BOOTP reply packet
- set 100 for the BOOTP request 'sec' field
- longer delay to allow 100Mb/s -> 10Mb/s negociation
Version 1.2.1 - 2002-07-30
- added tftpget function in the de2 library
- bug fixes: fixed a bug in the UDP checksum computation on small packets
Version 1.2 - 2002-05-01
- added a delay on cable error message to allow the 100Mb/s -> 10Mb/s negociation to run silently.
- TFTP: resending the ACK packet when receiving again the previous data block
- added start and stack address vector at the start of the text segment for ucdimm
- added IRQ 5 polarity setup for ucdimm
- bug fixes: wrong TFTP request packet length fixed
- bug fixes: endianness problem on the MAC address display
Version 1.1 - 2002-03-07
- added the UDP checksum calculation, needed by some firewalls to handle the BOOTP and TFTP packets.
- added a packet receive counter, useful to check if the ISR gets called
- source reorganization to create subdirs for the de2 and uCdimm boards
- added hardware swap handling for the uCdimm board (not tested yet)
- added all the necessary source code to resolve any specific dependencies (on libc)
- removed the _inbyte call to suppress a dependency
- bug fixes: CSB initialization for the de2 board
- bug fixes: 'Don't fragment' IP packet flag bug (packets with DF flag set were silently discarded)
- bug fixes: BOOTP reply code to check for IP conflicts (the check was not working)
- bug fixes: UDP packet length bug (wrong length was sent)
Version 1.0 - 2002-02-21
initial release
There is a m68k-elf-gcc toolchain available from DarwinPortsbased on gcc3.4.3 but unfortunately, it doesn't contain the Coldfirepatches and other goodies that are needed to work well with uClinux and surprisingly, all the available toolchains for OS X seem to be somewhat unavailable for download!
Myvarious attempts to build this cross compiler ended up saving the dayat a recent Internet Exchange Research workshop. We didn't have acompiler for our Sparc servers, they didn't have any CD-ROM drives, andthe Internet connection was too slow. Fortunately, I had everythingneeded on my PowerBook (I'm a packrat like few others) and I was ableto build a Sparc cross-compiler hosted on Darwin PPC.
Thatbit of success gave me a much needed shot in the arm to finish up thebuild of the Coldfire cross-compiler. It took almost 24 hours to buildit (including the various stops and rebuilds needed to make it compilecleanly), clearly not a job for the faint hearted, or those who give upeasily.
DOWNLOADS
You can get binaries of the toolchain for Mac OS X 10.4.4(PowerPC) from (the links below don't work since I haven't uploaded thefiles. I'm looking for a place to host them since I have a bandwidthlimit)
I'm looking for a better place to host these files. Ideas?
GETTING SOURCES
You'll need Bernardo Innocenti's sources.
It'sprobably wise to choose the most recent version of his sources, andhope for the best. Stick to the exact version of each source required(e.g. gcc 3.4.0 != gcc 3.4.3). I tried 3.4.3 but it crashed inside xgccdue to my incompetence at patching the sources.
BUILDING YOUR OWN
Yourexperience may differ from mine. What I do know is that building thistakes quite some time and you won't enjoy doing it again and again tofix problems (unless that's your sort of fun!)
Before building, install DarwinPorts and
Startthe build process by editing the build-uclinux-tools.sh script as peryour needs. I used Apple gcc 3.3 with the following settings inbuild-uclinux-tools.sh â¦
After setting up the build-uclinux-tools.sh script and downloading the necessary additional files and patches, you can do
and each time you encounter an error (and hopefully fix what's causing it) you can do
BUILD ERRORS (AND SOLUTIONS)
You'regoing to run into various errors during the build. These steps documenthow I managed to get past them. There are probably mistakes in them, orat least better ways to do them. Suggestions and improvements are mostwelcome. It should be easy to make this into a patch. Maybe I'll dothat the next time around, but it took so long to build that I wouldn'thold my breath for it.
Configuring the uClinux kernel
You'll receive a message saying
You should edit linux-2.4.x/Makefile and change all occurrences of expr to gexpr â¦
Building elf2flt-20040326
You'll get an error saying ãelf.h not foundã (it's not present on Darwin systems)
Edit elf2flt-20040326/elf.h and uncomment the #include line
During linking, you'll get an error saying crt0.a not found. Edit Makefile.in, change
to
And that should take care of it for you. Continue building via
Building m68k-bdm-1.3.0
This will fail because BDMhardware access hasn't been written for Darwin yet. The ioperm systemcall is missing, and there's no native driver, so editbuild-uclinux.tools.sh and in the stageA function, replace thefollowing lines
with the lines below
i.e. addâdisable-ioperm andâdisable-driver to the configure stanza.
M68k-elf-gcc Mac Download Windows 10
Building m68k-bdm-1.3.0
Thiswill fail again since its trying to build a static executable.Apparently, that's a no-no on Darwin. Edit Makefile.in and Makefile.amin the utils directory and remove the static lurking as below:
should be changed to
You should be still able to connect to a remote server that's running BDM.Since I'm running on a Powerbook, which doesn't even have a parallelport, it's not a big deal to not build the hardware interface bits of BDM. Your mileage may vary. You should be able to continue your build now.
M68k-elf-gcc Mac Download Torrent
Building gdb-6.1
You will receive an error due to an incorrect gdb.texinfo file. Editgdb-6.1/gdb/doc/gdb.texinfo and around line 6961 (or whatever makeinfo complained about) and change
to become
Afterthis, you should have a successful build. All the tools will beinstalled on your system by Bernardo's excellent build script.