2001-05-22 20:10:07 +04:00
|
|
|
#!/bin/sh
|
2001-11-10 06:48:22 +03:00
|
|
|
BOCHS=@prefix@/bin/bochs
|
2002-06-26 23:13:46 +04:00
|
|
|
DLXINST=@prefix@/share/bochs/dlxlinux
|
2001-11-10 06:48:22 +03:00
|
|
|
GZIP=@GZIP@
|
2001-11-10 02:56:29 +03:00
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
DLXPATH=$1
|
|
|
|
else
|
2001-12-07 08:03:53 +03:00
|
|
|
DLXPATH=$HOME/.bochsdlx
|
2001-11-10 02:56:29 +03:00
|
|
|
fi
|
2001-12-07 08:03:53 +03:00
|
|
|
CONFFILE=$HOME/.bochsdlx/bochsconf
|
2001-11-10 02:56:29 +03:00
|
|
|
|
|
|
|
makedlxdir() {
|
2001-12-07 08:03:53 +03:00
|
|
|
echo
|
|
|
|
echo ---------------------------------------------------------------
|
|
|
|
echo To run the DLX Linux demo, I need to create a directory called
|
|
|
|
echo $DLXPATH, and copy some configuration files
|
|
|
|
echo and a 10 megabyte disk image into the directory.
|
|
|
|
echo ---------------------------------------------------------------
|
|
|
|
ok='unknown'
|
|
|
|
while test $ok = 'unknown'; do
|
|
|
|
echo Is that okay? [y/n]
|
|
|
|
read j
|
|
|
|
case $j in
|
|
|
|
y*) ok=1 ;;
|
|
|
|
n*) ok=0 ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if test $ok != 1; then
|
|
|
|
echo Aborting
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
#echo DEBUG: Creating $HOME/.bochsdlx/bochsrc
|
2001-11-10 02:56:29 +03:00
|
|
|
echo DLXPATH=$DLXPATH > $CONFFILE
|
|
|
|
. $CONFFILE
|
2005-07-10 19:27:27 +04:00
|
|
|
for file in bochsrc.txt readme.txt testform.txt; do
|
2001-11-10 04:05:23 +03:00
|
|
|
if [ ! -f $DLXPATH/$file ]; then
|
2001-11-10 07:09:16 +03:00
|
|
|
echo Copying $DLXINST/$file '->' $DLXPATH/.
|
|
|
|
cp $DLXINST/$file $DLXPATH/.
|
2001-11-10 04:05:23 +03:00
|
|
|
else
|
|
|
|
echo "ERROR: $file already exists in $DLXPATH. Remove it to replace."
|
|
|
|
fi;
|
|
|
|
done
|
2001-11-10 02:56:29 +03:00
|
|
|
if [ ! -f $DLXPATH/hd10meg.img ]; then
|
2001-11-10 03:05:52 +03:00
|
|
|
echo Uncompressing $DLXINST/hd10meg.img.gz '->' $DLXPATH/hd10meg.img
|
|
|
|
$GZIP -dc $DLXINST/hd10meg.img.gz > $DLXPATH/hd10meg.img
|
2001-11-10 02:56:29 +03:00
|
|
|
else
|
2001-11-10 04:05:23 +03:00
|
|
|
echo "ERROR: hd10meg.img already exists in $DLXPATH. Remove it to replace."
|
2001-11-10 02:56:29 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2001-12-07 08:03:53 +03:00
|
|
|
echo ---------------------------------------------------------------
|
|
|
|
echo " DLX Linux Demo, for Bochs x86 Emulator"
|
|
|
|
echo ---------------------------------------------------------------
|
2001-05-22 20:10:07 +04:00
|
|
|
|
|
|
|
echo -n "Checking for bochs binary..."
|
|
|
|
if test ! -x $BOCHS; then
|
|
|
|
echo FAILED
|
|
|
|
echo ERROR: I could not find bochs in $BOCHS
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo ok
|
|
|
|
echo -n "Checking for DLX linux directory..."
|
2001-11-10 02:56:29 +03:00
|
|
|
if test ! -d $DLXINST; then
|
2001-05-22 20:10:07 +04:00
|
|
|
echo FAILED
|
|
|
|
echo ERROR: I could not find the DLX linux directory.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo ok
|
2001-11-10 03:05:52 +03:00
|
|
|
echo -n "Checking for $GZIP..."
|
2001-11-10 07:09:16 +03:00
|
|
|
$GZIP < /dev/null > /dev/null
|
2001-11-10 02:56:29 +03:00
|
|
|
if test $? = 0; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo not found
|
2001-11-10 03:05:52 +03:00
|
|
|
echo ERROR: without $GZIP in your PATH, I cannot continue.
|
2001-11-10 02:56:29 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2001-12-07 08:03:53 +03:00
|
|
|
echo -n "Checking for $HOME/.bochsdlx directory..."
|
|
|
|
if test -d "$HOME/.bochsdlx"; then
|
2001-11-10 02:56:29 +03:00
|
|
|
echo "ok"
|
|
|
|
if test -f "$CONFFILE"; then
|
|
|
|
. $CONFFILE
|
|
|
|
else
|
|
|
|
makedlxdir
|
|
|
|
fi
|
|
|
|
else
|
2001-12-07 08:03:53 +03:00
|
|
|
#echo DEBUG: Creating $HOME/.bochsdlx
|
|
|
|
mkdir -p $HOME/.bochsdlx
|
2001-11-10 02:56:29 +03:00
|
|
|
mkdir -p $DLXPATH
|
|
|
|
makedlxdir
|
|
|
|
fi
|
2001-05-22 20:10:07 +04:00
|
|
|
echo Entering $DLXPATH
|
|
|
|
cd $DLXPATH
|
2001-11-10 02:56:29 +03:00
|
|
|
|
|
|
|
# Now that we're in the DLXPATH, make sure that bochsrc.txt & hd10meg.img exist
|
|
|
|
if test ! -f bochsrc.txt; then
|
|
|
|
echo ERROR: bochsrc.txt not found
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if test ! -f hd10meg.img; then
|
|
|
|
echo ERROR: hd10meg.img not found
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2001-06-02 11:40:06 +04:00
|
|
|
echo Running bochs
|
2001-05-22 20:10:07 +04:00
|
|
|
|
|
|
|
# ok now try it
|
2002-08-27 00:39:06 +04:00
|
|
|
$BOCHS -q
|
2001-12-07 08:03:53 +03:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo ---------------------------------------------------------------
|
|
|
|
echo The DLX Linux demo is over. If you want to free up the disk
|
2008-04-06 01:28:11 +04:00
|
|
|
echo space in your account, remove the .bochsdlx directory from
|
|
|
|
echo your home directory. Example:
|
2001-12-07 08:03:53 +03:00
|
|
|
echo " rm -rf ~/.bochsdlx"
|
|
|
|
echo Please be careful with rm -rf because it can make a mess.
|
|
|
|
echo ---------------------------------------------------------------
|
|
|
|
exit 0
|