#!/bin/sh
# $Header: /usr/X/MakeCard,v 3.5 1994/03/07 03:47:46 Zwaska Exp $
# MakeCard - An database record generator
#trap cleanup 1 2 3 15

# Bail out if we're in X already!
if [ ! -z "$WINDOWID" ]
then
	echo "
	This program can not be run in the X environment...
	Please EXIT the X server and run this program in character mode.
"
	exit
fi

if [ -z "$XWINHOME" ]	# It may already be set
then
	XWINHOME=/usr/X386;export XWINHOME
fi

# Use this by default, else assume the current directory
if [ -d $XWINHOME/lib/X11/ConfigXF86 ]
then
	CONFIGDIR=$XWINHOME/lib/X11/ConfigXF86
else
	CONFIGDIR=`pwd`
fi
export CONFIGDIR

PATH=$CONFIGDIR:$PATH:$XWINHOME:$XWINHOME/bin; export PATH
DATADIR=$CONFIGDIR/DATAFILES
XINITRC=$DATADIR/xinitrc.test;export XINITRC

if [ ! -d $DATADIR ]
then
	echo "
	Cannot locate the ConfigXF86 data directory.  Either install
	ConfigXF86 in $XWINHOME, or run ConfigXF86 from the directory
	where it is installed.
"
	exit
fi


cleanup() {
TMP=/tmp ; export TMP
rm -f $TMP/$$.*
exit 0
}
# The following little ditty was contributed by Charlie Brady
# <charlieb@tplrd.tpl.oz.au>
# so that solaris and other SVR4 w/o BSD support wouldn't barf on 'echo -n':
case `echo -n x` in
-n*)    minus_n=
        slosh_c='\c' ;;
*)      minus_n='-n'
        slosh_c=
esac

# Database structures:
# Graphics Card file (Cards.dat)
#----------------------------------------------------------------------------
# Field Name      Data Type (*=Req'd)     Purpose
# -----------------------------------------------------------------------------
# CardID          integer, unique*        Reserved for future use <as a pointer
#                 Auto assigned           to a record of another file>
# 
# CardName        string <= 40 Char*      Manufacturers product name
# CardDesc        string <= 40 Char       Furthur description of card
# 
# Contributor     string unlimited        Colon separated Contributor list
# LastEdit        string                  Date of last edit
# 
# ChipSet         string <= 20 Char*      Chipset name as reported by SuperProbe
# ClockChip       string <= 20 Char       If known else 0
# ClockProg       string <= 20 Char       If any else 0
# RamDac          string <= 20 Char       RamDac as reported by SuperProbe
# ClockRates      string unlimited*       Dot clock list (space separated)
#                                         or programable clock command as
#                                         described in Xconfig(4)
# 
# The following fields are used to produce a default Xconfig file for the users
# graphics card if no monitor is chosen from the menu.
# 
# These fields are a 'best match' of the ClockRates field against Dave Wex's
# Vesa Monitor spec. ( see Monitor file specification ). If a Vmode field is 0,
# that mode will be left off of the 'Modes' line. At least one mode MUST be
# defined so that there is a fallback for wierd cards.
# 
# Vmode64         integer                 Vesa compatible 640 x 480 clock rate
# Vmode86         integer                 Vesa compatible 800 x 600 clock rate
# Vmode107i       integer                 Vesa compatible 1024 x 768 clock rate
# Vmode107        integer                 Vesa compatible 1024 x 768 clock rate
# Vmode121i       integer                 Vesa compatible 1280 x 1024 clock rate
# Vmode121        integer                 Vesa compatible 1280 x 1024 clock rate
# 
# The rest of the fields are optional and may be set to zero
# 
# Options         string unlimited        Colon separated option list
# VideoRam        integer                 In K bytes (0 if unknown)
# BiosBase        hex (format=9x99999)    If known
# ViewPort        string (format=x0 y0)   Blank=x0 y0
# Virtual         string (format=xdim ydim) Blank=Current Mode
# SpeedUp         integer [0|1]           If 0 this option is set to nospeedup 
# Driver	  string		  i.e. accel, vga256, vga16 etc.
# Server	  string		  Server to run (i.e. XF86_Mach8 etc.)
#  

#----------------------------------------------------------------------------

saveit() {
        filename=`echo $CardName|sed 's/[       ][      ]*/_/g'\
                |sed 's:/:-:g'|sed 's/#/No/g'\
                |sed "s/[&(),\.:;{}@\[\]!~\^\*\\]*//g"\
                |sed "s/[&(),\.:;{}@\[\]!~\^\*\\]*//g"\
                |sed "s/(//g"|sed "s/)//g"|sed "s/,//g"`
        n=0
        while [ 1 ]
        do
                if [ ! -f "$CONFIGDIR/DATAFILES/$filename".CRD ]
                then
                        break
                else
                        n=`expr $n + 1`
                        filename="$filename""$n"
                fi
        done
	echo "Press [Enter] to save to "$CONFIGDIR/DATAFILES/$filename".CRD..."
	read xx

	echo "$CardID|$CardName|$CardDesc|$Contributor|$LastEdit|$ChipSet|$ClockChip|$ClockProg|$RamDac|$ClockRates|$Vmode64|$Vmode86|$Vmode107i|$Vmode107|$Vmode121i|$Vmode121|$Options|$VideoRam|$BiosBase|$ViewPort|$Virtual|$SpeedUp|$Driver|$Server">$CONFIGDIR/DATAFILES/$filename.CRD
	echo "Adding Record to Database..."
	sleep 2
	cut -f1 -d"|" $CONFIGDIR/DATAFILES/Cards.dat >$TMP/$$.n
	CID=`wc $TMP/$$.n|awk '{print $1}'`
	CardID=`expr $CID + 1`
	echo "$CardID|$CardName|$CardDesc|$Contributor|$LastEdit|$ChipSet|$ClockChip|$ClockProg|$RamDac|$ClockRates|$Vmode64|$Vmode86|$Vmode107i|$Vmode107|$Vmode121i|$Vmode121|$Options|$VideoRam|$BiosBase|$ViewPort|$Virtual|$SpeedUp|$Driver|$Server">>$CONFIGDIR/DATAFILES/Cards.dat
}

sample() {
MyRecord='0|ATI 8514/Ultra|Should also work for ATI graphics Ultra|Steve Zwaska [stz@netcom.com]|12/31/93|Mach8|0|0|0|43.00 48.80 0.00 36.00 50.30 56.70 0.00 44.90 30.20 32.00 37.50 39.00 40.00 89.30 75.50 65.00 21.50 24.40 0.00 18.00 25.15 28.35 0.00 22.45 15.10 16.00 18.75 19.50 20.00 44.65 37.75 32.50|25|40|44|65|0|0|0|1024|0|0 0|1024 768|0|accel|XF86_Mach8'

echo "$MyRecord">$TMP/$$.jk # for testing

echo "$CardID|$CardName|$CardDesc|$Contributor|$LastEdit|$ChipSet|$ClockChip|$ClockProg|$RamDac|$ClockRates|$Vmode64|$Vmode86|$Vmode107i|$Vmode107|$Vmode121i|$Vmode121|$Options|$VideoRam|$BiosBase|$ViewPort|$Virtual|$SpeedUp|$Driver|$Server">$TMP/$$.sv

read CardID CardName CardDesc Contributor LastEdit ChipSet ClockChip ClockProg RamDac ClockRates Vmode64 Vmode86 Vmode107i Vmode107 Vmode121i Vmode121 Options VideoRam BiosBase ViewPort Virtual SpeedUp Driver Server<$TMP/$$.jk

LastEdit=`date '+%m-%d-%y'`
redraw
echo $minus_n "Press [Enter] to return: $slosh_c"
read z
read CardID CardName CardDesc Contributor LastEdit ChipSet ClockChip ClockProg RamDac ClockRates Vmode64 Vmode86 Vmode107i Vmode107 Vmode121i Vmode121 Options VideoRam BiosBase ViewPort Virtual SpeedUp Driver Server<$TMP/$$.sv
rm $TMP/$$.sv $TMP/$$.jk

}
redraw() {
clear
echo "		 Graphics Card Description	CardID [$CardID]
-------------------------------------------------------------------------------
	CardName    [$CardName]
	CardDesc    [$CardDesc]
	Contributor [$Contributor]  LastEdit [$LastEdit]

ChipSet   [$ChipSet]	ClockChip [$ClockChip]	Server [$Server] (ie XF86_SVGA)
ClockProg [$ClockProg]	RamDac    [$RamDac]     Driver [$Driver] (ie vga256)

ClockRates [$ClockRates]

Vesa Fallbacks - At least ONE MUST be defined!
Vmode64	 [$Vmode64]	Vmode86   [$Vmode86]	Vmode107i [$Vmode107i]
Vmode107 [$Vmode107]	Vmode121i [$Vmode121i]	Vmode121  [$Vmode121]

Options  [$Options]
VideoRam [$VideoRam]	BiosBase [$BiosBase]	ViewPort [$ViewPort]
Virtual  [$Virtual]	SpeedUp  [$SpeedUp]
-------------------------------------------------------------------------------"
}


find_server() {
grep -i $ChipSet $DATADIR/AccelChips >/dev/null 2>&1
if [ $? -eq 0 ]
then
	Driver=accel
else
	grep -i $ChipSet $DATADIR/SvgaChips >/dev/null 2>&1
	if [ $? -eq 0 ]
	then
		Driver=vga256
	else
		Driver="WARNING: Can't find ChipSet in $DATADIR/AccelChips or $DATADIR/SvgaChips"
	fi
fi
}



getline() {	# Usage getline <line_num> <filename>
	L=0
	while read TXT
	do
		L=`expr $L + 1`
		if [ $L -eq $1 ]
		then
			echo $TXT
			break
		fi
	done<$2
}

get_mouse_tty() { # Prompt the user for their mouse tty port
	while [ 1 ]
	do
		echo $minus_n "What tty port does your mouse use? (ie /dev/tty01 etc.): $slosh_c"
		read MS_Tty
		if [ -z "$MS_Tty" ]
		then
			continue
		fi
		if [ ! -c "$MS_Tty" ] # Yeah?... Let's just see!
		then
			echo "$MS_Tty is not a character special device, Please try again. "
			continue
		else
			MS_Tty=`echo $MS_Tty|sed "s/\//\\\//g"`
			echo $MS_Tty
			break
		fi
	done
}

setup_mouse() {	# Setup the mouse section of the Xconfig file
XQUEUE=" "
MouseType=" "
MS_Baud=" "

while [ 1 ]
do
	clear
	echo $minus_n "
	
		Select your mouse type:
	
		1)	xqueue		(Use this for SVR4 or SVR4.2)
        	2)	busmouse	(Use this for ANY bus mouse)
        	3)	logitech	(Logitech serial mouse only)
        	4)	microsoft	(Serial mouse only)
        	5)	mmseries
        	6)	mouseman	(Serial mouse only)
        	7)	mousesystems	(Serial mouse only)
        	8)	ps/2
                9)      mmhittab        (Hitachi in MM mode)
		
		>$slosh_c"
	read MouseType
	if [ -z "$MouseType" ]
	then
		continue
	fi
	case $MouseType in
		1) MouseType=" ";XQUEUE=Xqueue;break;;
		2) MouseType=busmouse;;
		3) get_mouse_tty;MouseType=logitech" \"$MS_Tty\"";;
		4) get_mouse_tty;MouseType=microsoft" \"$MS_Tty\"";;
		5) get_mouse_tty;MouseType=mmseries" \"$MS_Tty\"";;
		6) get_mouse_tty;MouseType=mouseman" \"$MS_Tty\"";;
		7) get_mouse_tty;MouseType=mousesystems" \"$MS_Tty\"";;
		8) get_mouse_tty;MouseType=ps/2" \"$MS_Tty\"";;
                9) GetMouseTty;MouseType=mmhittab" \"$MS_Tty\"";;
		*) continue;;
	esac
	while [ 1 ]
	do
		echo $minus_n "Enter Mouse baud rate (Valid Baud Rates are 1200, 2400, 4800 or 9600): $slosh_c"
		read MS_Baud
		if [ -z "$MS_Baud" ]
		then
			continue
		fi
		case $MS_Baud in
			1200)	MS_Baud="BaudRate 1200";;
			2400)	MS_Baud="BaudRate 2400";;
			4800)	MS_Baud="BaudRate 4800";;
			9600)	MS_Baud="BaudRate 9600";;
			*)	echo "Invalid Baud Rate (choose 1200, 2400, 4800 or 9600)";continue;;
		esac
		break
	done
	break
done
}

Sprobit() {	# Run SuperProbe to figure out which server to run for the test

	PROCID=$TMP/$$
	if [ -z "$XWINHOME" ]
	then
		echo "Please set your XWINHOME environment variable to the base X directory
	(/usr/X386 (Linux, 386BSD), /usr/X5 (Dell), /usr/X11 (SCO), /usr/X (UnixWare) )
	Then re-run this program!
	"
	cleanup
	exit
	fi
	
	if [ -f "$CONFIGDIR/.INSTALLING" ]
	then
		PROCID=`cat $CONFIGDIR/.INSTALLING`
		rm -f $CONFIGDIR/.INSTALLING
		REDO=1
	else
		echo $PROCID>$CONFIGDIR/.INSTALLING
		REDO=0
	fi
	cd $CONFIGDIR
	clear
	if [ $REDO -eq 0 -o ! -f "SuperP.log" ]
	then
		setup_mouse

		echo "Probing your hardware..."
		# Run SuperProbe to find out what kind of graphics chip we're using
		# and compare it to our lists to figure out which driver to use
		sync
		sync
		SuperProbe -noprobe Weitek 2>&1|sed 's/[ 	][ 	]*/ /g'\
			|grep Chipset|cut -f2 -d":"|sed 's/^ //'>SuperP.log
		sync
		sync
		
	fi
	lines=`wc SuperP.log|awk '{print $1}'`
	i=1
	while [ $i -le $lines ]
	do
		ii=`getline $i SuperP.log`
		grep "$ii" $DATADIR/SvgaChips >/dev/null
		SVGA=$?
		grep "$ii" $DATADIR/AccelChips>/dev/null
		Zoomer=$?
		if [ $SVGA -eq 0 ]	# Have we got a VGA card?
		then
			Server=XF86_SVGA
			Driver="vga256"
		fi
		if [ $Zoomer -eq 0 ]    # Have we got an accelerated graphics card?
		then
			Server=`grep "$ii" $DATADIR/AccelChips|cut -f2 -d":"`
			Driver="accel"
		fi
		i=`expr $i + 1`
			
	done
	clear
	echo " We'll be using the $Server Server..."
}

run_xinit() {	# Run the test to gleen info from the server
	TMP=/tmp

	Sprobit		# Figure out which server to run
	
	clear
	
	# We now know what kind of board we have... Lets figure out the Xconfig file 
	if [ $REDO -eq 0 -o ! -f xnt.log ]
	then
		echo $minus_n "
		READ THIS CAREFULLY!!!

	I'm about to start the X Server to sense your available dot clocks.
	It should return you to a character screen in a few seconds.
	If X hangs your system ( ie doesn't come back to a character screen 
	in 60 seconds), simply re-boot it and re-run this program. 
	It will automatically take up at the place it left off. 

	If the screen comes back distorted, you might be able to fix it by 
	tuning off the monitor and turning it back on.


		Press [Enter] to continue [Delete] to abort: $slosh_c"
	
		read x
	
		# Now setup a test Xconfig file
		cat $DATADIR/Xconfig.probe\
			|sed "s:@XWINHOME:$XWINHOME:"\
			|sed "s/@SERVER/$Driver/"\
			|sed "s/@XQUEUE/$XQUEUE/"\
			|sed "s:@MouseType:${MouseType}:"\
			|sed "s/@MS_Baud/$MS_Baud/"\
			>$TMP/Xconfig.probe
	
		
		# Use our test xinif file (starts and quits - thats all!)
		XINITRC=$DATADIR/xinitrc.probe;export XINITRC
	
		# Use our generic xconfig file (vesa monitor is assumed)
		XCONFIG=$TMP/Xconfig.probe;export XCONFIG
	
		clear
		# The following change came from alanh@metro.co.uk (Alan Hourihane)
		#	03/02/94 Changed:
		# xinit >xnt.log 2>&1 # Grab stdout and stderr so we can parse it later
		#		To:
		$Server -xconfig $XCONFIG -probeonly > xnt.log 2>&1
	fi
	# rm -f $CONFIGDIR/.INSTALLING $TMP/Xconfig.probe
}


probe_clocks() {
while [ 1 ]
do
        clear
        echo $minus_n "Want me to probe your hardware first? (y/n): $slosh_c"
        read zz
        if [ -z "$zz" ]
        then
                continue
        else
                break
        fi
done
case "$zz" in
	"y"|"Y")	NOPROBE=1;;
	*)		NOPROBE=0;;
esac

if [ $NOPROBE -eq 1 ]
then
	clear
	if [ ! -z "$WINDOWID" ]
	then
		echo "
Can't probe your hardware if you already have an X server running!
If you want to probe hardware for the clocks line you must exit X 
and re-run the program."
		echo "
Press [Enter] to continue"
		read j
		return
	fi
	run_xinit	# Autosense graphics card info
	# Strip the clock info out of the xinit log we just produced
	grep "detected" xnt.log >/dev/null 2>&1
	if [ $? -eq 0 ]
	then	# Accelerator stuff
		# (--) Mach8: Mach-8 detected <-Looking for this line
		ChipSet=`cat xnt.log|grep "detected"|cut -f2 -d" "|sed 's/://'|tr "A-Z" "a-z"`
		VideoRam=`grep "(mem:" xnt.log |cut -f4 -d" "|sed 's/k//'`
	else	# SVGA/VGA stuff
		ChipSet=`cat xnt.log|grep "chipset"|awk '{print $4}'|sed 's/://'|tr "A-Z" "a-z"|head -n 1`
		VideoRam=`grep "videoram:" xnt.log |awk '{print $4}'|sed 's/k//'`
	fi
	cat xnt.log|grep " clocks:" |cut -f3 -d":">$TMP/$$.c
	cat $TMP/$$.c|sed "s/$/|/"|sed 's/  */|/g'|tr "\012" "|">$TMP/$$.cks
	get_vesa_modes

	# Parse the clocks info into the clocks line file
	echo "">$TMP/$$.cks_rates
	for i in `cat $TMP/$$.cks`
	do
        	echo $minus_n "$i $slosh_c"
	done>>$TMP/$$.ckr
	echo "">>$TMP/$$.ckr    # Terminate it
	#rm $TMP/$$.cks $TMP/$$.c
	ClockRates=`cat $TMP/$$.ckr`
else 
	Sprobit
fi
}

get_vesa_modes() {

grep ': Mode "' xnt.log>$TMP/$$.smod
for i in 640x480 800x600 1024x768i 1024x768 1280x1024i 1280x1024
do
	found=`grep $i $TMP/$$.smod 2>/dev/null`
	if [ -z "$found" ]
	then 
		continue
	fi
	case $i in
		640x480)	Vmode64=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
		800x600)	Vmode86=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
		1024x768i)	Vmode107i=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
		1024x768)	Vmode107=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
		1280x1024i)	Vmode121i=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
		1280x1024)	Vmode121=`echo $found|awk -F" " '{print $8}'\
				|sed 's/\..*,//'`;;
	esac
done
}
	


see_config() {
clear
find_server
echo "
	Your Xconfig file Video Card Section will look like this:

#-------------------------------------------------------------
# Video Card Definition
# Video Card ID $CardID
# Video Card Name:      $CardName
#                       $CardDesc
# Contributed By:       $Contributor
# Last Change:          $LastEdit
"
if [ ! -z "$Driver" -a "$Driver" != "0" ] 
then
	echo "$Driver"
fi
if [ ! -z "$ChipSet" -a "$ChipSet" != "0" ]
then
	echo Chipset $ChipSet
fi
if [ ! -z "$Virtual" -a "$Virtual" != "0" ]
then
	echo Virtual $Virtual
fi
if [ ! -z "$ViewPort" -a "$ViewPort" != "0" ]
then
	echo ViewPort $ViewPort
fi
if [ ! -z "$VideoRam" -a "$VideoRam" != "0" ]
then
	echo VideoRam $VideoRam
fi

if [ ! -z "$SpeedUp" -a "$SpeedUp" != "0" ]
then
	echo SpeedUp $SpeedUp
fi
if [ ! -z "$Options" -a "$Options" != "0" ]
then
	OptionStrings=`echo $Options|tr ':' '|'`
	for i in $OptionStrings
	do
		echo Option $i
	done
fi
echo Clocks $ClockRates
echo "# VESA Compatible Modes"
echo $minus_n "Modes $slosh_c" 
if [ ! -z "$Vmode121" -a "$Vmode121" != "0" ]
then
	echo $minus_n " \"1280x1024\"$slosh_c"
fi
if [ ! -z "$Vmode121i" -a "$Vmode121i" != "0" ]
then
	echo $minus_n " \"1280x1024i\"$slosh_c"
fi
if [ ! -z "$Vmode107" -a "$Vmode107" != "0" ]
then
	echo $minus_n " \"1024x768\"$slosh_c"
fi
if [ ! -z "$Vmode107i" -a "$Vmode107i" != "0" ]
then
	echo $minus_n " \"1024x768i\"$slosh_c"
fi
if [ ! -z "$Vmode86" -a "$Vmode86" != "0" ]
then
	echo $minus_n " \"800x600\"$slosh_c"
fi
if [ ! -z "$Vmode64" -a "$Vmode64" != "0" ]
then
	echo $minus_n " \"640x480\"$slosh_c"
fi
echo " "
echo "#-------------------------------------------------------------"
echo "Press [Enter] to continue"
read q
}


read_file() {
clear
cd $CONFIGDIR/DATAFILES
ls -CF *.CRD|more
echo $minus_n "Enter Your Selection: $slosh_c"
read FileName
if [ -f "$FileName" ]
then
	read CardID CardName CardDesc Contributor LastEdit ChipSet ClockChip ClockProg RamDac ClockRates Vmode64 Vmode86 Vmode107i Vmode107 Vmode121i Vmode121 Options VideoRam BiosBase ViewPort Virtual SpeedUp Driver Server<$FileName

	LastEdit=`date '+%m-%d-%y'`

fi
cd $CONFIGDIR
}


# MAIN
if [ ! -f ./MakeCard ]
then
	echo 'You must run this script from the directory containing MakeCard'
	exlt
fi
TMP=/tmp ; export TMP
IFS='|';export IFS
DefaultRec='0|NoCard|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|'
echo "$DefaultRec">$TMP/$$.tmp 
read CardID CardName CardDesc Contributor LastEdit ChipSet ClockChip ClockProg RamDac ClockRates Vmode64 Vmode86 Vmode107i Vmode107 Vmode121i Vmode121 Options VideoRam BiosBase ViewPort Virtual SpeedUp Driver Server<$TMP/$$.tmp
LastEdit=`date '+%m-%d-%y'`
probe_clocks	# do this first thing

while [ 1 ]
do
	clear
	redraw
	echo "Changes? (Format: Fieldname=Value) [f]ile [t]est [s]ave [q]uit [e]xample"
	read Input
	fnm=`echo $Input|cut -f1 -d"="`
	value=`echo $Input|cut -f2 -d"="`
	if [ -z "$value" ]
	then
		value="0"
	fi
	eval oldval=\$"$fnm"
	case $fnm in
		"e")		sample; continue;;
		"f")		read_file;continue;;
		"q")		cleanup;;
		"s")		saveit; continue;;
		"t")		see_config; continue;;
		"CardID")	continue;;	# You may not change this field
		"CardName")	CardName=$value;;
		"CardDesc")	CardDesc=$value;;
		"Contributor")	Contributor=$value;;
		"LastEdit")	LastEdit=$value;;
		"ChipSet")	ChipSet=$value;;
		"ClockChip")	ClockChip=$value;;
		"ClockProg")	ClockProg=$value;;
		"RamDac")	RamDac=$value;;
		"ClockRates")	ClockRates=$value;;
		"Vmode64")	Vmode64=$value;;
		"Vmode86")	Vmode86=$value;;
		"Vmode107i")	Vmode107i=$value;;
		"Vmode107")	Vmode107=$value;;
		"Vmode121i")	Vmode121i=$value;;
		"Vmode121")	Vmode121=$value;;
		"Options")	Options=$value;;
		"VideoRam")	VideoRam=$value;;
		"BiosBase")	BiosBase=$value;;
		"ViewPort")	ViewPort=$value;;
		"Virtual")	Virtual=$value;;
		"SpeedUp")	SpeedUp=$value;;
		"Driver")	Driver=$value;;
		"Server")	Server=$value;;
		*)	continue;;
	esac
	#eval $Input
done
