Line 1... |
Line 1... |
This is uClinux for or32.
|
This is uClinux for or32.
|
|
|
To build type:
|
# To build toochain follow these steps
|
set to 1 MC_INIT define in include/asm-or1k/board.h if you are using memory controller
|
|
|
|
|
mkdir /tmp/tools
|
|
cd /tmp/tools
|
|
mkdir or32-uclinux
|
|
export PATH=/tmp/tools/or32-uclinux/bin:$PATH
|
|
|
|
#
|
|
# Binutils:
|
|
#
|
|
|
|
cvs -z9 co or1k/binutils
|
|
cd or1k
|
|
mkdir binutils-ucl
|
|
cd binutils-ucl
|
|
../binutils/configure --target=or32-uclinux --prefix=/tmp/tools/or32-uclinux
|
|
make all install
|
|
cd ../../
|
|
|
|
#
|
|
# Gcc
|
|
#
|
|
|
|
cvs -z9 co or1k/gcc-3.1
|
|
cd or1k
|
|
mkdir gcc-ucl
|
|
cd gcc-ucl
|
|
../gcc-3.1/configure --target=or32-uclinux --prefix=/tmp/tools/or32-uclinux/ --local-prefix=/tmp/tools/or32-uclinux/or32-uclinux/ --with-gnu-as --with-gnu-ld --verbose --enable-languages=c
|
|
make all install
|
|
cd ../../
|
|
|
|
#
|
|
# uClibc
|
|
#
|
|
|
|
cvs -z9 co or1k/uclibc
|
|
cd or1k/uclibc
|
|
ls -s ./extra/Configs/Config.cross.or32.uclinux Config
|
|
# Edit Config file:
|
|
# TARGET_ARCH=or32
|
|
# CROSS = $(TARGET_ARCH)-uclinux-
|
|
# KERNEL_SOURCE=/tmp/tools/or1k/uclinux/uClinux-2.0.x/
|
|
# DEVEL_PREFIX = /tmp/tools/$(TARGET_ARCH)-uclinux
|
|
make all install
|
|
cd ../../or32-uclinux/bin
|
|
rm -f addr2line ar as cc cpp gasp gcc ld nm objcopy objdump ranlib size strings strip jar grepjar
|
|
cd ../../
|
|
|
|
#
|
|
# Rebuild Gcc
|
|
#
|
|
cd or1k/gcc-ucl
|
|
../gcc-3.1/configure --target=or32-uclinux --prefix=/tmp/tools/or32-uclinux/ --local-prefix=/tmp/tools/or32-uclinux/or32-uclinux/ --with-gnu-as --with-gnu-ld --verbose --enable-languages=c,c++
|
|
make all install
|
|
cd ../../
|
|
|
|
#
|
|
# Applications
|
|
#
|
|
cvs -z9 co or1k/uclinux/userland/sash
|
|
cvs -z9 co or1k/uclinux/userland/init
|
|
cvs -z9 co or1k/uclinux/userland/route
|
|
cvs -z9 co or1k/uclinux/userland/ping
|
|
cd or1k/uclinux/userland/sash
|
|
make
|
|
cd ../init
|
|
make
|
|
cd ../route
|
|
make
|
|
cd ../ping
|
|
make
|
|
cd ../../../../
|
|
|
|
#
|
|
# Generating romfs ramdisk image
|
|
#
|
|
mkdir romfs
|
|
mkdir romfs/bin
|
|
cp or1k/uclinux/userland/init/init romfs/bin/
|
|
cp or1k/uclinux/userland/sash/sh romfs/bin/
|
|
cp or1k/uclinux/userland/route/ifconfig romfs/bin/
|
|
cp or1k/uclinux/userland/route/route romfs/bin/
|
|
cp or1k/uclinux/userland/ping/ping romfs/bin/
|
|
chmod 777 romfs/bin/*
|
|
mkdir romfs/etc
|
|
cp or1k/uclinux/userland/init/rc romfs/etc/
|
|
mkdir romfs/dev
|
|
cd romfs/dev
|
|
mknod ram0 1 0
|
|
mknod tty 4 0
|
|
mknod tty1 4 1
|
|
mknod ttyS0 4 64
|
|
cd ..
|
|
genromfs -f ../or1k/uclinux/uClinux-2.0.x/arch/or32/board/initrd
|
|
cd ..
|
|
|
|
#
|
|
# Generating ext2 ramdisk image
|
|
#
|
|
mkdir ext2fs
|
|
mke2fs -m0 -r0 -O none /dev/ram0 512
|
|
mount /dve/ram0/ ext2fs
|
|
mkdir ext2fs/bin
|
|
cp or1k/uclinux/userland/init/init ext2fs/bin/
|
|
cp or1k/uclinux/userland/sash/sh ext2fs/bin/
|
|
cp or1k/uclinux/userland/route/ifconfig ext2fs/bin/
|
|
cp or1k/uclinux/userland/route/route ext2fs/bin/
|
|
cp or1k/uclinux/userland/ping/ping ext2fs/bin/
|
|
chmod 777 ext2fs/bin/*
|
|
mkdir ext2fs/etc
|
|
cp or1k/uclinux/userland/init/rc ext2fs/etc/
|
|
mkdir ext2fs/dev
|
|
cd ext2fs/dev
|
|
mknod ram0 1 0
|
|
mknod tty 4 0
|
|
mknod tty1 4 1
|
|
mknod ttyS0 4 64
|
|
cd ../../
|
|
umount ext2fs
|
|
dd if=/dev/ram0 of=or1k/uclinux/uClinux-2.0.x/arch/or32/board/initrd
|
|
|
|
#
|
|
# Building uClinux
|
|
#
|
|
|
|
cvs -z9 co or1k/uclinux/uClinux-2.0.x/
|
|
cd or1k/uclinux/uClinux-2.0.x/
|
|
# Edit arch/or32/Roules.mk file:
|
|
# LIBGCC = /tmp/tools/or32-uclinux/lib/gcc-lib/or32-uclinux/3.1/libgcc.a
|
|
cd or1k/uclinux/uClinux-2.0.x/
|
make oldconfig
|
make oldconfig
|
make dep
|
make dep
|
make linux.bin
|
make
|
|
cd ../../../
|
|
|
To make ext2 fs image:
|
#
|
|
# Build or32 simulator
|
mke2fs -m0 -r0 -O none /dev/ram0 64
|
#
|
mount /dve/ram0/ /initrd
|
|
cp ... /initrd
|
cvs -z9 co or1k/or1ksim
|
mknod fb c 29 0
|
cd or1k/or1ksim
|
mknod fb0 c 29 0
|
configure --target=or32-uclinux --prefix=/tmp/tools/or32-uclinux/
|
mknod ram0 b 1 0
|
make all install
|
mknod tty c 4 0
|
cd ../../
|
mknod tty0 c 4 0
|
|
mknod tty1 c 4 1
|
#
|
mknod ttyS0 c 4 64
|
# Run uClinux on simulator
|
mknod ttyS1 c 4 65
|
#
|
umount /initrd
|
cd or1k/uclinux/uClinux-2.0.x/
|
dd if=/dev/ram0 of=~/uClinux/linux/arch/or1k/board/initrd
|
# Open another two terminals in this folder. Type "less uart0.tx" with "F" option
|
|
# to monitor outoput from uart in first terminal and "cat > uart0.rx" to send
|
To make romfs image:
|
# chars to uart in the second.
|
|
or32-uclinux-sim -f sim.cfg linux
|
cd ~/delete/romfs
|
|
cp .... ./
|
|
genromfs -f ~/uClinux/linux/arch/or1k/board/initrd
|
|
or32-uclinux-sim -f sim.cfg linux
|
|