FW: procedure for building rtems-4.5.0beta2

Smith, Gene Gene.Smith at sea.siemens.com
Mon May 1 15:18:59 UTC 2000

Matt sent me this procedure that he worked up for installing the beta for a
pc386. It works for me.  Thought it might be useful to other new rtems users
out there. It also points out a few problems he found and how he fixed them.

-----Original Message-----
From: Matt Smith [mailto:mdsmith at engr.utk.edu] 
Sent: Thursday, April 27, 2000 6:03 PM
To: Smith, Gene
Subject: procedure for building rtems-4.5.0beta2

I didn't even look at the old documentation on how to do it. The
procedure seems obvious after doing 4 or 5 times :).

Note: I "install" everything to a subdir of all the rest of the stuff.
That makes it easier to use multiple versions. This goes against the
official instructions, but I think it's better. These are instructions
for building a pc386 target.

hmm, this could be a shell script:

mkdir rtems-4.5.0-beta2
cd rtems-4.5.0-beta2
mkdir archive install tools
cd archive

download from ftp.rtems.com/pub/rtems/betas/rtems-4.5.0-beta/c_tools and
put in archive


download from ftp.rtems.com/pub/rtems/betas/rtems-4.5.0-beta and put in


cd ../tools
tar xzf ../archive/c_build_scripts-4.5.0-beta2.tgz
tar xzf ../archive/binutils-
tar xzf ../archive/gcc-2.95.2.tar.gz
tar xzf ../archive/gdb-4.18.tar.gz
tar xzf ../archive/newlib-1.8.2.tar.gz
tar xzf ../archive/rtems-4.5.0-beta2.tar.gz

cd binutils-
zcat ../../archive/binutils- | patch
cd ../gcc-2.95.2
zcat ../../archive/gcc-2.95.2-rtems-20000106.diff.gz | patch -p1
cd ../gdb-4.18
zcat ../../archive/gdb-4.18-rtems-20000126.diff.gz | patch -p1
cd ../newlib-1.8.2
zcat ../../archive/newlib-1.8.2-rtems-20000131.diff.gz | patch -p1

( note that you don't have to search for .rej files because patch will
complain verbosly if a patch fails )

cd ~/rtems-4.5.0-beta2/tools
edit user.cfg so that it has these at the top:


the rest are probably ok with the default, save the file.

************this is the main fix I had to do****************
export PATH=$PATH:~/rtems-4.5.0-beta2/install/bin
even though it doesn't exist yet

this next thing is optional, I just did it so that debugging info wasn't
in the toolchain.
edit line 157 of bit to:
CFLAGS="-O2 -m486" ../${BINUTILS}/configure --target=${target} \
edit line 180 of bit to:
CFLAGS="-O2 -m486" ../${GCC}/configure --target=${target} \
edit line 196 of bit to:
     CFLAGS_ARG="-O2 -m486"

ok. now your ready to go:
./bit i386
./bit_gdb i386
./bit_rtems i386 pc386

You don't need the toolchain sources anymore:
rm -rf newlib-1.8.2
rm -rf gdb-4.18
rm -rf gcc-2.95.2
rm -rf binutils-

now, try making the latest and greatest hello_world

tar xzf ../archive/hello_world_c.tgz
cd hello_world_c
export RTEMS_MAKEFILE_PATH=~/rtems-4.5.0-beta2/install/pc386

I'm guessing that the program will be in o-optimize
cd o-optimize
now even the optimized build target has a lot of junk in it, it's
probably 844kb. Strip it.
i386-rtems-strip test.exe
That should bring it down to ~100K

Now, how to boot it..... Someone was nice enough to make a bare grub
boot floppy just for this purpose. Download
and follow those directions. I haven't tried that one, but it should
work. I used my own. (There are a few typo in the instructions, like gunzip
before copying!)

now, try making the netdemo demo:

cd ~/rtems-4.5.0-beta2/tools
tar xzf ../archive/netdemos-4.5.0-beta2.tgz
cd netdemos-4.5.0-beta2

I'm going to assume that you want to use the 3c509 driver.
edit networkconfig.h

comment out #define RTEMS_USE_BOOTP

after #include <bsp.h> add this:

#define RTEMS_BSP_NETWORK_DRIVER_NAME	"ep0"  /* don't use ep1 -- it won't
work!!! */
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH	rtems_3c509_driver_attach

comment out #define RTEMS_SET_ETHERNET_ADDRESS

change the ip addr and netmask in netdriver_config

at the end of
static struct rtems_bsdnet_ifconfig netdriver_config
comment out the 
0	/* Use default driver parameters */

and add
0,		/* ignore broadcast */
0,		/* default mtu=0 */
0,		/* rbuf_count */
0,		/* xbuf_count */
0x300,		/* base port of the board */
10,		/* irq number of board */
0,		/* memory on the board */

the default base port and irq for the 3c509 are 0x300 and 10, if you
know what they are for the specific machine you want to run it on, put
them here. I think the 3c509 driver does some sort of isa bus probing,
so I think its safe to leave everything other than the base port as

change rtems_bsdnet_config to one you know that works

*********this was another fix I had to do*****************
cd netdemo
edit Makefile line 57 so that it looks like this:

you should have something in o-optimize, if you want to fit it on a grub
floppy, you'll probably have to strip it.

That's it


More information about the users mailing list