summaryrefslogtreecommitdiff
path: root/setup/SCO_SV
diff options
context:
space:
mode:
Diffstat (limited to 'setup/SCO_SV')
-rw-r--r--setup/SCO_SV/README.txt64
-rw-r--r--setup/SCO_SV/S89oss46
-rw-r--r--setup/SCO_SV/build.sh172
-rw-r--r--setup/SCO_SV/combpkg/depend2
-rwxr-xr-xsetup/SCO_SV/combpkg/mkpkg.sh78
-rw-r--r--setup/SCO_SV/combpkg/postinstall82
-rw-r--r--setup/SCO_SV/combpkg/request21
-rw-r--r--setup/SCO_SV/fpsupport.s107
-rw-r--r--setup/SCO_SV/i.drvcfg12
-rw-r--r--setup/SCO_SV/llasgmul.obin0 -> 604 bytes
-rw-r--r--setup/SCO_SV/lldivrem.obin0 -> 1000 bytes
-rw-r--r--setup/SCO_SV/llmul.obin0 -> 608 bytes
-rw-r--r--setup/SCO_SV/make.local15
-rwxr-xr-xsetup/SCO_SV/mkoss.sh96
-rw-r--r--setup/SCO_SV/mkpkg.sh76
-rw-r--r--setup/SCO_SV/mktarball.sh26
-rwxr-xr-xsetup/SCO_SV/oss/build/install.sh137
-rw-r--r--setup/SCO_SV/oss/modules/osscore/Drvmap2
-rw-r--r--setup/SCO_SV/oss/modules/osscore/Master4
-rw-r--r--setup/SCO_SV/oss/modules/osscore/Node2
-rw-r--r--setup/SCO_SV/oss/modules/osscore/System4
-rw-r--r--setup/SCO_SV/pkgdepend2
-rw-r--r--setup/SCO_SV/postinstall63
-rw-r--r--setup/SCO_SV/postremove17
-rw-r--r--setup/SCO_SV/preremove15
-rw-r--r--setup/SCO_SV/r.drvcfg27
-rw-r--r--setup/SCO_SV/removeoss.sh36
-rwxr-xr-xsetup/SCO_SV/sbin/soundoff41
-rwxr-xr-xsetup/SCO_SV/sbin/soundon133
29 files changed, 1280 insertions, 0 deletions
diff --git a/setup/SCO_SV/README.txt b/setup/SCO_SV/README.txt
new file mode 100644
index 0000000..6a5de1d
--- /dev/null
+++ b/setup/SCO_SV/README.txt
@@ -0,0 +1,64 @@
+Build instructions for UW7/OSR6 combined oss package.
+
+A. Build the UW7 version.
+
+ 1. On the UW7 machine, create a directory for the builds (we'll use
+ $HOME/oss for our examples).
+
+ 2. Copy this included tarball into that directory.
+
+ 3. Install the txt2man-1.4.8.tar.gz as root:
+ # cd /tmp
+ # gunzip -c $HOME/oss/txt2man-1.4.8.tar.gz | tar xvf -
+ # cd txt2man-1.4.8
+ # make install
+
+ 4. Make sure there is a gawk installed in /usr/local/bin. If the
+ GNUgawk package is already installed, you can just create a
+ symbolic link to it:
+ # ln -s /usr/gnu/bin/gawk /usr/local/bin/gawk
+
+ 5. Unwind the oss source into the build directory:
+ $ cd $HOME/oss
+ $ bunzip2 -c /tmp/oss-4.0-177-061108-src.tar.bz2 | tar xvf -
+ This should give you a oss-4.0 directory.
+
+ 6. Create a directory for the UW7 specific build and do the build and
+ package:
+ $ mkdir $HOME/oss/oss-4.0-uw7.BUILD
+ $ cd $HOME/oss/oss-4.0-uw7.BUILD
+ $ $HOME/oss/oss-4.0/configure
+ $ make
+ $ make package
+
+B. Build an OSR6 version.
+
+ 1. On the OSR6 machine, create a directory for the builds (we'll use
+ $HOME/oss for our examples).
+
+ 2. Copy this included tarball into that directory.
+
+ 3. Unwind the oss source into the build directory:
+ $ cd $HOME/oss
+ $ bunzip2 -c /tmp/oss-4.0-177-061108-src.tar.bz2 | tar xvf -
+ This should give you a oss-4.0 directory.
+
+ 6. Create a directory for the OSR6 specific build and do the build and
+ package:
+ $ mkdir $HOME/oss/oss-4.0-osr6.BUILD
+ $ cd $HOME/oss/oss-4.0-osr6.BUILD
+ $ $HOME/oss/oss-4.0/configure
+ $ make
+ $ make package
+
+C. Create the combined package.
+
+ 1. Copy the entire oss-4.0-osr6.BUILD directory onto the UW7 machine,
+ and put it in the $HOME/oss directory. You should now have both a
+ oss-4.0-uw7.BUILD and a oss-4.0-osr6.BUILD directory in $HOME/oss.
+
+ 2. Run the mkoss.sh script to build the product.
+ $ cd $HOME/oss
+ $ ./mkoss.sh
+
+ 3. The pkgadd'able data stream is $HOME/oss/oss-4.0-comb/*.pkg.
diff --git a/setup/SCO_SV/S89oss b/setup/SCO_SV/S89oss
new file mode 100644
index 0000000..1cfb472
--- /dev/null
+++ b/setup/SCO_SV/S89oss
@@ -0,0 +1,46 @@
+#!/bin/sh
+if test -f /etc/oss.conf
+then
+ . /etc/oss.conf
+else
+ OSSLIBDIR=/usr/lib/oss
+fi
+
+##########
+#
+# The first argument tells what to do.
+##########
+
+state=$1
+
+case $state in
+
+'start')
+ # Signal the osscore module to forceload all the low level
+ # drivers (in the right order).
+
+ if test -f $OSSLIBDIR/starting
+ then
+ echo Previous start failed. Remove $OSSLIBDIR/starting
+ echo and run soundon manually to start OSS.
+ exit 1
+ fi
+
+ echo "Starting Open Sound System"
+ /usr/sbin/soundoff > /dev/null 2>&1
+ /usr/sbin/soundon
+ rm -f $OSSLIBDIR/starting
+ exit 0
+ ;;
+'stop')
+ # Save mixer settings automatically if requested
+ if test -f $OSSLIBDIR/etc/userdefs && grep -q "autosave_mixer yes" $OSSLIBDIR/etc/userdefs
+ then
+ /usr/sbin/savemixer
+ fi
+ exit 0
+ ;;
+esac
+
+exit 1
+
diff --git a/setup/SCO_SV/build.sh b/setup/SCO_SV/build.sh
new file mode 100644
index 0000000..27d4471
--- /dev/null
+++ b/setup/SCO_SV/build.sh
@@ -0,0 +1,172 @@
+#!/bin/sh
+
+. ./.directories
+
+rm -rf prototype
+
+mkdir prototype
+mkdir prototype/etc
+echo "OSSLIBDIR=$OSSLIBDIR" > prototype/etc/oss.conf
+
+TXT2MAN=$SRCDIR/setup/txt2man
+
+if test ! -f /usr/local/bin/gawk
+then
+ # No gawk installed. Use the simple txt2man program instead of
+ # the fully featured shell script which depends on gawk.
+
+ rm -f txt2man
+
+ cc -o txt2man $SRCDIR/setup/txt2man.c
+
+ if test -f txt2man
+ then
+ TXT2MAN=./txt2man
+ fi
+fi
+
+mkdir prototype/usr
+mkdir prototype/usr/lib
+mkdir prototype/usr/bin
+mkdir prototype/usr/man
+mkdir prototype/usr/man/man1
+mkdir prototype/usr/man/man7
+mkdir prototype/usr/man/man8
+mkdir prototype/usr/sbin
+mkdir prototype/$OSSLIBDIR
+mkdir prototype/$OSSLIBDIR/etc
+echo "autosave_mixer yes" > prototype/$OSSLIBDIR/etc/userdefs
+mkdir prototype/$OSSLIBDIR/lib
+mkdir prototype/$OSSLIBDIR/logs
+mkdir prototype/$OSSLIBDIR/modules
+mkdir prototype/$OSSLIBDIR/modules/osscore
+mkdir prototype/$OSSLIBDIR/include
+mkdir prototype/$OSSLIBDIR/include/sys
+mkdir prototype/$OSSLIBDIR/conf
+mkdir prototype/usr/include
+mkdir prototype/usr/include/sys
+
+chmod 700 prototype/$OSSLIBDIR/modules
+
+cp $SRCDIR/include/soundcard.h prototype/usr/include/sys
+
+cp .version prototype/$OSSLIBDIR/version.dat
+
+cp -R $SRCDIR/include/* prototype/$OSSLIBDIR/include/sys/
+cp $SRCDIR/kernel/framework/include/midiparser.h prototype/$OSSLIBDIR/include/
+
+(cd target/bin; rm -f ossrecord; ln -s ossplay ossrecord)
+cp -f target/bin/* prototype/usr/bin
+cp -f target/sbin/* prototype/usr/sbin
+cp -f $SRCDIR/setup/SCO_SV/sbin/* prototype/usr/sbin
+cp -R $SRCDIR/setup/SCO_SV/oss prototype/usr/lib
+
+FPSUPPORT=
+
+if test -f $SRCDIR/setup/SCO_SV/fpsupport.s && as $SRCDIR/setup/SCO_SV/fpsupport.s
+then
+ FPSUPPORT=fpsupport.o
+fi
+
+ld -r -o prototype/$OSSLIBDIR/modules/osscore/Driver.o target/objects/*.o $SRCDIR/setup/SCO_SV/*.o $FPSUPPORT
+
+grep '^int' $SRCDIR/kernel/framework/osscore/oss_core_options.c > prototype/$OSSLIBDIR/modules/osscore/Space.c
+
+rm -f devlist.txt
+
+for n in target/modules/*.o
+do
+ N=`basename $n .o`
+ mkdir prototype/$OSSLIBDIR/modules/$N
+ cp target/build/$N/* prototype/$OSSLIBDIR/modules/$N
+ ld -r -o prototype/$OSSLIBDIR/modules/$N/Driver.o $n
+
+# Now copy the man pages
+ if test -f $SRCDIR/kernel/drv/$N/$N.man
+ then
+ sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/drv/$N/$N.man > /tmp/ossman.tmp
+ $TXT2MAN -t "$N" -v "Devices" -s 7d /tmp/ossman.tmp > prototype/usr/man/man7/$N.7
+ fi
+
+ if test -f $SRCDIR/kernel/nonfree/drv/$N/$N.man
+ then
+ sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/nonfree/drv/$N/$N.man > /tmp/ossman.tmp
+ $TXT2MAN -t "$N" -v "Devices" -s 7d /tmp/ossman.tmp > prototype/usr/man/man7/$N.7
+ fi
+
+echo Check devices for $N
+ grep "^$N[ ]" ./devices.list >> devlist.txt
+done
+
+sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/drv/osscore/osscore.man > /tmp/ossman.tmp
+$TXT2MAN -t "osscore" -v "Devices" -s 7 /tmp/ossman.tmp > prototype/usr/man/man7/osscore.7
+rm -f /tmp/ossman.tmp
+
+#if cp lib/libOSSlib/libOSSlib.a prototype/$OSSLIBDIR/lib
+#then
+# ok=1
+#else
+# exit 1
+#fi
+
+cp devlist.txt prototype/$OSSLIBDIR/etc/devices.list
+
+if test -d kernel/nonfree
+then
+ sed 's/.* //' < devlist.txt|sort|uniq >$SRCDIR/devlists/OSR6
+ #cp devlist.txt $SRCDIR/devlists/SCO
+fi
+
+# Generate Man pages for commands
+for i in target/bin/*
+do
+CMD=`basename $i`
+$TXT2MAN -t "$CMD" -v "User Commands" -s 1 cmd/$CMD/$CMD.man > prototype/usr/man/man1/$CMD.1
+echo done $CMD
+done
+
+for i in target/sbin/*
+do
+ CMD=`basename $i`
+ if test -f cmd/$CMD/$CMD.man
+ then
+ $TXT2MAN -t "$CMD" -v "System Administration Commands" -s 8 cmd/$CMD/$CMD.man > prototype/usr/man/man8/$CMD.8
+ echo done $CMD
+ fi
+done
+
+for i in $SRCDIR/misc/man1m/*.man
+do
+ N=`basename $i .man`
+ $SRCDIR/setup/txt2man -t "$CMD" -v "OSS System Administration Commands" -s 1 $i > prototype/usr/man/man1/$N.1
+done
+
+rm -f prototype/usr/man/man8/ossdetect.8
+$TXT2MAN -t "ossdetect" -v "User Commands" -s 8 os_cmd/SCO_SV/ossdetect/ossdetect.man > prototype/usr/man/man8/ossdetect.8
+echo done ossdetect
+
+# Licensing stuff
+if test -f $SRCDIR/4front-private/osslic.c
+then
+ cc -o prototype/usr/sbin/osslic -Isetup -Ikernel/nonfree/include -Ikernel/framework/include -Iinclude -Ikernel/OS/SCO_SV -I$SRCDIR $SRCDIR/4front-private/osslic.c
+ strip prototype/usr/sbin/osslic
+
+ prototype/usr/sbin/osslic -q -u -3prototype/$OSSLIBDIR/modules/osscore/Driver.o
+
+fi
+
+if test -f 4front-private/ossupdate.c
+then
+ # ossupdate
+ cc -I. 4front-private/ossupdate.c -s -o prototype/usr/sbin/ossupdate -lsocket -lnsl
+fi
+
+sh $SRCDIR/setup/build_common.sh $SRCDIR $OSSLIBDIR
+
+chmod 700 prototype/usr/sbin/*
+chmod 755 prototype/usr/bin/*
+
+cp setup/SCO_SV/S89oss prototype/$OSSLIBDIR/etc
+chmod 744 prototype/$OSSLIBDIR/etc/S89oss
+
+exit 0
diff --git a/setup/SCO_SV/combpkg/depend b/setup/SCO_SV/combpkg/depend
new file mode 100644
index 0000000..f3a47b4
--- /dev/null
+++ b/setup/SCO_SV/combpkg/depend
@@ -0,0 +1,2 @@
+# using depend in packages.
+X audio Audio Subsystem
diff --git a/setup/SCO_SV/combpkg/mkpkg.sh b/setup/SCO_SV/combpkg/mkpkg.sh
new file mode 100755
index 0000000..2e4cb21
--- /dev/null
+++ b/setup/SCO_SV/combpkg/mkpkg.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+if test "`uname -s`" = "UnixWare"
+then
+ OS=unixware
+else
+ OS=osr6
+fi
+# Force both OS versions
+OS=unixware_osr6
+
+ARCH=i386
+
+PKG=oss
+
+VERSION=`cat ./.version`
+BUILDID=`cat ./buildid.dat`
+PKGVERSION=$VERSION-$BUILDID
+PKGFILE=$PKG-$OS-$PKGVERSION-$ARCH.pkg
+TOPDIR=`pwd`
+# Setup the scripts
+echo "CLASSES=none drvcfg" > ./setup/pkginfo
+echo "BASEDIR=/" >> ./setup/pkginfo
+echo "PKG=$PKG" >> ./setup/pkginfo
+echo "NAME=Open Sound System" >> ./setup/pkginfo
+echo "VERSION=$PKGVERSION" >> ./setup/pkginfo
+echo "CATEGORY=driver" >> ./setup/pkginfo
+echo "DESC=Open Sound System for SCO $OS" >> ./setup/pkginfo
+echo "ARCH=$ARCH" >> ./setup/pkginfo
+echo "VENDOR=4Front Technologies" >> ./setup/pkginfo
+echo "HOTLINE=+1 (310) 202 8530" >> ./setup/pkginfo
+echo "EMAIL=support@opensound.com" >> ./setup/pkginfo
+
+echo "i pkginfo=./setup/pkginfo" > /tmp/$$
+if test -f .date
+then
+ # Open Source Version
+ echo "i copyright=./Copying" >>/tmp/$$
+else
+ # Retail version
+ echo "i copyright=./setup/SCO_EULA" >>/tmp/$$
+fi
+echo "i depend=./setup/pkgdepend" >> /tmp/$$
+echo "i postinstall=./setup/postinstall" >> /tmp/$$
+echo "i preremove=./setup/preremove" >> /tmp/$$
+echo "i postremove=./setup/postremove" >> /tmp/$$
+echo "i request=./setup/request" >> /tmp/$$
+echo "i i.drvcfg=./setup/i.drvcfg" >> /tmp/$$
+echo "i r.drvcfg=./setup/r.drvcfg" >> /tmp/$$
+
+# now get a list of all the files and directories
+(cd prototype; find . -type f -print |pkgproto >> /tmp/$$)
+(cd prototype; find . -type l -print |pkgproto >> /tmp/$$)
+(cd prototype; find usr/lib/oss -type d -print | pkgproto >> /tmp/$$)
+# Change the owner/group for the files
+OLDOG="`id -un` `id -gn`"
+cp /tmp/$$ /tmp/$$.o
+cat /tmp/$$.o | sed -e "s/${OLDOG}/root sys/g" > /tmp/$$
+
+# For some files, change the file type of .conf files to editable and set
+# class to drvcfg. For architecture specific files, just set the class.
+EXCEPTIONLIST='Space.c|userdefs|.uw7|.osr6'
+/bin/grep -v -E -e $EXCEPTIONLIST /tmp/$$ > proto
+EXCEPTIONLIST='Space.c|userdefs|.uw7$|.osr6$'
+/bin/grep -E -e $EXCEPTIONLIST /tmp/$$ |sed -e 's/f none/e drvcfg/g' >> proto
+EXCEPTIONLIST='.uw7'
+/bin/grep -E -e $EXCEPTIONLIST /tmp/$$ |sed -e 's/f none/f uw7/g' >> proto
+EXCEPTIONLIST='.osr6'
+/bin/grep -E -e $EXCEPTIONLIST /tmp/$$ |sed -e 's/f none/f osr6/g' >> proto
+
+# Remove the temp file.
+echo "removing /tmp/$$"; rm -f /tmp/$$
+
+#now create the package.
+pkgmk -o -d /tmp -r $TOPDIR/prototype -a $ARCH -f proto
+echo package file is $PKGFILE
+pkgtrans -s /tmp $PKGFILE $PKG
+echo package file is $PKGFILE
+mv /tmp/$PKGFILE $TOPDIR
diff --git a/setup/SCO_SV/combpkg/postinstall b/setup/SCO_SV/combpkg/postinstall
new file mode 100644
index 0000000..c49de2e
--- /dev/null
+++ b/setup/SCO_SV/combpkg/postinstall
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# Place the uw/osr6 specific files into place
+if [ -n "`echo $CLASSES | grep osr6`" ]; then
+ PRFX="osr6"
+else
+ PRFX="uw7"
+fi
+while read file
+do
+ removef oss ${file}.${PRFX}
+ mv ${file}.${PRFX} ${file}
+ installf -c none oss ${file} f
+done <<!EOF
+ /usr/bin/ossxmix
+!EOF
+removef -f oss
+installf -f oss
+
+. /etc/oss.conf
+
+echo "Setting up Open Sound System....please wait"
+
+#first remove the SCO ich driver from the system
+/etc/conf/bin/idinstall -d ich > /dev/null 2>&1
+
+#Remove orphaned files left from earlier OSS installations
+rm -f /dev/sequencer /dev/music
+rm -f /dev/*_mixer[0-9]*
+rm -f /dev/*_midi[0-9]*
+rm -f /dev/*_dsp[0-9]*
+rm -f /dev/dsp*
+rm -f /dev/mixer*
+rm -f /dev/midi*
+rm -f /etc/rc3.d/S99oss
+
+# Unload previous modules
+for n in `ls $OSSLIBDIR/modules|grep -v osscore`
+do
+ modadmin -U $n > /dev/null 2>&1
+done
+
+modadmin -U osscore > /dev/null 2>&1
+
+# Remove previous OSS startup files
+rm -f /etc/rc3.d/S99oss /etc/init.d/oss
+
+# (re)install osscore
+
+rm -f $OSSLIBDIR/modules/*/install.log
+
+cd $OSSLIBDIR/modules/osscore
+
+cd $OSSLIBDIR/build && sh install.sh
+
+if test ! -f $OSSLIBDIR/etc/userdefs
+then
+ echo "autosave_mixer yes" > $OSSLIBDIR/etc/userdefs
+fi
+
+/usr/sbin/soundon
+
+installf -f oss
+
+echo "Adding OSS startup scripts to /etc/rc2.d and /etc/init.d"
+rm -f /etc/rc2.d/S89oss /etc/init.d/oss
+
+cp $OSSLIBDIR/etc/S89oss /etc/init.d/oss
+chmod 744 /etc/init.d/oss
+
+ln -s /etc/init.d/oss /etc/rc2.d/S89oss
+echo ""
+echo ""
+echo ""
+echo ""
+echo Thank you for installing Open Sound System
+echo You can run the osstest command to test audio playback in your system.
+echo
+echo It may be necessary to reboot the system before all devices get properly
+echo detected by the system.
+
+exit 0
diff --git a/setup/SCO_SV/combpkg/request b/setup/SCO_SV/combpkg/request
new file mode 100644
index 0000000..005313a
--- /dev/null
+++ b/setup/SCO_SV/combpkg/request
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+
+uver=`uname -v`
+if [ "$uver" = 7.1.4 ] ; then
+ CLASSES="$CLASSES uw7"
+else
+ if [ $uver = "6.0.0" ] ; then
+ CLASSES="$CLASSES osr6"
+ else
+ echo "invalid CLASS"
+ exit 2
+ fi
+fi
+
+# and so to any other packaging scripts
+cat >$1 <<!
+CLASSES='$CLASSES'
+!
+
+exit 0
diff --git a/setup/SCO_SV/fpsupport.s b/setup/SCO_SV/fpsupport.s
new file mode 100644
index 0000000..c2328c4
--- /dev/null
+++ b/setup/SCO_SV/fpsupport.s
@@ -0,0 +1,107 @@
+ .file "fpsupport_i86pc.c"
+ .text
+.globl oss_fp_check
+ .type oss_fp_check, @function
+oss_fp_check:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+/APP
+ pushfl ; popl %edx
+/NO_APP
+ andl $-2097153, %edx
+/APP
+ pushl %edx ; popfl
+ pushfl ; popl %eax
+/NO_APP
+ movl %eax, %ecx
+ orl $-1, %edx
+ andl $2097152, %ecx
+ jne .L1
+ orl $2097152, %eax
+/APP
+ pushl %eax ; popfl
+ pushfl ; popl %eax
+/NO_APP
+ movl $-2, %edx
+ testl $2097152, %eax
+ je .L1
+ movl $1, %eax
+/APP
+ cpuid
+/NO_APP
+ andl $16777216, %edx
+ cmpl $1, %edx
+ sbbl %ecx, %ecx
+ andl $-4, %ecx
+ leal 1(%ecx), %edx
+.L1:
+ movl %edx, %eax
+ popl %ebx
+ popl %ebp
+ ret
+ .size oss_fp_check, .-oss_fp_check
+.globl oss_fp_save
+ .type oss_fp_save, @function
+oss_fp_save:
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %eax
+ pushl %eax
+ movl 12(%ebp), %ecx
+/APP
+ movl %cr0,%eax
+/NO_APP
+ movl %eax, (%ecx)
+/APP
+ movl %cr4,%edx
+/NO_APP
+ movl %edx, 4(%ecx)
+ andl $-15, %eax
+/APP
+ movl %eax,%cr0
+/NO_APP
+ orb $6, %dh
+/APP
+ movl %edx,%cr4
+/NO_APP
+ movl 8(%ebp), %edx
+/APP
+ fxsave (%edx)
+ fninit
+ fwait
+/NO_APP
+ movl $8064, -8(%ebp)
+ movl $0, -4(%ebp)
+/APP
+ ldmxcsr -8(%ebp)
+ movl %cr0,%edx
+/NO_APP
+ movl %edx, 8(%ecx)
+ leave
+ ret
+ .size oss_fp_save, .-oss_fp_save
+.globl oss_fp_restore
+ .type oss_fp_restore, @function
+oss_fp_restore:
+ pushl %ebp
+ movl %esp, %ebp
+ movl 12(%ebp), %edx
+/APP
+ fwait
+/NO_APP
+ movl 8(%ebp), %ecx
+/APP
+ fxrstor (%ecx)
+/NO_APP
+ movl (%edx), %ecx
+/APP
+ movl %ecx,%cr0
+/NO_APP
+ movl 4(%edx), %ecx
+/APP
+ movl %ecx,%cr4
+/NO_APP
+ popl %ebp
+ ret
+ .size oss_fp_restore, .-oss_fp_restore
diff --git a/setup/SCO_SV/i.drvcfg b/setup/SCO_SV/i.drvcfg
new file mode 100644
index 0000000..f93f876
--- /dev/null
+++ b/setup/SCO_SV/i.drvcfg
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Copyright (c) 2005-2006 4Front Technologies
+#
+
+while read src dest
+do
+ if [ ! -f $dest ] ; then
+ cp $src $dest
+ fi
+done
+exit 0
diff --git a/setup/SCO_SV/llasgmul.o b/setup/SCO_SV/llasgmul.o
new file mode 100644
index 0000000..68af379
--- /dev/null
+++ b/setup/SCO_SV/llasgmul.o
Binary files differ
diff --git a/setup/SCO_SV/lldivrem.o b/setup/SCO_SV/lldivrem.o
new file mode 100644
index 0000000..9cf7d20
--- /dev/null
+++ b/setup/SCO_SV/lldivrem.o
Binary files differ
diff --git a/setup/SCO_SV/llmul.o b/setup/SCO_SV/llmul.o
new file mode 100644
index 0000000..d7a8218
--- /dev/null
+++ b/setup/SCO_SV/llmul.o
Binary files differ
diff --git a/setup/SCO_SV/make.local b/setup/SCO_SV/make.local
new file mode 100644
index 0000000..eedb911
--- /dev/null
+++ b/setup/SCO_SV/make.local
@@ -0,0 +1,15 @@
+build: kernel/framework/include/buildid.h all
+ sh build.sh
+
+copy: build
+ cp -R prototype/* /
+
+package: build
+ sh setup/SCO_SV/mkpkg.sh
+
+tarball: build
+ sh setup/SCO_SV/mktarball.sh
+
+install: copy
+ cd ${OSSLIBDIR}/build && sh install.sh
+ sync && soundoff && sync && soundon && echo "OSS has started OK"
diff --git a/setup/SCO_SV/mkoss.sh b/setup/SCO_SV/mkoss.sh
new file mode 100755
index 0000000..63adcb1
--- /dev/null
+++ b/setup/SCO_SV/mkoss.sh
@@ -0,0 +1,96 @@
+#!/usr/bin/ksh
+
+BASEDIR=`pwd`
+PKGDIR=$BASEDIR/combpkg
+UW7DIR=$BASEDIR/oss-4.0-uw7.BUILD
+OSR6DIR=$BASEDIR/oss-4.0-osr6.BUILD
+COMBDIR=$BASEDIR/oss-4.0-comb
+ARCHFILES="/usr/bin/ossxmix"
+SETUPDIR=$COMBDIR/setup
+
+# We must do this on a UW7 machine to redo the manual pages properly
+if [ "`uname -s`" != "UnixWare" ]; then
+ echo "Error: the combined build must be done on a UnixWare 7 machine!"
+ exit 1
+fi
+
+# Make sure we have the built directories in place
+if [ ! -d $UW7DIR ]; then
+ echo "Error: you must have a build $UW7DIR directory installed!"
+ exit 1
+fi
+if [ ! -d $OSR6DIR ]; then
+ echo "Error: you must have a build $OSR6DIR directory installed!"
+ exit 1
+fi
+
+#
+# Recreate the combined directory
+#
+rm -rf $COMBDIR
+mkdir $COMBDIR
+
+# Copy the OSR6 files
+cd $OSR6DIR
+find prototype | cpio -pdumvL $COMBDIR
+
+# Rename OSR6/copy UW7 files which are OS dependent
+for file in $ARCHFILES
+do
+ mv $COMBDIR/prototype/$file $COMBDIR/prototype/$file.osr6
+ cp $UW7DIR/prototype/$file $COMBDIR/prototype/$file.uw7
+done
+
+# Use the UW7 manual pages, which have the right format
+rm -rf $COMBDIR/prototype/usr/man/*
+cp -r $UW7DIR/prototype/usr/man/* $COMBDIR/prototype/usr/man
+
+# Recreate the manual pages as plain installable text files
+MANPATH=$COMBDIR/prototype/usr/man; export MANPATH
+cd $MANPATH
+find * -print | while read file
+do
+ mfile=${file#man[1-9]/}
+ if [ "$file" != "$mfile" ]; then
+ mfile=${mfile%\.[1-9]}
+ man $mfile - > /dev/null
+ else
+ # Rename the directory the correct way
+ sect=${file#man}
+ mv $MANPATH/$file $MANPATH/man.$sect
+ fi
+done
+rm -rf $MANPATH/man.[0-9]
+
+# Copy the packaging files
+rm -rf $SETUPDIR
+mkdir $SETUPDIR
+while read file
+do
+ cp $OSR6DIR/setup/SCO_SV/$file $SETUPDIR
+done <<!EOF
+ mkpkg.sh
+ S89oss
+ SCO_EULA
+ i.drvcfg
+ pkgdepend
+ pkginfo
+ postinstall
+ postremove
+ preremove
+ r.drvcfg
+!EOF
+
+# Copy the new/modified packaging files
+cd $PKGDIR
+find * -print | cpio -pdumvL $SETUPDIR
+
+# Create a version file
+grep "define OSS_VERSION_ID" $OSR6DIR/kernel/framework/include/oss_version.h|sed 's/.*_ID "/v/'|sed 's/"//' > $COMBDIR/.version
+
+# Copy the buildid file
+cp $OSR6DIR/buildid.dat $COMBDIR
+
+# Run the mkpkg.sh to create the final package
+cd $COMBDIR
+./setup/mkpkg.sh
diff --git a/setup/SCO_SV/mkpkg.sh b/setup/SCO_SV/mkpkg.sh
new file mode 100644
index 0000000..86d2c2a
--- /dev/null
+++ b/setup/SCO_SV/mkpkg.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+if test "`uname -s`" = "UnixWare"
+then
+ OS=unixware
+else
+ OS=osr6
+fi
+
+ARCH=i386
+
+PKG=oss
+
+VERSION=`sh showversion.sh`
+BUILDID=`cat ./buildid.dat`
+PKGVERSION=$VERSION-$BUILDID
+PKGFILE=$PKG-$OS-$PKGVERSION-$ARCH.pkg
+TOPDIR=`pwd`
+# Setup the scripts
+echo "CLASSES=none drvcfg" > ./setup/SCO_SV/pkginfo
+echo "BASEDIR=/" >> ./setup/SCO_SV/pkginfo
+echo "PKG=$PKG" >> ./setup/SCO_SV/pkginfo
+echo "NAME=Open Sound System" >> ./setup/SCO_SV/pkginfo
+echo "VERSION=$PKGVERSION" >> ./setup/SCO_SV/pkginfo
+echo "CATEGORY=driver" >> ./setup/SCO_SV/pkginfo
+echo "DESC=Open Sound System for SCO $OS" >> ./setup/SCO_SV/pkginfo
+echo "ARCH=$ARCH" >> ./setup/SCO_SV/pkginfo
+echo "VENDOR=4Front Technologies" >> ./setup/SCO_SV/pkginfo
+echo "HOTLINE=+1 (310) 202 8530" >> ./setup/SCO_SV/pkginfo
+echo "EMAIL=support@opensound.com" >> ./setup/SCO_SV/pkginfo
+
+echo "i pkginfo=./setup/SCO_SV/pkginfo" > /tmp/$$
+if test -f .date
+then
+ # Open source version
+ echo "i copyright=./COPYING" >>/tmp/$$
+else
+ # Retail version
+ echo "i copyright=./EULA" >>/tmp/$$
+fi
+echo "i depend=./setup/SCO_SV/pkgdepend" >> /tmp/$$
+echo "i postinstall=./setup/SCO_SV/postinstall" >> /tmp/$$
+echo "i preremove=./setup/SCO_SV/preremove" >> /tmp/$$
+echo "i postremove=./setup/SCO_SV/postremove" >> /tmp/$$
+echo "i i.drvcfg=./setup/SCO_SV/i.drvcfg" >> /tmp/$$
+echo "i r.drvcfg=./setup/SCO_SV/r.drvcfg" >> /tmp/$$
+
+# now get a list of all the files and directories
+(cd prototype; find . -type f -print |pkgproto >> /tmp/$$)
+(cd prototype; find . -type l -print |pkgproto >> /tmp/$$)
+(cd prototype; find usr/lib/oss -type d -print | pkgproto >> /tmp/$$)
+
+# now change the file type of .conf files to editable and set class to drvcfg
+EXCEPTIONLIST='Space.c|userdefs'
+
+/bin/grep -v -E -e $EXCEPTIONLIST /tmp/$$ > proto
+/bin/grep -E -e $EXCEPTIONLIST /tmp/$$ |sed -e 's/f none/e drvcfg/g' >> proto
+
+# Remove the temp file.
+echo "removing /tmp/$$"; rm -f /tmp/$$
+
+#now create the package.
+pkgmk -o -d /tmp -r $TOPDIR/prototype -a $ARCH -f proto
+echo package file is $PKGFILE
+pkgtrans -s /tmp $PKGFILE $PKG
+echo package file is $PKGFILE
+mv /tmp/$PKGFILE $TOPDIR
+
+if test -f 4front-private/export_package.sh
+then
+ if sh 4front-private/export_package.sh $PKGFILE . `sh showversion.sh` /tmp `uname -m`
+ then
+ exit 0
+ else
+ exit 1
+ fi
+fi
diff --git a/setup/SCO_SV/mktarball.sh b/setup/SCO_SV/mktarball.sh
new file mode 100644
index 0000000..63e81ab
--- /dev/null
+++ b/setup/SCO_SV/mktarball.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+. ./.directories
+
+VERSION=`sh showversion.sh`
+RELEASE=`cat buildid.dat`
+if test "`uname -s` " = "UnixWare "
+then
+ OSSNAME=oss-unixware
+else
+ OSSNAME=oss-osr6
+fi
+
+PKGNAME=$OSSNAME-$VERSION-$RELEASE-`uname -m`
+
+echo building $PKGNAME.tar.Z
+cp ./setup/SCO_SV/removeoss.sh prototype/$OSSLIBDIR/scripts
+(cd prototype; find . -type f -print) > prototype/$OSSLIBDIR/MANIFEST
+(cd prototype; tar cf - . ) | compress > $PKGNAME.tar.Z
+
+if test -f 4front-private/export_package.sh
+then
+ sh 4front-private/export_package.sh $PKGNAME.tar.Z . `sh showversion.sh` /tmp `uname -m`
+fi
+
+exit 0
diff --git a/setup/SCO_SV/oss/build/install.sh b/setup/SCO_SV/oss/build/install.sh
new file mode 100755
index 0000000..3239575
--- /dev/null
+++ b/setup/SCO_SV/oss/build/install.sh
@@ -0,0 +1,137 @@
+#!/bin/sh
+
+. /etc/oss.conf
+
+if test "$CONFDIR " = " "
+then
+ CONFDIR=/etc/conf
+fi
+
+# Remove the non-oss ICH driver before doing anything else
+/etc/conf/bin/idinstall -R $CONFDIR -d ich > /dev/null 2>&1
+
+# Unload previous modules
+for n in `ls $OSSLIBDIR/modules|egrep -v "osscore|oss_imux"`
+do
+ modadmin -U $n > /dev/null 2>&1
+done
+
+for MOD in osscore oss_imux
+do
+ modadmin -U $MOD > /dev/null 2>&1
+done
+
+# (re)install osscore and oss_imux
+
+rm -f $OSSLIBDIR/modules/*/install.log
+
+for MOD in osscore oss_imux
+do
+ cd $OSSLIBDIR/modules/$MOD
+
+ if test ! -f Space.c
+ then
+ cp $OSSLIBDIR/space.inst/$MOD Space.c
+ fi
+
+ rm -f install.log
+
+ if /etc/conf/bin/idinstall -k -P oss -R $CONFDIR -M $MOD >> install.log 2>&1
+ then
+ if /etc/conf/bin/idbuild -M $MOD >> install.log 2>&1
+ then
+ echo OSS module $MOD installed OK
+ echo OSS module $MOD installed OK >> install.log
+ else
+ cat install.log
+ echo Building $MOD module failed
+ echo Building $MOD module failed >> install.log
+ exit 1
+ fi
+ else
+ cat install.log
+ echo Failed to idinstall $MOD
+ echo Failed to idinstall $MOD >> install.log
+ exit 1
+ fi
+
+ (cd $OSSLIBDIR/conf && rm -f $MOD.conf && ln -sf ../modules/$MOD/Space.c $MOD.conf)
+
+ installf oss $CONFDIR/sdevice.d/$MOD
+done
+
+
+# Only install the drivers we have a resmgr match for
+OSSTMPFILE=/tmp/ossdetect.$$
+CDIR=`pwd`
+cd $OSSLIBDIR/modules
+/sbin/resmgr -p BRDID > $OSSTMPFILE
+for file in */Drvmap
+do
+ DRVR=`dirname $file`
+ grep "^|" $file | cut -d \| -f3 | while read BRDID
+ do
+ if [ -n "$BRDID" ]; then
+ while read RMBRDID
+ do
+ if [ "$BRDID" = "$RMBRDID" ]; then
+ echo "$DRVR"
+ fi
+ done < $OSSTMPFILE
+ fi
+ done
+done | sort -u | while read DRVR
+do
+ cd $OSSLIBDIR/modules/$DRVR
+
+ if test ! -f Space.c
+ then
+ cp $OSSLIBDIR/../space.inst/$n Space.c
+ fi
+
+ rm -f install.log
+
+# /etc/conf/bin/idinstall -R $CONFDIR -d $DRVR > /dev/null 2>&1
+
+ if /etc/conf/bin/idinstall -k -P oss -R $CONFDIR -M $DRVR >> install.log 2>&1
+ then
+ if /etc/conf/bin/idbuild -M $DRVR >> install.log 2>&1
+ then
+ echo OSS module $DRVR installed OK
+ echo OSS module $DRVR installed OK >> install.log
+ else
+ cat install.log
+ echo Building $DRVR module failed
+ echo Building $DRVR module failed >> install.log
+ exit 1
+ fi
+ else
+ cat install.log
+ echo Failed to idinstall $DRVR
+ echo Failed to idinstall $DRVR >> install.log
+ exit 1
+ fi
+ installf oss $CONFDIR/sdevice.d/$DRVR
+
+ (cd $OSSLIBDIR/conf && rm -f $DRVR.conf && \
+ ln -sf ../modules/$DRVR/Space.c $DRVR.conf)
+done
+
+rm -f $OSSTMPFILE
+
+cd $CDIR
+
+if test -f /bin/dcu
+then
+ /bin/dcu -S
+else
+ /sbin/dcu -S
+fi
+
+if test ! -f $OSSLIBDIR/etc/installed_drivers
+then
+echo "----------------------------------------------"
+ /usr/sbin/ossdetect -v
+echo "----------------------------------------------"
+fi
+echo OSS modules installed OK
diff --git a/setup/SCO_SV/oss/modules/osscore/Drvmap b/setup/SCO_SV/oss/modules/osscore/Drvmap
new file mode 100644
index 0000000..498646c
--- /dev/null
+++ b/setup/SCO_SV/oss/modules/osscore/Drvmap
@@ -0,0 +1,2 @@
+osscore|Y|N|Sound Boards|Open Sound System
+|||OSS framework module
diff --git a/setup/SCO_SV/oss/modules/osscore/Master b/setup/SCO_SV/oss/modules/osscore/Master
new file mode 100644
index 0000000..51a7805
--- /dev/null
+++ b/setup/SCO_SV/oss/modules/osscore/Master
@@ -0,0 +1,4 @@
+$version 2
+$contact 4Front Technologies (http://www.opensound.com)
+$interface ddi 8mp
+osscore - R
diff --git a/setup/SCO_SV/oss/modules/osscore/Node b/setup/SCO_SV/oss/modules/osscore/Node
new file mode 100644
index 0000000..b450408
--- /dev/null
+++ b/setup/SCO_SV/oss/modules/osscore/Node
@@ -0,0 +1,2 @@
+$maxchan 0
+osscore osscore%i c 0 0 0 0600
diff --git a/setup/SCO_SV/oss/modules/osscore/System b/setup/SCO_SV/oss/modules/osscore/System
new file mode 100644
index 0000000..2bdb086
--- /dev/null
+++ b/setup/SCO_SV/oss/modules/osscore/System
@@ -0,0 +1,4 @@
+* Don't edit this file manually! This information will be ignored.
+*
+$version 2
+osscore Y 0 5 4 0 0 0 0 0 -1
diff --git a/setup/SCO_SV/pkgdepend b/setup/SCO_SV/pkgdepend
new file mode 100644
index 0000000..f3a47b4
--- /dev/null
+++ b/setup/SCO_SV/pkgdepend
@@ -0,0 +1,2 @@
+# using depend in packages.
+X audio Audio Subsystem
diff --git a/setup/SCO_SV/postinstall b/setup/SCO_SV/postinstall
new file mode 100644
index 0000000..df07988
--- /dev/null
+++ b/setup/SCO_SV/postinstall
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+. /etc/oss.conf
+
+echo "Setting up Open Sound System....please wait"
+
+#first remove the SCO ich driver from the system
+/etc/conf/bin/idinstall -d ich > /dev/null 2>&1
+
+#Remove oprhaned files left from earlier OSS installations
+rm -f /dev/sequencer /dev/music
+rm -f /dev/*_mixer[0-9]*
+rm -f /dev/*_midi[0-9]*
+rm -f /dev/*_dsp[0-9]*
+rm -f /dev/dsp*
+rm -f /dev/mixer*
+rm -f /dev/midi*
+rm -f /etc/rc3.d/S99oss
+
+# Unload previous modules
+for n in `ls $OSSLIBDIR/modules|grep -v osscore`
+do
+ modadmin -U $n > /dev/null 2>&1
+done
+
+modadmin -U osscore > /dev/null 2>&1
+
+# Remove previous OSS startup files
+rm -f /etc/rc3.d/S99oss /etc/init.d/oss
+
+# (re)install osscore
+
+rm -f $OSSLIBDIR/modules/*/install.log
+
+cd $OSSLIBDIR/modules/osscore
+
+cd $OSSLIBDIR/build && sh install.sh
+
+if test ! -f $OSSLIBDIR/etc/userdefs
+then
+ echo "autosave_mixer yes" > $OSSLIBDIR/etc/userdefs
+fi
+
+/usr/sbin/soundon
+
+echo "Adding OSS startup scripts to /etc/rc2.d and /etc/init.d"
+rm -f /etc/rc2.d/S89oss /etc/init.d/oss
+
+cp $OSSLIBDIR/etc/S89oss /etc/init.d/oss
+chmod 744 /etc/init.d/oss
+
+ln -s /etc/init.d/oss /etc/rc2.d/S89oss
+echo ""
+echo ""
+echo ""
+echo ""
+echo Thank you for installing Open Sound System
+echo You can run the osstest command to test audio playback in your system.
+echo
+echo It may be necessary to reboot the system before all devices get properly
+echo detected by the system.
+
+exit 0
diff --git a/setup/SCO_SV/postremove b/setup/SCO_SV/postremove
new file mode 100644
index 0000000..e5aa2ba
--- /dev/null
+++ b/setup/SCO_SV/postremove
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Remove the device instances from /dev
+for i in `cat /tmp/installed_drivers`
+do
+rm -f /dev/$i[0-9]*
+done
+rm -f /tmp/installed_drivers
+
+# Remove the device files
+rm -f /dev/dsp /dev/dsp_* /dev/midi /dev/mixer
+rm -f /dev/dsp[0-9]* /dev/dsp_*
+rm -f /dev/mixer[0-9]*
+rm -f /dev/midi[0-9][0-9]*
+rm -f /dev/sndstat
+rm -f /etc/rc2.d/S89oss /etc/init.d/oss
+rm -rf /dev/oss
+exit 0
diff --git a/setup/SCO_SV/preremove b/setup/SCO_SV/preremove
new file mode 100644
index 0000000..1f37d98
--- /dev/null
+++ b/setup/SCO_SV/preremove
@@ -0,0 +1,15 @@
+#!/bin/sh
+. /etc/oss.conf
+
+/usr/sbin/soundoff
+cp -f $OSSLIBDIR/etc/installed_drivers /tmp/installed_drivers
+(cd $OSSLIBDIR;rm -rf etc/installed_drivers etc/legacy_devices logs conf)
+
+# Remove the drivers - preremove will copy installed_drivers to /tmp
+for n in `ls $OSSLIBDIR/modules`
+do
+ if [ -d /etc/conf/pack.d/$n ]; then
+ /etc/conf/bin/idinstall -P oss -d $n > /dev/null 2>&1
+ rm -f $OSSLIBDIR/modules/$n/install.log
+ fi
+done
diff --git a/setup/SCO_SV/r.drvcfg b/setup/SCO_SV/r.drvcfg
new file mode 100644
index 0000000..00004b2
--- /dev/null
+++ b/setup/SCO_SV/r.drvcfg
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 by 4Front Technologies
+# All rights reserved.
+#
+#
+
+if test "`uname -s`" = "UnixWare"
+then
+PKGCHK=/usr/sbin/pkgchk
+else
+PKGCHK=/bin/pkgchk
+fi
+
+while read src
+do
+ if [ -f $src ]
+ then
+ if $PKGCHK -p $src
+ then
+ rm -f $src
+ else
+ echo "not removing $src"
+ fi
+ fi
+done
+exit 0
diff --git a/setup/SCO_SV/removeoss.sh b/setup/SCO_SV/removeoss.sh
new file mode 100644
index 0000000..ad5eb98
--- /dev/null
+++ b/setup/SCO_SV/removeoss.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+if test `whoami` != "root"
+then
+ echo "You must be super-user or logged in as root to uninstall OSS..."
+ exit 0
+fi
+
+echo "Uninstalling OSS...."
+echo "Running soundoff...."
+/usr/sbin/soundoff
+
+echo Uninstalling OSS modules
+cp -f $OSSLIBDIR/etc/installed_drivers /tmp/installed_drivers
+(cd $OSSLIBDIR;rm -rf etc/installed_drivers etc/legacy_devices logs conf)
+
+# Remove the drivers - preremove will copy installed_drivers to /tmp
+for n in `ls $OSSLIBDIR/modules`
+do
+ if [ -d /etc/conf/pack.d/$n ]; then
+ /etc/conf/bin/idinstall -P oss -d $n > /dev/null 2>&1
+ rm -f $OSSLIBDIR/modules/$n/install.log
+ fi
+done
+
+echo "Removing OSS Files in MANIFEST"
+cd /
+for i in `cat /usr/lib/oss/MANIFEST`
+do
+# echo "Removing file $i"
+rm -f $i
+done
+
+echo "Removing /usr/lib/oss directory"
+rm -rf /usr/lib/oss
+
+echo "OSS Uninstalled. However you may need reboot the system."
diff --git a/setup/SCO_SV/sbin/soundoff b/setup/SCO_SV/sbin/soundoff
new file mode 100755
index 0000000..2196ab6
--- /dev/null
+++ b/setup/SCO_SV/sbin/soundoff
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+. /etc/oss.conf
+
+if /sbin/modadmin -Q osscore >> /dev/null 2>&1
+then
+ OK=1
+else
+ echo OSS not loaded.
+ exit 0
+fi
+
+if test ! -f $OSSLIBDIR/etc/installed_drivers
+then
+ echo $OSSLIBDIR/etc/installed_drivers is missing.
+ exit 1
+fi
+
+# Save mixer settings automatically if requested
+if test -f $OSSLIBDIR/etc/userdefs && /usr/bin/grep -q "autosave_mixer yes" $OSSLIBDIR/etc/userdefs
+then
+ /usr/sbin/savemixer
+fi
+
+for n in `cat $OSSLIBDIR/etc/installed_drivers | sed 's/#.*//'`
+do
+ /sbin/modadmin -U $n > /dev/null 2>&1
+done
+
+/sbin/modadmin -U osscore > /dev/null 2>&1
+
+if /sbin/modadmin -Q osscore >> /dev/null 2>&1
+then
+ OK=1
+else
+ exit 0
+fi
+
+echo Cannot unload the OSS driver modules
+
+exit 0
diff --git a/setup/SCO_SV/sbin/soundon b/setup/SCO_SV/sbin/soundon
new file mode 100755
index 0000000..923c953
--- /dev/null
+++ b/setup/SCO_SV/sbin/soundon
@@ -0,0 +1,133 @@
+#!/bin/sh
+
+. /etc/oss.conf
+
+if test -f $OSSLIBDIR/starting
+then
+ echo Previous start of OSS crashed the system
+ echo Please resolve the situation and remove file
+ echo \"$OSSLIBDIR/starting\". Then start OSS by
+ echo running soundon again.
+ exit 1
+fi
+
+if /sbin/modadmin -Q osscore >> /dev/null 2>&1
+then
+ echo Open Sound System is already running
+ exit 0
+fi
+
+LOG=$OSSLIBDIR/logs/soundon.log
+
+touch $OSSLIBDIR/starting
+sync
+
+echo "Open Sound System starting" `date` > $LOG
+echo "OSS version: " `cat $OSSLIBDIR/version.dat` >> $LOG 2>&1
+echo "Kernel version: " `uname -a` >> $LOG
+
+if test ! -f $OSSLIBDIR/etc/installed_drivers
+then
+ echo No $OSSLIBDIR/etc/installed_drivers >> $LOG
+ echo No $OSSLIBDIR/etc/installed_drivers
+ echo Please run ossdetect to create it.
+ exit 1
+fi
+
+if test ! -f /etc/conf/mod.d/osscore
+then
+ echo No $OSSLIBDIR/modules/osscore module >> $LOG
+ echo No $OSSLIBDIR/modules/osscore module
+ exit 2
+fi
+
+if test -f $OSSLIBDIR/etc/license.asc
+then
+ /usr/sbin/ossdetect -l >> $LOG
+fi
+
+if /sbin/modadmin -l osscore >> $LOG 2>&1
+then
+ OK=1
+else
+ echo Loading the osscore module failed
+ echo Loading the osscore module failed >> $LOG
+
+ echo "+++ Kernel messages +++" >> $LOG
+ # This may look fatal but in fact it's not. The panic command
+ # of the crash utility just prints the panic buffer (latest kernel messages).
+ echo panic|/usr/sbin/crash >> $LOG
+
+ exit 4
+fi
+
+for n in `cat $OSSLIBDIR/etc/installed_drivers | sed 's/#.*//'`
+do
+ if /sbin/modadmin -l $n >> $LOG 2>&1
+ then
+ OK=1
+ else
+ echo Loading module $n failed '-' ignored >> $LOG
+ echo Loading module $n failed '-' ignored
+ fi
+done
+
+echo "+++ Kernel messages +++" >> $LOG
+# This may look fatal but in fact it's not. The panic command
+# of the crash utility just prints the panic buffer (latest kernel messages).
+echo panic|/usr/sbin/crash >> $LOG
+
+/usr/sbin/ossdetect -d >> $LOG 2>&1
+
+# Restore the previous legacy device links
+if test -f $OSSLIBDIR/etc/legacy_devices
+then
+ sh $OSSLIBDIR/etc/legacy_devices >> $LOG 2>&1
+fi
+
+/usr/sbin/ossdevlinks -v >> $LOG 2>&1
+
+echo "+++ ossinfo -v3 +++" >> $LOG
+ossinfo -v3 >> $LOG 2>&1
+
+echo "+++ /dev/sndstat +++" >> $LOG
+cat /dev/sndstat >> $LOG 2>&1
+
+echo "+++ pciconf +++" >> $LOG
+echo pcilong|/usr/sbin/ndcfg -q >> $LOG 2>&1
+echo "+++ OSS devices +++" >> $LOG
+ls -l /dev/*dsp* /dev/*_pcm* /dev/*mixer* /dev/*_mix* /dev/*midi* /dev/*_mid* >> $LOG 2>&1
+
+/usr/sbin/savemixer -L >> $LOG 2>&1
+
+if test -x $OSSLIBDIR/soundon.user
+then
+ echo Running $OSSLIBDIR/soundon.user >> $LOG
+ $OSSLIBDIR/soundon.user >> $LOG 2>&1
+fi
+
+if test "`ossinfo -g|grep TRIAL` " != " "
+then
+ echo
+ echo "************************************************************"
+ echo "* NOTE! You are using trial version of Open Sound System *"
+ echo "************************************************************"
+ echo
+
+ sleep 1
+fi
+
+if test "`ossinfo -g|grep EXPIRED` " != " "
+then
+ echo
+ echo "****************************************************************"
+ echo "* NOTE! Your Open Sound System evaluation license has expired *"
+ echo "****************************************************************"
+ echo
+
+ sleep 15
+fi
+
+rm -f $OSSLIBDIR/starting
+
+exit 0