#!/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 Kernel $1 not found
	exit;
fi

PORT=/dev/ttyS0
KERNEL=$1

echo Starting Kernel 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
echo "download kernel" > $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=$KERNEL > $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

