chip@killer.UUCP (Chip Rosenthal) (12/08/87)
In article <942@csun.UUCP> abcscnge@csun.UUCP (Scott Neugroschl) writes: >How (short of using ANSI escape codes and ctrl-g's) does someone play >with the system speaker under SCO Xenix 2.2.1? We are doing some demo >software, and would like to impress the hell out of the customer. #! /bin/sh # this is a 'shar' archive - run through sh(C) to extract: # -rw-r--r-- 1 root root 484 Dec 7 15:27 README.sco # -rwxr-xr-x 1 root root 2575 Dec 7 15:14 mkspkr # -rw-r--r-- 1 root root 1268 Dec 7 15:14 spkr_patch # 3 files total echo "'done - 3 files extracted' will be displayed when finished" echo "x - README.sco (file 1 of 3)" sed -e 's/.//' << 'END_OF_FILE_README.sco' > README.sco #On 22 Oct 87, Marc de Groot (mdg@uport.UUCP) posted a speaker driver for #Microport to comp.unix.xenix (message <170@uport.UUCP>). I ported it to #SCO XENIX, and added an installation/deinstallation script. This kit #includes the following files: # # README.sco this file # spkr_patch patches for spkr.c # mkspkr shell script to install speaker # #Instructions: # # (1) Obtain Marc's program. # (2) patch<spkr_patch # (3) mkspkr # (4) reboot # (5) cat bugle >/dev/spkr # END_OF_FILE_README.sco echo "original file size: 17 63 484 README.sco" echo "extracted file size: `wc README.sco`" echo "x - spkr_patch (file 2 of 3)" sed -e 's/.//' << 'END_OF_FILE_spkr_patch' > spkr_patch #Index: spkr.c #*** spkr.c.orig Mon Dec 7 15:08:41 1987 #--- spkr.c Mon Dec 7 15:12:57 1987 #*************** #*** 1,5 # /* # * Loudspeaker device driver for Microport System V/AT # */ # # /************************** COPYRIGHT NOTICE ************************** # #--- 1,8 ----- # /* # * Loudspeaker device driver for Microport System V/AT #+ * #+ * Mon Dec 7 15:08:55 CST 1987 - Chip Rosenthal - chip@vector.UUCP #+ * Modified to run under SCO XENIX. # */ # # /************************** COPYRIGHT NOTICE ************************** #*************** #*** 16,21 # #include <sys/types.h> # #include <sys/signal.h> # #include <sys/dir.h> # #include <sys/param.h> # #include <sys/errno.h> # #include <sys/user.h> # #--- 19,27 ----- # #include <sys/types.h> # #include <sys/signal.h> # #include <sys/dir.h> #+ #ifdef M_XENIX #+ # undef DIRSIZ /* avoid redifinition from <param.h> */ #+ #endif # #include <sys/param.h> # #include <sys/errno.h> # #include <sys/user.h> #*************** #*** 21,26 # #include <sys/user.h> # #include <sys/ioctl.h> # #include "spkr.h" # # /* # * Global variables # #--- 27,36 ----- # #include <sys/user.h> # #include <sys/ioctl.h> # #include "spkr.h" #+ #+ #ifdef M_XENIX #+ union ioctl_arg { int iarg; }; #+ #endif # # /* # * Global variables END_OF_FILE_spkr_patch echo "original file size: 59 157 1268 spkr_patch" echo "extracted file size: `wc spkr_patch`" echo "x - mkspkr (file 3 of 3)" sed -e 's/.//' << 'END_OF_FILE_mkspkr' > mkspkr #: ## mkspkr - SCO XENIX speaker driver installation ## ## Mon Dec 7 15:14:34 CST 1987 - C. Rosenthal ## Original composition. # #case "$*" in #"") ;; #add);; #remove) # echo "Removing spkr..." # set -xv # rm -f /dev/spkr /usr/sys/io/spkr.o # cd /usr/sys/conf # cp link_xenix link_xenix- # sed -e 's!../io/spkr.o[ ]*!!' link_xenix- > link_xenix # cp master master- # ./configure -m`./configure -j sp` -d -c # exit 0 # ;; #*) # echo "usage: $0 [remove]" # exit 1 # ;; #esac # ## default major device number #MAJ=10 # ## make sure required files exist #for file in spkr.c spkr.h ; do # if [ ! -f $file ] ; then # echo "$file: file not found" # exit 1 # fi #done # ## determine target CPU executable type #case "`uname -p`" in # i8086) CFLAGS="-K -DM_KERNEL -M0em" ;; # i80286) CFLAGS="-K -DM_KERNEL -M2em" ;; # *) echo "Can't determine processor type" ; exit 1 ;; #esac # ## compile the program and save it to /usr/sys/io #echo "Compiling spkr.c, ignore \"\`DIRSIZ' : redefinition\" warning..." #cc $CFLAGS -c spkr.c #savedir="`pwd`" #case "$savedir" in # /usr/sys/io) ;; # *) cp spkr.o /usr/sys/io ;; #esac # #cd /usr/sys/conf # ## if required, add spkr.o to "link_xenix" #if grep spkr.o link_xenix >/dev/null 2>&1 ; then # echo "spkr.o already in 'link_xenix' - file not changed" #else # cp link_xenix link_xenix- # sed -e 's!Klibc.a!../io/spkr.o &!' link_xenix- > link_xenix # if grep spkr.o link_xenix >/dev/null 2>&1 ; then # echo "spkr.o added to 'link_xenix'" # else # echo "Couldn't add spkr.o to 'link_xenix'" # exit 1 # fi #fi # ## if required, add spkr information to "master" #if maj="`./configure -j sp`" ; then # MAJ="$maj" # echo "spkr already in 'master' as major $MAJ - file not changed" #else # cp master master- # if ./configure -m$MAJ -c -t ; then # echo "Major $MAJ already in use...looking for another one..." # MAJ="`./configure -j NEXTMAJOR`" # fi # if ./configure -m$MAJ -c -a spopen spclose spread spwrite spioctl ; then # echo "spkr driver added as character device $MAJ" # else # echo "configure add failed" # exit 1 # fi #fi # ## add the speaker device #rm -f /dev/spkr #mknod /dev/spkr c $MAJ 0 #chmod 666 /dev/spkr #echo "/dev/spkr created as [$MAJ,0]" # ## create a new kernal #echo "Linking a new kernal..." #./link_xenix # ## install it #s="/xenix.new" #while : ; do # echo "Shall I move the new kernal to $s? [no] " # read ans # case "$ans" in # y*|Y*) mv xenix $s ; break ;; # ""|n*|N*) s="`pwd`/xenix" ; break ;; # *) echo "Please answer 'yes' or 'no'." ;; # esac #done # #echo "Kernal containing speaker driver is '$s'" #exit 0 # END_OF_FILE_mkspkr echo "original file size: 112 400 2575 mkspkr" echo "extracted file size: `wc mkspkr`" echo "done - 3 files extracted" exit 0 -- Chip Rosenthal chip@vector.UUCP | But if you want to sing the Dallas Semiconductor (214) 450-0400 | blues, then boy you better {texsun,ihnp4,cbosgd}!killer!vector!chip | learn how to lose.