#!/bin/bash # # 1998, Till Christian Siering # LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../lib" export LD_LIBRARY_PATH PATH="$PATH:." export PATH # # Prints usage. # usage() { echo "" echo "rt_fixcalc -(start|stop)" echo "" echo " -start inserts all kernel modules needed for the fixed point calculator example"; echo " and starts the simple fixed point calculator shell. To quit the shell"; echo " just type something, which can not be interpreted."; echo " -stop removes all kernel modules needed for the fixed point calculator example."; echo "" } # # loads all kernel modules. # rt_fixcalc_load() { if [ $(id -u) = "0" ] then insmod rt_fifo_new; insmod ../bin/rt_fix.o; insmod ./rt_process.o; fixcalc; else echo "You have to be root to load kernel modules."; fi } # # removes all kernel modules. # rt_fixcalc_unload() { rmmod rt_process rmmod rt_fix rmmod rt_fifo_new; } # # here begins the Program # case $1 in -start) rt_fixcalc_load ;; -stop) rt_fixcalc_unload ;; *) usage ;; esac