#!/bin/sh
# this script does the tedious job of setting serial port speeds and 
# uploading files. The sleeps allow blob to keep up without screen corruption
# on serial speed changes.


echo You want $1

if ! test -e $1; then
        echo RAMDisk $1 not found
        exit;
fi


PORT=/dev/ttyS0
RAMDISK=$1

echo Starting ramdisk upload
stty 1:0:cbd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 < $PORT
sleep 1
echo "download ramdisk" > $PORT
sleep 1
stty 1:0:1cb2:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 < $PORT
dd if=$RAMDISK > $PORT
sleep 1
stty 1:0:cbd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 < $PORT
echo -e "\r" > $PORT

