Developer Image for STLinux

Evdok

Модератор "Octagon"
Команда форума
Оригинал - здесь

This Image (http://div-a.de/ufs910/devel/fedora-1.vmdk.zip) is made for running in
a virtual machine. This for you need VMWare player http://www.vmware.com/de/products/player/
(or another VMWare product) or Virtual Box (http://www.virtualbox.org).

Virtual machine settings if you use VMWare Player: http://div-a.de/ufs910/devel/FedoraVMWare.zip

The image contains Fedora Core Version 6.93, also STLinux development enviroment
Version 2.0. With this enviroment you can compile binarys for example st7100


Installation virtuelle Maschine
Extract the image and start the virtual machine. root Passwort is fedora. The machine
uses dhcp, login and set ipadress (ifconfig). Who have no dhcp server have to set ip
manually.

You can use ssh to connect to machine. SAMBA and NFS is automatically started.
Sharename for SAMBA is //<IPADRESSE>/devel (=/opt), under NFS /opt und /tmp also
will be shared. The needed configuration for NFS (/etc/exports /etc/hosts/allowed) is
dynamically created at boot time (dhcp and Class C-Adress needed).


Installation Client

Connect to your receiver:

create file /var/etc/special.sh
with the following content:

Code: [Select]
IP="192.168.XXX.XXX"
MPOINT="/opt/STM/STLinux-2.0/devkit/sh4/target"

echo "Mounte nfs share $MPOINT nach /mnt/nfs"
mount -t nfs $IP:/$MPOINT /mnt/nfs
192.168.XXX.XXX have to be set to ip of virtual machine. Now execute special.sh
check if development enviroment is mountet well.

example:

Code: [Select]
BusyBox v1.1.0 (2006.03.02-09:48+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/ # mount
192.168.1.75://opt/STM/STLinux-2.0/devkit/sh4/target on /mnt/nfs type nfs (rw,v3
,rsize=32768,wsize=32768,hard,udp,lock,addr=192.168.1.75)
/ #
With /mnt/nfs you can access the NFS server from the virtual machine.
There are three script.

Code: [Select]
mybackup.sh
mybash.sh
mysshd.sh
With that you can use the mountet STLinux.

Compilation
all examples for development are stored under /usr/src.

Compile - Hello STLinux
/usr/src/samples/hello/beispiel_nur_compilieren

Code: [Select]
#!/bin/bash
export CC="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-gcc"
export CXX="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-g++"
$CC -v
$CC -o hello hello.c
The compiled binary can be copied to /opt/STM/STLinux-2.0/devkit/sh4/target/AUSTAUSCH
and after that accessed by

Code: [Select]
/mnt/nfs/AUSTAUSCH # ./hello
Hello from STLinux

Compile with make file
/usr/src/samples/nano-2.0.3/beispiel_compilieren_mit_makefile

Code: [Select]
#!/bin/bash
export CC="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-gcc"
export CXX="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-g++"
$CC -v

make clean
./configure --host="sh4-linux"
make

Compile - create RPM pakage
/usr/src/redhat/beispiel_wget_rpm

Code: [Select]
#!/bin/bash
SPACK="stlinux20-target-wget-1.8.1-3.src.rpm"
SPECS="SPECS/stm-target-wget.spec"

echo install source pakage
rpm --rcfile localrc -Uhv $SPACK
echo press any key to continue
read x
echo creating RPM pakage
rpmbuild --rcfile /usr/lib/rpm/rpmrc:localrc -ba -v --target=sh4-linux $SPECS

DOCVer 0.1

all done by
klaus deiss 8.5.07
 
Сверху