#!/bin/sh
# --------------------------------------------------------------------------
#                    Lilo Colored Bootmessage Creator
#                         for lilo-colors-1.21.X
# --------------------------------------------------------------------------
# Ron Bessems <R.E.M.W.Bessems@stud.tue.nl>
# GNU general public licence. See the the file COPYING.
#
#
# To acctually write this to the bootmsg file type
#   make
#
#
# ---------------------------------------------------------------------------
# Attributes & Colors.
# ---------------------------------------------------------------------------
# Bit(s)  Description 
#  7      foreground blink or (alternate) background bright
#  6-4    background color
#  3      foreground bright or (alternate) alternate character set
#  2-0    foreground color
#
# Values for character color:
#         Normal          Bright
#  000b   black           dark gray
#  001b   blue            light blue
#  010b   green           light green
#  011b   cyan            light cyan
#  100b   red             light red
#  101b   magenta         light magenta
#  110b   brown           yellow
#  111b   light gray      white
#
#  This list is taken from Ralf Brown's interrupt list.
#
# 
# Use this as the attributes for the colored text
# a small example :
# Discription			| bits  | value
# ------------------------------+-------+----------------
# no bright       		| 7     | 0b
# blue background  		| 6 - 4 |  001b
# no blinking	   		| 3     |     0b
# light gray foreground		| 2-0   |      111b
# ------------------------------+-------+----------------
# that is                       | 7-0   | 00010111b = 23d. 
# Put this as shown below in a variable. eg.(Color1)
#
# ---------------------------------------------------------------------------
# ScrollExclude Setting.
# ---------------------------------------------------------------------------
#
ScrollExclude=`./line 1 253 1 14`	# that's 14 lines of no no scroll
#
# this one tells lilo how many lines of the message shouldn't scroll 
# off the screen.


# ---------------------------------------------------------------------------
# The message.
# ---------------------------------------------------------------------------
#
# When you change the message you don't need to recompile lilo, just
# run lilo.
#

#byte 250 means clear the screen with the color of the next byte. 
#byte 251 means print everything with the attribute contained in the next byte. 

CLS=`./line 1 250 1 30`		# yellow on blue
Color1=`./line 1 251 1 23`	# light gray on blue
Color2=`./line 1 251 1 18`	# green on blue
Color3=`./line 1 251 1 30`	# yellow on blue
Color4=`./line 1 251 1 112`   	# black on light gray
Color5=`./line 1 251 1 1`   	# blue on black

clt=`./line 1 218`		# Corner Left Top
crt=`./line 1 191`		# corner right top
clb=`./line 1 192`		# corner left bottom
crb=`./line 1 217`	  	# corner right bottom
s=`./line 1 176`		# a shade char.

# Make a nice horizontal line this width of the screen 
# With nice corners.
hline1=`./line 1 218 78 196 1 191`	# top line
hline2=`./line 1 192 78 196 1 217`	# bottom line	

# Make a nice horizontal line the width of the window
# with nice colors.
hlinewin1=`./line 1 218 53 196 1 191` 	# top line
hlinewin2=`./line 1 192 53 196 1 217` 	# bottom line

hshadeline=`./line 55 176`		# A horizontal shadow.
vline=`./line 1 179`			# A vertical line.

s2=${Color5}${s}${Color2}
vlin1=${Color4}$vline

#----------------------------------------------------------------------
# From here the actual echoing to stdout is done.
#----------------------------------------------------------------------
echo -n $ScrollExclude
cat << EOF
${CLS}${Color1}${hline1}${vline} LILO                                                               ${Color3}Linux 2.2${Color1} ${vline}${hline2}
${Color2} Select the Kernel image :

     ${Color4}${hlinewin1}${Color2}
     ${vlin1} linux  ..... Linux 2.2.4             runlevel 3     ${vline}${s2}
     ${vlin1} redhat ..... Original Redhat Kernel  runlevel 3     ${vline}${s2}
     ${vlin1} x      ..... XWindow 3.3.3           runlevel 5     ${vline}${s2}
     ${vlin1} dos    ..... Dos                                    ${vline}${s2}
     ${Color4}${hlinewin2}${s2}
      ${Color5}${hshadeline}${Color2}

EOF
