spinit_em 887 Bytes
#! /bin/sh

LD_LIBRARY_PATH=.
export LD_LIBRARY_PATH

SHMKEY=$$
#echo shmkey is $SHMKEY

$ROOT/usr/etc/driverd -v &
DRIVERD_PID=$!
#echo driverd pid is $DRIVERD_PID

if [ $# -ne 0 ]
then
    $ROOT/usr/sbin/emulate -a "$*" -k $SHMKEY spin_em rom_em  &
else
    $ROOT/usr/sbin/emulate -k $SHMKEY spin_em rom_em  &
fi

EMULATE_PID=$!
#echo emulate pid is $EMULATE_PID

$ROOT/usr/tv/bin/dbgif -kcdbr -e $EMULATE_PID &

DBGIF_PID=$!
echo dbgif pid is $DBGIF_PID

trap "killall emulate fineGrain; kill -9 $DRIVERD_PID $DBGIF_PID; ipcrm -M $$; exit" 1 2 3 15

#echo start fineGrain
#echo emulate pid is $EMULATE_PID dbgif pid is $DBGIF_PID

# fineGrain dso key pid_of_emulate
cd ui
fineGrain ../spintcl_em.so $$ $EMULATE_PID ../spintcl_em.so

echo "killing driverd, emulate and dbgif $DRIVERD_PID $EMULATE_PID $DBGIF_PID"
kill -2 $EMULATE_PID
kill -9 $DRIVERD_PID $DBGIF_PID
ipcrm -M $$
exit 0