head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	94.05.24.22.08.34;	author md;	state Exp;
branches;
next	1.1;

1.1
date	92.11.10.08.41.16;	author md;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Add support for merging in debugger into kernel.
@
text
@#! /bin/sh
#
#$Header: /sys/rt/stand/RCS/mkdkern,v 1.1 1992/11/10 08:41:16 md Exp md $
#$ACIS:make.ws 12.0$
#$Source: /sys/rt/stand/RCS/mkdkern,v $
#
# shell script to generate a workstation binary with the debugger and
# symbol table merged in.
#
input=vmunix
output=$input.dbg
VMRDB=../../rtstand/rdb.out
OMERGE=/usr/ibm/omerge

rm -f $output

echo "Linking kernel with debugger in $VMRDB"

nm -n $input > $input.nm || exit 1
echo "symbol table produced in $input.nm"

rm -f $input.out
cp $input $input.out || exit 1

# get the offsets and positions of the debugger 
# we use the current makefile to define the appropriate symbols

defined=`grep "IDENT=" Makefile | sed 's;IDENT=;;`
eval `unifdef $defined ../../rt/rt/rdb.h | awk ' $1 == "#define" { print $2 "=" substr($3,3) } ' `
echo "Merging debugger (from ${VMRDB}) into $input.out..."
${OMERGE} -p2048 -o0x${RDB_RELOC?} -e0x${RDB_END?} ${VMRDB} $input.out || exit 1

# convert NCS symbols if necessary
../../rt/conf/fixsyms $input.nm $input.snm || exit 1

# following sed makes the 'int' routines visable and also changes the
# virtual kernel addresses back into real addresses
( sed -e 's;^e;0;' -e 's; int; _int;' -e 's;mcount;_mcount;' $input.snm ) |
	/usr/ibm/makesym -h > $input.sym || exit 1

echo "Merging symbol table (from $input.sym) into $input.out..."
${OMERGE} -p2048 -o0x${RDB_SYMTAB?} -l0x${RDB_SYMLEN?} $input.sym $input.out || exit 1

mv $input.out $output || exit 1
echo "Kernel linked with debugger now in $output"
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
#$Header:make.ws 12.0$
d5 1
a5 1
#$Source: /ibm/acis/usr/sys/conf/RCS/make.ws,v $
d12 1
a12 2
VMRDB=../rtstand/obj/rdb.out
VMRDB=../rtstand/rdb.out
d29 1
a29 1
eval `unifdef $defined ../rt/rdb.h | awk ' $1 == "#define" { print $2 "=" substr($3,3) } ' `
d34 1
a34 1
../conf/fixsyms $input.nm $input.snm || exit 1
@
