[uCsimm] uClinux-2.4 plus userland for uCsimm up and running using the m68k-elf-toolchain

From: Bernhard Kuhn (kuhn@lpr.e-technik.tu-muenchen.de)
Date: Wed Mar 28 2001 - 09:25:57 EST


Hi!

I finaly managed to get some recent CVS userland
applications running on uCsimm using uClinux-2.4.x.

The basic trick was to *not* use Davidm's binary
tarball, but creating the m68-elf toolchain
from scratch using his build-m68k-elf.sh script.

I also added a script that downloads all necessary
files and builds the m68k-elf-toolchain, uClibc
and a project directory (kernel + userland)
including a functional himem-image with kernel 2.4.

Altough you can execute the script ootb, i recomend
doing it manualy step by step to see what's going on.
The script can also be downloaded:

wget -c
http://www.rcs.ei.tum.de/~kuhn/uclinux/uCsimm-2.4-280301/uClinux-2.4.x-uCsimm-2.4-install.sh

But beware! This script downloads ~50MB and the
full build takes about an hour (Athlon 800 CPU) - not
taking into account the time for the download.

IMPORTANT: you will have to alter lines two and three
(project directory and owner) of the script according
to your needs!!

ATTENTION: the script will change /opt/uClinux/dev/console
from major-4-minor-0 to major-5-minor-1. keep that into
account when switching back to 2.0.x-kernels!

After to build, you will have the following new files
and directories:

/tmp/ucsimm # download area - can be deleted
/usr/local/src/m68k-elf # building area - can be deleted
/usr/local/bin/m68k-elf-* # toolchain binaries in exec-path
/usr/local/m68k-elf # gcc related
/usr/local/lib/gcc-lib/m68k-elf # gcc related
$PRJPATH # newly created ucsimm project

Bugs/TODO/Limitations:
======================

* The network interface (uCcs8900.c) doesn't work
* several userland applications (mount, ifconfig)
  didn't compile, because of clashes in the include
  files: it seems that going from 2.0 to 2.4
  isn't that easy.
* After booting, you can type some commands,
  but after a while, you can't see anymore what
  you have typed, but you can still see the results
  of each command.
* agetty doesn't seem to work properly. So you will
  currently find yourself dropped into a shell after
  booting

Kernel changes:
===============

In addition to the patches announced in my
recent mail, i got rid of the annoying
"kmem_create" messages during boot.
But i am not sure if the way i have done
it was realy the good one:

In file mmnommu/slab.c, i had to change
#define BYTES_PER_WORD sizeof(void *)

into
#define BYTES_PER_WORD sizeof(short)

But i am not sure if that doen't has negative
effects on cache/memory alignements.

uCsimm-2.4 Building Script:
===========================

# define project path and owner
PRJPATH=/home/kuhn/devel/uclinux/projects/uCsimm-2.4
PRJOWNER=kuhn.kuhn

# temporary directories
DLDIR=/tmp/ucsimm
SRCPATH=/usr/local/src/m68k-elf

# download everthing
mkdir $DLDIR
cd $DLDIR

DLURL=http://www.uclinux.org/pub/uClinux/m68k-elf-tools/src
wget -c $DLURL/binutils-2.10.tar.bz2
wget -c $DLURL/build-m68k-elf.sh
wget -c $DLURL/elf2flt-20010222.tgz
wget -c $DLURL/gcc-2.95.2-elfPICgot.patch
wget -c $DLURL/gcc-2.95.2.tar.bz2
wget -c $DLURL/genromfs-0.3.1.tar.bz2

DLURL=ftp://ftp.kernel.org/pub/linux/kernel/v2.4
wget -c $DLURL/linux-2.4.0.tar.bz2

DLURL=http://www.rcs.ei.tum.de/~kuhn/uclinux/uCsimm-2.4-280301
wget -c $DLURL/patch-linux-2.4.0-uClinux-2.4.x-CVS-200301.bz2
wget -c $DLURL/patch-uClinux-2.4.x-CVS-200301-uCsimm-2.4-280301.bz2
wget -c $DLURL/config-uClinux-2.4.x-uCsimm-2.4-280301
wget -c $DLURL/uClibc-CVS-200301.tar.bz2
wget -c $DLURL/patch-uClibc-CVS-200301-uCsimm-2.4-280301.bz2
wget -c $DLURL/patch-userland-CVS-200301-uCsimm-2.4-280301.bz2
wget -c $DLURL/deftemplate.sh-userland-CVS-200301-uCsimm-2.4-280301
wget -c $DLURL/userland-CVS-200301.tar.bz2

# create and prepare compiling directory
mkdir $SRCPATH
cd $SRCPATH
cp $DLDIR/binutils-2.10.tar.bz2 .
cp $DLDIR/build-m68k-elf.sh .
cp $DLDIR/elf2flt-20010222.tgz .
cp $DLDIR/gcc-2.95.2-elfPICgot.patch .
cp $DLDIR/gcc-2.95.2.tar.bz2 .
cp $DLDIR/genromfs-0.3.1.tar.bz2 .
cat << EOF | patch build-m68k-elf.sh
48c48
< KERNEL="\$BASEDIR/uClinux-2.0.x"

---
> KERNEL="\$BASEDIR/uClinux-2.4.x"
EOF

# unpack and prepare kernel cd $SRCPATH tar -xIf $DLDIR/linux-2.4.0.tar.bz2 mv linux uClinux-2.4.x cd uClinux-2.4.x bunzip2 -cd $DLDIR/patch-linux-2.4.0-uClinux-2.4.x-CVS-200301.bz2 | patch -p1 bunzip2 -cd $DLDIR/patch-uClinux-2.4.x-CVS-200301-uCsimm-2.4-280301.bz2 | patch -p1 cp $DLDIR/config-uClinux-2.4.x-uCsimm-2.4-280301 .config make oldconfig

# unpack and prepare uClibc cd $SRCPATH tar -xIf $DLDIR/uClibc-CVS-200301.tar.bz2 cd uClibc bunzip2 -cd $DLDIR/patch-uClibc-CVS-200301-uCsimm-2.4-280301.bz2 | patch -p1 cd sysdeps/linux/m68k/bits ln -s ../../../../uClibc_config.h

# create the beast: cd $SRCPATH sh build-m68k-elf.sh build # this takes a while sh build-m68k-elf.sh uclibc # this takes a while, too

# prepare project directory mkdir $PRJPATH cd $PRJPATH buildenv make cp $DLDIR/deftemplate.sh-userland-CVS-200301-uCsimm-2.4-280301 deftemplate.sh chmod u+x deftemplate.sh

# switch to kernel 2.4 cd $PRJPATH rm linux cp -vax $SRCPATH/uClinux-2.4.x linux cd linux make clean && make dep && make linux.bin

# switch to new userland cd $PRJPATH rm -rf src tar -xIf $DLDIR/userland-CVS-200301.tar.bz2 mv userland src cd src bunzip2 -cd $DLDIR/patch-userland-CVS-200301-uCsimm-2.4-280301.bz2 | patch -p1 mkdir bin

# don't forget to change console cd /opt/uClinux/dev rm console mknod console c 5 1

# create himem image cd $PRJPATH make

# finaly change ownerchip of project directory chown -R $PRJOWNER $PRJPATH

# remove temporary directories, if desired # rm -rf $DLDIR # rm -rf $SRCPATH

Kernel boot screen dump =======================

For those who are interessted, i have attached a screen dump of the booted kernel. You can also download a functional image at

wget -c http://www.rcs.ei.tum.de/~kuhn/uclinux/uCsimm-2.4-280301/image.bin

Please note that this image has to be loaded with himemloader (see my recent mails) using a "himem-enhanced" kernel.

# himemloader /devel/projects/uCsimm-2.4/image.bin Loading file [/devel/projects/uCsimm-2.4/image.bin] | ABCDEF Linux version 2.4.0.0pre0 (root@bee.muenchen.de) (gcc version 2.95.2 19991024 (release)) #1 Mit Mär 28 15:48:51 CEST 2001

68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc uCsimm serial string [980885297-01b15] uCsimm hwaddr 00:50:c2:03:6b:15

uClinux/MC68EZ328 Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne On node 0 totalpages: 1536 zone(0): 0 pages. zone(1): 1536 pages. zone(2): 0 pages. Kernel command line: Calibrating delay loop... 1.39 BogoMIPS Memory available: 5580k/6016k RAM, 0k/0k ROM (500k kernel code, 318k data) Dentry-cache hash table entries: 1024 (order: 1, 8192 bytes) Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 512 (order: 0, 4096 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize Starting kswapd v1.8 Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: 6AD6D8-7502D7 [VIRTUAL 6AD6D8-7502D7] (RO) MC68328 serial driver version 1.00 ttyS0 at 0xfffff900 (irq = 64) is a builtin MC68328 UART PPP generic driver version 2.4.1 NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (romfs filesystem) readonly. # ls bin dev etc htdocs lib proc ramfs.img sbin tmp usr var # df Total bytes: 666624 Free bytes: 0 Total nodes: 0 Free nodes: 0

have fun!

Bernhard This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:42 EST