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.
-Gene

-----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:

cd
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

binutils-2.9.5.0.24.tar.gz
binutils-2.9.5.0.24-rtems-20000207.diff.gz
c_build_scripts-4.5.0-beta2.tgz
gcc-2.95.2.tar.gz
gcc-2.95.2-rtems-20000106.diff.gz
gdb-4.18.tar.gz
gdb-4.18-rtems-20000126.diff.gz
newlib-1.8.2.tar.gz
newlib-1.8.2-rtems-20000131.diff.gz

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

hello_world_c.tgz
netdemos-4.5.0-beta2.tgz
rtems-4.5.0-beta2.tgz

cd ../tools
tar xzf ../archive/c_build_scripts-4.5.0-beta2.tgz
tar xzf ../archive/binutils-2.9.5.0.24.tar.gz
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-2.9.5.0.24
zcat ../../archive/binutils-2.9.5.0.24-rtems-20000207.diff.gz | patch
-p1
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:

BINUTILS=binutils-2.9.5.0.24
GCC=gcc-2.95.2
NEWLIB=newlib-1.8.2
GDB=gdb-4.18
BUILD_DOCS=yes
BUILD_OTHER_LANGUAGES=no
INSTALL_POINT=~/rtems-4.5.0-beta2/install
RTEMS=rtems-4.5.0-beta2

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-2.9.5.0.24

--------------------------------------------------------------
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
make

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
ftp://ftp.rtems.com/pub/rtems/betas/rtems-4.5.0-beta/contrib/pc386_grub_imag
e/README
and
ftp://ftp.rtems.com/pub/rtems/betas/rtems-4.5.0-beta/contrib/pc386_grub_imag
e/grub144.gz
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:

#undef RTEMS_BSP_NETWORK_DRIVER_NAME
#undef RTEMS_BSP_NETWORK_DRIVER_ATTACH
#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
zero.

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:
${PGM}: $(OBJS) #$(LINK_FILES)
**********************************************************

make
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

Matt



More information about the users mailing list