Initial import

This commit is contained in:
jeremy 1997-12-24 09:21:18 +00:00
parent a70d6a8124
commit a68bc49340
38 changed files with 1669 additions and 0 deletions

5
distrib/sun3x/Makefile Normal file
View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
SUBDIR= miniroot ramdisk
.include <bsd.subdir.mk>

View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile.inc,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
REV!=sh ${BSDSRCDIR}/sys/conf/osrelease.sh -s
LDSTATIC= -static
# Hack needed to find kernel images...
BSDSRCDIR?= /usr/src
SRCSYSDIR?= ${BSDSRCDIR}/sys

View File

@ -0,0 +1,20 @@
# $NetBSD: Make.crunch,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# This is included by subdirectories building a crunched binary.
# Assume the following are already defined: TOP, CBIN
CBIN?= xxx-crunched
CRUNCHCONF= ${TOP}/common/${CBIN}.conf
CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms
CLEANFILES+= *.lo *_stub.o *_stub.c
# Keep a copy that is not stripped so I can debug...
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
make -f ${CBIN}.mk all STRIP=true
cp -p ${CBIN} ${CBIN}.syms
strip ${CBIN}
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
crunchgen -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF}

View File

@ -0,0 +1,42 @@
#
# $NetBSD: Make.fsimage,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# TOP is assumed to be defined by Makefile including this one.
# These will be defined by it too:
IMAGE?= xxx-${REV}
CBIN?= xxx-crunched
TREE?= ${.CURDIR}/${CBIN}.tree
LISTS?= ${.CURDIR}/${CBIN}.list
MOUNT_POINT?= /mnt
DISKTYPE?= xxx-disktype
BDEV?= /dev/md0
CDEV?= /dev/md0
IMAGE_DEPS?= ${CBIN}
CLEANFILES+= ${IMAGE}.fs
# These are all the parameters for the root fs:
NBLKS?= 512
# args: old fmt, minfree, opt, ...
NEWFSARGS?= -O -m 0 -o space
do_mount:
-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
mount ${BDEV} ${MOUNT_POINT}
do_files:
mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
do_umount:
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
-umount ${MOUNT_POINT}

View File

@ -0,0 +1,11 @@
#
# $NetBSD: Make.static,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# This is logically appended to some other makefile, i.e.
# using: make -f Makefile -f $(OUTDIR)/Make.static ...
STRIP_CMD=strip
${OUTDIR}/${PROG} : ${OBJS} ${LIBC} ${DPADD}
${CC} -static ${LDFLAGS} -o ${OUTDIR}/${PROG} ${OBJS} ${LDADD}
${STRIP_CMD} ${OUTDIR}/${PROG}

View File

@ -0,0 +1,44 @@
# $NetBSD: RunList.awk,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
BEGIN {
printf("cd ${CURDIR}\n");
printf("\n");
}
/^$/ || /^#/ {
print $0;
next;
}
$1 == "COPY" {
printf("echo '%s'\n", $0);
printf("cp %s ${TARGDIR}/%s\n", $2, $3);
next;
}
$1 == "LINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
next;
}
$1 == "SYMLINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; rm -f %s; ln -s %s %s)\n", $3, $2, $3);
next;
}
$1 == "SPECIAL" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR};");
for (i = 2; i <= NF; i++)
printf(" %s", $i);
printf(")\n");
next;
}
{
printf("echo '%s'\n", $0);
printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR);
printf("exit 1\n");
exit 1;
}
END {
printf("\n");
printf("exit 0\n");
exit 0;
}

View File

@ -0,0 +1,14 @@
#!/bin/sh
# $NetBSD: RunList.sh,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
if [ "X$1" = "X-d" ]; then
SHELLCMD=cat
shift
else
SHELLCMD="sh -e"
fi
cat "$@" |
awk -f ${TOPDIR}/common/RunList.awk |
${SHELLCMD}

View File

@ -0,0 +1,228 @@
# $NetBSD: install.md,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Jason R. Thorpe.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
# machine dependent section of installation/upgrade script.
#
# Machine-dependent install sets
# MDSETS="xbin xman xinc xcon" XXX
MDSETS=""
md_set_term() {
if [ ! -z "$TERM" ]; then
return
fi
echo -n "Specify terminal type [sun]: "
getresp "sun"
TERM="$resp"
export TERM
}
__mount_kernfs() {
# Make sure kernfs is mounted.
if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
mkdir /kern > /dev/null 2>&1
/sbin/mount_kernfs /kern /kern
fi
}
md_makerootwritable() {
# Just remount the root device read-write.
if [ ! -e /tmp/root_writable ]; then
echo "Remounting root read-write..."
__mount_kernfs
mount -u /kern/rootdev /
swapctl -a /kern/rootdev
cp /dev/null /tmp/root_writable
fi
}
md_get_diskdevs() {
# return available disk devices
__mount_kernfs
sed -n -e '/^sd[0-9] /s/ .*//p' \
-e '/^xd[0-9] /s/ .*//p' \
-e '/^xy[0-9] /s/ .*//p' \
< /kern/msgbuf | sort -u
}
md_get_cddevs() {
# return available CDROM devices
__mount_kernfs
sed -n -e '/^cd[0-9] /s/ .*//p' \
< /kern/msgbuf | sort -u
}
md_get_ifdevs() {
# return available network devices
__mount_kernfs
sed -n -e '/^ie[0-9] /s/ .*//p' \
-e '/^le[0-9] /s/ .*//p' \
< /kern/msgbuf | sort -u
}
md_get_partition_range() {
# return an expression describing the valid partition id's
echo '[a-h]'
}
md_installboot() {
# install the boot block on disk $1
echo "Installing boot block..."
( cd /usr/mdec ;\
cp -p ./ufsboot /mnt/ufsboot ;\
sync ; sleep 1 ; sync ;\
./installboot -v /mnt/ufsboot bootxx /dev/r${1}a )
echo "done."
}
md_native_fstype() {
}
md_native_fsopts() {
}
md_prep_disklabel() {
# $1 is the root disk
echo -n "Do you wish to edit the disklabel on ${1}? [y]"
getresp "y"
case "$resp" in
y*|Y*) ;;
*) return ;;
esac
# display example
cat << \__md_prep_disklabel_1
Here is an example of what the partition information will look like once
you have entered the disklabel editor. Disk partition sizes and offsets
are in sector (most likely 512 bytes) units. Make sure all partitions
start on a cylinder boundary (c/t/s == XXX/0/0).
[Example]
partition start (c/t/s) nblks (c/t/s) type
a (root) 0 (0/00/00) 31392 (109/00/00) 4.2BSD
b (swap) 31392 (109/00/00) 73440 (255/00/00) swap
c (disk) 0 (0/00/00) 1070496 (3717/00/00) unused
d (user) 104832 (364/00/00) 30528 (106/00/00) 4.2BSD
e (user) 135360 (470/00/00) 40896 (142/00/00) 4.2BSD
f (user) 176256 (612/00/00) 92160 (320/00/00) 4.2BSD
g (user) 268416 (932/00/00) 802080 (2785/00/00) 4.2BSD
[End of example]
Hit the <return> key when you have read this...
__md_prep_disklabel_1
getresp ""
edlabel /dev/r${1}c
}
md_copy_kernel() {
echo -n "Copying kernel..."
cp -p /netbsd /mnt/netbsd
echo "done."
}
md_welcome_banner() {
if [ "$MODE" = "install" ]; then
echo ""
echo "Welcome to the NetBSD/sun3x ${VERSION} installation program."
cat << \__welcome_banner_1
This program is designed to help you put NetBSD on your disk,
in a simple and rational way. You'll be asked several questions,
and it would probably be useful to have your disk's hardware
manual, the installation notes, and a calculator handy.
__welcome_banner_1
else
echo ""
echo "Welcome to the NetBSD/sun3x ${VERSION} upgrade program."
cat << \__welcome_banner_2
This program is designed to help you upgrade your NetBSD system in a
simple and rational way.
As a reminder, installing the `etc' binary set is NOT recommended.
Once the rest of your system has been upgraded, you should manually
merge any changes to files in the `etc' set into those files which
already exist on your system.
__welcome_banner_2
fi
cat << \__welcome_banner_3
As with anything which modifies your disk's contents, this
program can cause SIGNIFICANT data loss, and you are advised
to make sure your data is backed up before beginning the
installation process.
Default answers are displayed in brackets after the questions.
You can hit Control-C at any time to quit, but if you do so at a
prompt, you may have to hit return. Also, quitting in the middle of
installation may leave your system in an inconsistent state.
__welcome_banner_3
}
md_not_going_to_install() {
cat << \__not_going_to_install_1
OK, then. Enter `halt' at the prompt to halt the machine. Once the
machine has halted, power-cycle the system to load new boot code.
__not_going_to_install_1
}
md_congrats() {
local what;
if [ "$MODE" = "install" ]; then
what="installed";
else
what="upgraded";
fi
cat << __congratulations_1
CONGRATULATIONS! You have successfully $what NetBSD!
To boot the installed system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.
__congratulations_1
}

View File

@ -0,0 +1,34 @@
#
# $NetBSD: mini_bin.list,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# miniroot files from /bin:
# Extras not in ../../miniroot/list:
# date ps rmdir
COPY ${DESTDIR}/bin/cat bin
COPY ${DESTDIR}/bin/chmod bin
COPY ${DESTDIR}/bin/cp bin
COPY ${DESTDIR}/bin/date bin
COPY ${DESTDIR}/bin/dd bin
COPY ${DESTDIR}/bin/df bin
COPY ${DESTDIR}/bin/ed bin
COPY ${DESTDIR}/bin/expr bin
COPY ${DESTDIR}/bin/hostname bin
COPY ${DESTDIR}/bin/kill bin
COPY ${DESTDIR}/bin/ln bin
COPY ${DESTDIR}/bin/ls bin
COPY ${DESTDIR}/bin/mkdir bin
COPY ${DESTDIR}/bin/mt bin
COPY ${DESTDIR}/bin/mv bin
COPY ${DESTDIR}/bin/ps bin
COPY ${DESTDIR}/bin/pwd bin
COPY ${DESTDIR}/bin/rm bin
COPY ${DESTDIR}/bin/rmdir bin
COPY ${DESTDIR}/bin/sh bin
COPY ${DESTDIR}/bin/sleep bin
COPY ${DESTDIR}/bin/stty bin
COPY ${DESTDIR}/bin/sync bin
COPY ${DESTDIR}/bin/test bin
LINK bin/test bin/[

View File

@ -0,0 +1,37 @@
#
# $NetBSD: mini_sbin.list,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# miniroot files from /sbin:
# Extras not in ../../miniroot/list:
# disklabel dmesg edlabel mount_kernfs restore
COPY ${DESTDIR}/sbin/dmesg sbin
COPY ${DESTDIR}/sbin/edlabel sbin
COPY ${DESTDIR}/sbin/fsck sbin
COPY ${DESTDIR}/sbin/fsck_ffs sbin
COPY ${DESTDIR}/sbin/ifconfig sbin
COPY ${DESTDIR}/sbin/init sbin
COPY ${DESTDIR}/sbin/mknod sbin
COPY ${DESTDIR}/sbin/mount sbin
COPY ${DESTDIR}/sbin/mount_cd9660 sbin
COPY ${DESTDIR}/sbin/mount_ffs sbin
COPY ${DESTDIR}/sbin/mount_kernfs sbin
COPY ${DESTDIR}/sbin/mount_nfs sbin
COPY ${DESTDIR}/sbin/newfs sbin
COPY ${DESTDIR}/sbin/ping sbin
COPY ${DESTDIR}/sbin/reboot sbin
LINK sbin/reboot sbin/halt
COPY ${DESTDIR}/sbin/restore sbin
LINK sbin/restore sbin/rrestore
COPY ${DESTDIR}/sbin/route sbin
COPY ${DESTDIR}/sbin/shutdown sbin
COPY ${DESTDIR}/sbin/slattach sbin
COPY ${DESTDIR}/sbin/swapctl sbin
COPY ${DESTDIR}/sbin/umount sbin

View File

@ -0,0 +1,50 @@
#
# $NetBSD: mini_usr.list,v 1.1.1.1 1997/12/24 09:21:18 jeremy Exp $
#
# miniroot files from /usr:
# Shared library stuff...
# libcurses: vi
# libedit: ftp
# libgnumalloc: grep, sort
# libtermcap: ftp, less, vi
# libutil: rdate
SPECIAL cd usr; ln -s lib libexec
COPY ${DESTDIR}/usr/libexec/ld.so usr/lib
COPY ${DESTDIR}/usr/lib/libc.so.12.20 usr/lib
COPY ${DESTDIR}/usr/lib/libcurses.so.2.1 usr/lib
COPY ${DESTDIR}/usr/lib/libedit.so.1.0 usr/lib
COPY ${DESTDIR}/usr/lib/libgnumalloc.so.0.0 usr/lib
COPY ${DESTDIR}/usr/lib/libtermcap.so.0.0 usr/lib
COPY ${DESTDIR}/usr/lib/libutil.so.4.2 usr/lib
# usr.sbin:
COPY ${DESTDIR}/usr/sbin/chown usr/sbin
COPY ${DESTDIR}/usr/sbin/eeprom usr/sbin
COPY ${DESTDIR}/usr/sbin/rdate usr/sbin
COPY ${DESTDIR}/usr/sbin/update usr/sbin
# usr.bin:
LINK usr/sbin/chown usr/bin/chgrp
COPY ${DESTDIR}/usr/bin/chflags usr/bin
COPY ${DESTDIR}/usr/bin/cksum usr/bin
COPY ${DESTDIR}/usr/bin/cmp usr/bin
COPY ${DESTDIR}/usr/bin/ftp usr/bin
COPY ${DESTDIR}/usr/bin/less usr/bin
LINK usr/bin/less usr/bin/more
COPY ${DESTDIR}/usr/bin/rsh usr/bin
COPY ${DESTDIR}/usr/bin/sed usr/bin
COPY ${DESTDIR}/usr/bin/strings usr/bin
COPY ${DESTDIR}/usr/bin/tip usr/bin
COPY ${DESTDIR}/usr/bin/vi usr/bin
# gnu/usr.bin:
# COPY ${DESTDIR}/usr/bin/grep usr/bin
COPY ${DESTDIR}/usr/bin/gzip usr/bin
LINK usr/bin/gzip usr/bin/gunzip
LINK usr/bin/gzip usr/bin/gzcat
COPY ${DESTDIR}/usr/bin/sort usr/bin
COPY ${DESTDIR}/usr/bin/tar usr/bin

View File

@ -0,0 +1,50 @@
#
# $NetBSD: miniroot.list,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
# These are scripts:
COPY ${DESTDIR}/usr/bin/false bin
COPY ${DESTDIR}/usr/bin/true bin
# From usr/mdec:
COPY ${DESTDIR}/usr/mdec/bootxx usr/mdec
COPY ${DESTDIR}/usr/mdec/installboot usr/mdec
COPY ${DESTDIR}/usr/mdec/netboot usr/mdec
COPY ${DESTDIR}/usr/mdec/tapeboot usr/mdec
COPY ${DESTDIR}/usr/mdec/ufsboot usr/mdec
LINK usr/mdec/ufsboot ufsboot
# various files that we need in /etc for the install
COPY ${DESTDIR}/etc/group etc
COPY ${DESTDIR}/etc/master.passwd etc
COPY ${DESTDIR}/etc/passwd etc
COPY ${DESTDIR}/etc/protocols etc
COPY ${DESTDIR}/etc/pwd.db etc
COPY ${DESTDIR}/etc/services etc
COPY ${DESTDIR}/etc/spwd.db etc
# some /etc files get special handling (for MFS /tmp yuck)
COPY ${DESTDIR}/etc/disktab etc/disktab.shadow
SYMLINK /tmp/disktab.shadow etc/disktab
COPY ${TOPDIR}/common/mr.fstab tmp/fstab.shadow
SYMLINK /tmp/fstab.shadow etc/fstab
SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
SYMLINK /tmp/hosts etc/hosts
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev
COPY ${DESTDIR}/dev/MAKEDEV.local dev
SPECIAL cd dev; sh MAKEDEV std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0
# copy the miniroot installation tools
COPY ${TOPDIR}/common/mr.profile .profile
COPY ${TOPDIR}/common/mr.termcap usr/share/misc/termcap
COPY ${TOPDIR}/common/install.md install.md
COPY ${OBJDIR}/install.sub install.sub
SPECIAL chmod 644 install.md install.sub
COPY ${TOPDIR}/../miniroot/install.sh install
COPY ${TOPDIR}/../miniroot/upgrade.sh upgrade
SPECIAL chmod 755 install upgrade

View File

@ -0,0 +1,106 @@
#
# $NetBSD: miniroot.tree,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
/set type=dir uname=root gname=wheel mode=0755
# .
.
# ./bin
bin
# ./bin
..
# ./dev
dev
# ./dev
..
# ./etc
etc
# ./etc
..
# ./kern
kern
# ./kern
..
# ./mnt
mnt
# ./mnt
..
# ./mnt2
mnt2
# ./mnt2
..
# ./proc
proc
# ./proc
..
# ./sbin
sbin
# ./sbin
..
# ./tmp
tmp
# ./tmp
..
# ./usr
usr
# ./usr/bin
bin
# ./usr/bin
..
# ./usr/lib
lib
# ./usr/lib
..
# ./usr/mdec
mdec
# ./usr/mdec
..
# ./usr/sbin
sbin
# ./usr/sbin
..
# ./usr/share
share
# ./usr/share/misc
misc
# ./usr/share/misc
..
# ./usr/share
..
# ./usr
..
# ./var
var
# ./var/tmp
tmp mode=01777
# ./var/tmp/vi.recover
vi.recover mode=01777
# ./var/tmp/vi.recover
..
# ./var/tmp
..
# ./var
..

View File

@ -0,0 +1,32 @@
#
# $NetBSD: mr.disktab,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
# Disk geometry and partition layout tables.
# Key:
# dt controller type
# ty type of disk (fixed, removeable, simulated)
# d[0-4] drive-type-dependent parameters
# ns #sectors/track
# nt #tracks/cylinder
# nc #cylinders/disk
# sc #sectors/cylinder, nc*nt default
# su #sectors/unit, sc*nc default
# se sector size, DEV_BSIZE default
# rm rpm, 3600 default
# sf supports bad144-style bad sector forwarding
# sk sector skew per track, default 0
# cs sector skew per cylinder, default 0
# hs headswitch time, default 0
# ts one-cylinder seek time, default 0
# il sector interleave (n:1), 1 default
# bs boot block size, default BBSIZE
# sb superblock size, default SBSIZE
# o[a-h] partition offsets in sectors
# p[a-h] partition sizes in sectors
# b[a-h] partition block sizes in bytes
# f[a-h] partition fragment sizes in bytes
# t[a-h] partition types (filesystem, swap, etc)
#
# All partition sizes reserve space for bad sector tables.
# (5 cylinders needed for maintenance + replacement sectors)
#

View File

@ -0,0 +1,9 @@
#!/bin/sh
# $NetBSD: mr.etc.rc,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
# This is run by /sbin/init as:
# /bin/sh /etc/rc
# Just force init to go single-user...
echo "/etc/rc: miniroot forces single-user mode..."
exit 1

View File

@ -0,0 +1,3 @@
/kern /kern kernfs ro 0 0
/kern/rootdev / ffs rw 1 1
/kern/rootdev none swap sw 0 0

View File

@ -0,0 +1,55 @@
#
# $NetBSD: mr.profile,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Christopher G. Demetriou.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/
export PATH
TERM=ansi
export TERM
umask 022
# set up some sane defaults
echo intr '^C' kill '^U' erase '^?' werase '^W' newcrt
stty intr '^C' kill '^U' erase '^?' werase '^W' newcrt
# run update, so that installed software is written as it goes.
update
# get the terminal type?
# (nah, ansi is good enough)
# run the installation script.
echo 'To install NetBSD, enter the command: install'
echo 'Otherwise, enter the command: halt'
# /install XXX - Not yet...

View File

@ -0,0 +1,91 @@
#
# $NetBSD: mr.termcap,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
#
# Customized for installation on Sun machines.
#
dumb:\
:am:\
:co#80:\
:bl=^G:cr=^M:do=^J:sf=^J:
unknown:\
:gn:\
:tc=dumb:
other|none of the above, but not exactly unknown:\
:am:gn:\
:co#80:\
:cl=^M^J:do=^J:ho=^M:
arpanet|bussiplexer|dialup|ethernet|network|net|patch|plugboard|switch|network switch or dialup:\
:tc=unknown:
lpr|printer|print|printing|line printer:\
:hc:os:\
:co#132:li#66:\
:bl=^G:cr=^M:do=^J:ff=^L:le=^H:sf=^J:
#### ANSI terminals and terminal emulators
#
# See near the end of this file for details on ANSI conformance.
# Don't mess with these entries! Lots of other entries depend on them!
#
# (ansi: changed ":pt:" to ":it#8:" -- esr)
ansi|any ansi terminal with pessimistic assumptions:\
:am:bs:\
:co#80:it#8:li#24:\
:ce=\E[K:cl=\E[;H\E[2J:cm=\E[%i%d;%dH:do=\E[B:\
:ho=\E[H:le=\E[D:nd=\E[C:up=\E[A:
#
vt100|dec-vt100|vt100-am|vt100am|dec vt100:\
:bl=^G:cr=^M:it#8:\
:do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=2*\ED:\
:le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:cb=3\E[1K:\
:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
:if=/usr/share/tabset/vt100:\
:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:\
:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
#
sun|Sun Microsystems Workstation console:\
:am:bs:km:mi:ms:pt:\
:co#80:it#8:li#34:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:IC=\E[%d@:al=\E[L:\
:bl=^G:cd=\E[J:ce=\E[K:cl=^L:cm=\E[%i%d;%dH:cr=^M:\
:dc=\E[P:dl=\E[M:do=\E[B:ei=:ic=\E[@:im=:is=\E[1r:\
:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:kd=\E[B:kh=\E[H:\
:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:nd=\E[C:rs=\E[1r:\
:se=\E[m:sf=^J:so=\E[7m:ta=^I:up=\E[A:
#
xterm|vs100|xterm terminal emulator (X11R6 Window System):\
:am:bs:km:mi:ms:pt:xn:xo:\
:co#80:it#8:li#65:\
:@7=\E[[:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:F1=\E[23~:\
:F2=\E[24~:IC=\E[%d@:LE=\E[%dD:UP=\E[%dA:\
:ac=++\054\054..00II--``aaffgghhjjkkllmmnnooqqssttuuvvwwxx~~:\
:ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:\
:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:\
:ct=\E[3k:dc=\E[P:dl=\E[M:do=^J:ei=\E[4l:ho=\E[H:\
:ic=\E[@:im=\E[4h:\
:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\EOB:\
:ke=\E[?1l\E>:kh=\E[@:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
:ku=\EOA:le=^H:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\
:r2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<:\
:rc=\E8:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:ta=^I:\
:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:u6=\E[%d;%dR:\
:u7=\E[6n:u8=\E[?1;2c:u9=\E[c:ue=\E[m:up=\E[A:\
:us=\E[4m:
xterm24|vs100-24|xterm terminal emulator (24 lines) (X11R6 window system):\
:co#80:li#24:\
:tc=xterm:
xterm25|vs100-25|xterm terminal emulator (25 lines) (X11R6 window system):\
:co#80:li#24:\
:tc=xterm:
xterms|vs100s|xterm terminal emulator (small) (X11R6 window system):\
:tc=xterm24:

View File

@ -0,0 +1,21 @@
# $NetBSD: ramdisk.list,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev
SPECIAL cd dev; sh MAKEDEV std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0
SPECIAL /bin/rm dev/MAKEDEV
SPECIAL mkfifo dev/pipe
SPECIAL ln -s . usr
# various files that we need in /etc for the install
COPY ${TOPDIR}/common/rd.disktab etc/disktab
COPY ${TOPDIR}/common/rd.fstab etc/fstab
COPY ${TOPDIR}/common/rd.protocols etc/protocols
COPY ${TOPDIR}/common/rd.services etc/services
COPY ${TOPDIR}/common/rd.passwd etc/passwd
# and the RC file
COPY ${TOPDIR}/common/rd.sshrc .sshrc
COPY ${TOPDIR}/common/rd.welcome .welcome

View File

@ -0,0 +1,39 @@
#
# $NetBSD: ramdisk.tree,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
/set type=dir uname=root gname=wheel mode=0755
# .
.
# ./bin
bin
# ./bin
..
# ./dev
dev
# ./dev
..
# ./etc
etc
# ./etc
..
# ./mnt
mnt
# ./mnt
..
# ./sbin
sbin
# ./sbin
..
# ./tmp
tmp
# ./tmp
..
# ./usr will be a link to root

View File

@ -0,0 +1,2 @@
# $NetBSD: rd.disktab,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
# The ramdisk has no need for disktab (yet)

View File

@ -0,0 +1,2 @@
# $NetBSD: rd.fstab,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
/dev/md0 / ufs rw 1 1

View File

@ -0,0 +1 @@
root::0:0:NetBSD RAM-disk root:/root:/bin/sh

View File

@ -0,0 +1,6 @@
#
# etc/protocols (ramdisk version)
# $NetBSD: rd.protocols,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
ip 0 IP
icmp 1 ICMP

View File

@ -0,0 +1,56 @@
#
# etc/services (ramdisk version)
# $NetBSD: rd.services,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
tcpmux 1/tcp
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
daytime 13/tcp
daytime 13/udp
netstat 15/tcp
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp-data 20/tcp
ftp 21/tcp
telnet 23/tcp
smtp 25/tcp mail
time 37/tcp timserver
time 37/udp timserver
nameserver 42/tcp name # IEN 116
whois 43/tcp nicname
domain 53/tcp nameserver
domain 53/udp nameserver
bootps 67/udp
bootpc 68/udp
tftp 69/udp
#
rje 77/tcp netrjs
finger 79/tcp
link 87/tcp ttylink
kerberos 88/tcp krb5 # Kerberos v5
kerberos 88/udp
supdup 95/tcp
# 100 - reserved
hostnames 101/tcp hostname
iso-tsap 102/tcp tsap
#
sunrpc 111/tcp
sunrpc 111/udp
#
# UNIX specific services
#
exec 512/tcp
biff 512/udp comsat
login 513/tcp
who 513/udp whod
shell 514/tcp cmd
syslog 514/udp
printer 515/tcp spooler
talk 517/udp
ntalk 518/udp
route 520/udp router routed

View File

@ -0,0 +1,4 @@
# .sshrc
# $NetBSD: rd.sshrc,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
path /sbin:/bin
run cat /.welcome

View File

@ -0,0 +1,23 @@
Welcome to the NetBSD/sun3x RAMDISK root!
This environment is designed to do only three things:
1: Partititon your disk (use the command: edlabel /dev/rsd0c)
2: Copy a miniroot image into the swap partition (/dev/rsd0b)
3: Reboot (using the swap partition, i.e. /dev/sd?b).
Copying the miniroot can be done several ways, allowing
the source of the miniroot image to be on any of these:
boot tape, NFS server, TFTP server, rsh server
The easiest is loading from tape, which is done as follows:
mt -f /dev/nrst0 rewind
mt -f /dev/nrst0 fsf 2
dd bs=32k if=/dev/nrst0 of=/dev/rsd0b
(For help with other methods, please see the install notes.)
To reboot using the swap partition, first use "halt",
then at the PROM monitor prompt use a command like:
b sd(,,1) -s
To view this message again, type: cat /.welcome

View File

@ -0,0 +1,85 @@
#
# $NetBSD: rd_bin.conf,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
# common/rd_bin.conf - unified binary for the ramdisk.
#
# The ramdisk root has to stay small enough so the kernel
# can be loaded in less than one megabyte of ram, including
# uninitialized data (bss). Otherwise it will not work on
# the Sun3/50. This is not too hard, because the ONLY
# tools needed in this root are those that one might use
# to initialize the disk label and copy a miniroot image
# into the swap partiton. Everything else is done after
# the machine is rebooted from the miniroot.
#
# Note that the "ln" directives below are not really about
# filesystem links, but rather the ability of the resulting
# crunched binary to select the right program when argv[0]
# matches the names on right of the "ln prog" directive.
# For example, the shell can be run with argv[0]="-sh"
# (login shell convention) but no such file will exist.
# Similarly, one may want to run "init" as "oinit"...
#
# Notes about what is included (or not) and why:
#
# Include mknod incase I forgot some device nodes...
# Support copying miniroot from NFS, TFTP, or CDROM.
# Need mount_ffs, mount_ufs to remount the ramdisk.
#
# Might use cat to look at files (it's small anyway).
# Need for copying miniroot from tape: dd, mt
# Keep to allow minor fixes: ln, mkdir, mv
# Small and handy: cat, echo, pwd, sync
#
# Note: ssh has no "if", so "test" is useless. Also,
# left out: cp, chmod, rm. The ramdisk does not really
# need them, and they pull in fts_* from libc.
#
# Might use these to get the miniroot: rsh, tftp
#
# Assume gunzip can run elsewhere, i.e.:
# rsh gzcat sun3.miniroot.gz
# No need to extract archives either...
#
#
# Here are all the programs, ordered by source location:
# Special programs used to save space...
srcdirs distrib/utils
progs init_s ssh tls zcat
ln init_s init oinit
ln ssh sh
ln ssh -sh # login shell (not actual file name)
ln tls ls
# These are built with special flags to save a little space.
# The x_ prefix is just to make them unique among all srcdirs.
progs x_dd x_ifconfig x_route
ln x_dd dd
ln x_ifconfig ifconfig
ln x_route route
srcdirs sbin
progs edlabel mknod mount
progs mount_cd9660 mount_ffs mount_nfs
progs reboot umount
ln mount_ffs ffs mount_ufs ufs
ln mount_nfs nfs
ln mount_cd9660 cd9660
ln reboot halt
srcdirs bin
progs cat echo ln mkdir mt mv pwd sync
srcdirs usr.bin
progs rsh
# progs tftp
# srcdirs usr.sbin
# srcdirs gnu/usr.bin
# progs cpio, gzip, tar
# ln gzip gzcat gunzip
libs libhack.o -lrmt -lutil -lz

View File

@ -0,0 +1,46 @@
#
# $NetBSD: rd_bin.list,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
#
# copy the crunched binary, link to it, and kill it
COPY ${OBJDIR}/rd_bin rd_bin
# From /usr/src/distrib/utils:
LINK rd_bin sbin/init
LINK rd_bin sbin/ifconfig
LINK rd_bin sbin/edlabel
LINK rd_bin sbin/route
LINK rd_bin bin/dd
LINK rd_bin bin/ls
LINK rd_bin bin/rsh
LINK rd_bin bin/sh
LINK rd_bin bin/ssh
# LINK rd_bin bin/tftp
# From /usr/src/sbin:
LINK rd_bin sbin/halt
LINK rd_bin sbin/mknod
LINK rd_bin sbin/mount
LINK rd_bin sbin/mount_cd9660
LINK rd_bin sbin/mount_ffs
LINK rd_bin sbin/mount_nfs
LINK rd_bin sbin/mount_ufs
LINK rd_bin sbin/reboot
LINK rd_bin sbin/umount
# From /usr/src/bin:
LINK rd_bin bin/cat
# LINK rd_bin bin/chmod
# LINK rd_bin bin/cp
LINK rd_bin bin/echo
LINK rd_bin bin/ln
LINK rd_bin bin/mkdir
LINK rd_bin bin/mt
LINK rd_bin bin/mv
LINK rd_bin bin/pwd
# LINK rd_bin bin/rm
LINK rd_bin bin/sync
LINK rd_bin bin/zcat
SPECIAL rm rd_bin

View File

@ -0,0 +1,226 @@
/* $NetBSD: rdsetroot.c,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: rdsetroot.c,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
*/
/*
* Copy a ramdisk image into the space reserved for it.
* Kernel variables: md_root_size, md_root_image
*/
#include <sys/types.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <stdio.h>
#include <a.out.h>
extern off_t lseek();
struct exec head;
char *file;
/* Virtual addresses of the symbols we frob. */
long rd_root_image_va, rd_root_size_va;
/* Offsets relative to start of data segment. */
long rd_root_image_off, rd_root_size_off;
/* value in the location at rd_root_size_off */
int rd_root_size_val;
/* pointers to pieces of mapped file */
char *dataseg;
/* and lengths */
int data_len;
int data_off;
int data_pgoff;
main(argc,argv)
char **argv;
{
int fd, n;
int *ip;
char *cp;
if (argc < 2) {
printf("%s: missing file name\n", argv[0]);
exit(1);
}
file = argv[1];
fd = open(file, O_RDWR);
if (fd < 0) {
perror(file);
exit(1);
}
n = read(fd, &head, sizeof(head));
if (n < sizeof(head)) {
printf("%s: reading header\n", file);
exit(1);
}
if (N_BADMAG(head)) {
printf("%s: bad magic number\n");
exit(1);
}
#ifdef DEBUG
printf(" text: %9d\n", head.a_text);
printf(" data: %9d\n", head.a_data);
printf(" bss: %9d\n", head.a_bss);
printf(" syms: %9d\n", head.a_syms);
printf("entry: 0x%08X\n", head.a_entry);
printf("trsiz: %9d\n", head.a_trsize);
printf("drsiz: %9d\n", head.a_drsize);
#endif
if (head.a_syms <= 0) {
printf("%s: no symbols\n", file);
exit(1);
}
if (head.a_trsize ||
head.a_drsize)
{
printf("%s: has relocations\n");
exit(1);
}
find_rd_root_image(file);
/*
* Map in the whole data segment.
* The file offset needs to be page aligned.
*/
data_off = N_DATOFF(head);
data_len = head.a_data;
/* align... */
data_pgoff = N_PAGSIZ(head) - 1;
data_pgoff &= data_off;
data_off -= data_pgoff;
data_len += data_pgoff;
/* map in in... */
dataseg = mmap(NULL, /* any address is ok */
data_len, /* length */
PROT_READ | PROT_WRITE,
MAP_SHARED,
fd, data_off);
if ((long)dataseg == -1) {
printf("%s: can not map data seg\n", file);
perror(file);
exit(1);
}
dataseg += data_pgoff;
/*
* Find value in the location: rd_root_size
*/
ip = (int*) (dataseg + rd_root_size_off);
rd_root_size_val = *ip;
#ifdef DEBUG
printf("md_root_size val: 0x%08X (%d blocks)\n",
rd_root_size_val, (rd_root_size_val >> 9));
#endif
/*
* Copy the symbol table and string table.
*/
#ifdef DEBUG
printf("copying root image...\n");
#endif
n = read(0, dataseg + rd_root_image_off,
rd_root_size_val);
if (n < 0) {
perror("read");
exit(1);
}
msync(dataseg - data_pgoff, data_len, 0);
#ifdef DEBUG
printf("...copied %d bytes\n", n);
#endif
close(fd);
exit(0);
}
/*
* Find locations of the symbols to patch.
*/
struct nlist wantsyms[] = {
{ "_md_root_size", 0 },
{ "_md_root_image", 0 },
{ NULL, 0 },
};
find_rd_root_image(file)
char *file;
{
int data_va;
int std_entry;
if (nlist(file, wantsyms)) {
printf("%s: no md_root_image symbols?\n", file);
exit(1);
}
std_entry = N_TXTADDR(head) +
(head.a_entry & (N_PAGSIZ(head)-1));
data_va = N_DATADDR(head);
if (head.a_entry != std_entry) {
printf("%s: warning: non-standard entry point: 0x%08x\n",
file, head.a_entry);
printf("\texpecting entry=0x%X\n", std_entry);
data_va += (head.a_entry - std_entry);
}
rd_root_size_off = wantsyms[0].n_value - data_va;
rd_root_image_off = wantsyms[1].n_value - data_va;
#ifdef DEBUG
printf(".data segment va: 0x%08X\n", data_va);
printf("md_root_size va: 0x%08X\n", wantsyms[0].n_value);
printf("md_root_image va: 0x%08X\n", wantsyms[1].n_value);
printf("md_root_size off: 0x%08X\n", rd_root_size_off);
printf("md_root_image off: 0x%08X\n", rd_root_image_off);
#endif
/*
* Sanity check locations of db_* symbols
*/
if (rd_root_image_off < 0 || rd_root_image_off >= head.a_data) {
printf("%s: md_root_image not in data segment?\n", file);
exit(1);
}
if (rd_root_size_off < 0 || rd_root_size_off >= head.a_data) {
printf("%s: md_root_size not in data segment?\n", file);
exit(1);
}
}

View File

@ -0,0 +1,10 @@
*_stub.c
*.lo
grep
install.sub
less
miniroot.*
mini_usr
mini_usr.*
tip
vi

View File

@ -0,0 +1,63 @@
# $NetBSD: Makefile,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
TOP= ${.CURDIR}/..
# This include just sets REV=XX
.include "${TOP}/Makefile.inc"
IMAGE= miniroot
#CBIN= mini_usr
TREE= ${TOP}/common/${IMAGE}.tree
LISTS= ${TOP}/common/${IMAGE}.list \
${TOP}/common/mini_sbin.list \
${TOP}/common/mini_bin.list \
${TOP}/common/mini_usr.list
KERNEL=${SRCSYSDIR}/arch/sun3x/compile/GENERIC/netbsd
MOUNT_POINT= /mnt
BDEV= /dev/sd1b
CDEV= /dev/rsd1b
# These are all the parameters for the miniroot: (8MB)
DISKTYPE= miniroot
NBLKS= 16384
# old format, minfree, opt, b/i trks, sects, cpg
NEWFSARGS= -O -m 0 -o space -i 8192 -t 8 -u 32 -c 16
CLEANFILES= ${IMAGE}.gz install.sub
${IMAGE}.gz: ${TREE} ${LISTS} install.sub
-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
mount ${BDEV} ${MOUNT_POINT}
mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
cp ${KERNEL} ${MOUNT_POINT}/netbsd
TOPDIR=${TOP} CURDIR=${.CURDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
sync ; sleep 1 ; sync
cd ${MOUNT_POINT} ;\
usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${CDEV}
sync
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
-umount ${MOUNT_POINT}
dd if=${CDEV} bs=16b count=`expr ${NBLKS} / 16` |\
gzip > ${IMAGE}.tmp
-mv -f ${IMAGE}.tmp ${IMAGE}.gz
# Do not delete this if I change my mind and kill make...
.PRECIOUS: ${IMAGE}.gz
install.sub : ${TOP}/../miniroot/install.sub
sed -e "/^VERSION=/s/=.*/=${REV}/" < $? > $@
clean cleandir:
-rm -f a.out core *.core *.o
-rm -f ${CLEANFILES}
# Standard rules needed by the above...
.include <bsd.obj.mk>

View File

@ -0,0 +1,6 @@
*_stub.c
*.lo
ramdisk.fs
rd_bin
rd_bin.*
rdsetroot

View File

@ -0,0 +1,12 @@
#!/bin/sh
# $NetBSD: Findrefs,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
# Small helper to find out who pulls in X
[ "$1" ] || { echo "$0: match_string" ; exit 1; }
for f in *.lo
do
nm -p $f | grep "$1" && echo $f
done

View File

@ -0,0 +1,73 @@
# $NetBSD: Makefile,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
TOP= ${.CURDIR}/..
# This include just sets REV=XX
.include "${TOP}/Makefile.inc"
IMAGE= ramdisk
CBIN= rd_bin
TREE= ${TOP}/common/${IMAGE}.tree
LISTS= ${TOP}/common/${CBIN}.list \
${TOP}/common/${IMAGE}.list
KERNEL=${SRCSYSDIR}/arch/sun3x/compile/RAMDISK/netbsd
MOUNT_POINT= /mnt
#BDEV= /dev/md0
#CDEV= /dev/md0
BDEV= /dev/sd1b
CDEV= /dev/rsd1b
# These are all the parameters for the root fs: (256K)
DISKTYPE= rdroot
NBLKS= 512
# old format, minfree, opt, b/i trks, sects, cpg
NEWFSARGS= -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16
CLEANFILES= netbsd-rd rdsetroot ${IMAGE}.fs
netbsd-rd : rdsetroot ${IMAGE}.fs
cp ${KERNEL} netbsd-tmp
./rdsetroot netbsd-tmp < ${IMAGE}.fs
-mv -f netbsd-tmp $@
rdsetroot: ${TOP}/common/rdsetroot.c
$(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c
${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
mount ${BDEV} ${MOUNT_POINT}
mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
sync
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
-umount ${MOUNT_POINT}
dd if=${CDEV} of=$@ bs=16b \
count=`expr ${NBLKS} / 16`
# Do not delete this if I change my mind and kill make...
.PRECIOUS: ${IMAGE}.fs
# Rules for making ${CBIN} ...
.include "${TOP}/common/Make.crunch"
# This is listed in rd_bin.conf but is built here.
${CBIN} : libhack.o
# Use stubs to eliminate some large stuff from libc
HACKSRC=${TOP}/../utils/libhack
.include "${HACKSRC}/Makefile.inc"
clean cleandir:
-rm -f a.out core *.core *.o
-rm -f ${CLEANFILES}
# Standard rules needed by the above...
.include <bsd.obj.mk>

View File

@ -0,0 +1,16 @@
#!/bin/sh
# $NetBSD: Showsyms,v 1.1.1.1 1997/12/24 09:21:19 jeremy Exp $
# Small helper to print out symbols in a useful order.
tf=_tmp$$
nm -n rd_bin.syms | egrep -v ' (gcc2|___gnu)_compiled' > $tf
grep -i ' u ' $tf
grep -i ' a ' $tf
grep -i ' t ' $tf
grep -i ' d ' $tf
grep -i ' b ' $tf
rm -f $tf
nm -p rd_bin.syms | grep -i ' c '

View File

@ -0,0 +1,9 @@
# from: @(#)Makefile 8.2 (Berkeley) 2/16/94
# $NetBSD: Makefile,v 1.1.1.1 1997/12/24 09:27:34 jeremy Exp $
MAN= isr_add.9
MLINKS= isr_add.9 isr_add_autovect.9 isr_add.9 isr_add_vectored.9 \
isr_add.9 isr_add_custom.9
MANSUBDIR=/sun3x
.include <bsd.man.mk>

View File

@ -0,0 +1,129 @@
.\" $NetBSD: isr_add.9,v 1.1.1.1 1997/12/24 09:27:34 jeremy Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Jeremy Cooper.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the NetBSD
.\" Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE
.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 21, 1997
.Dt ISR_ADD 9 sun3
.Os NetBSD
.Sh NAME
.Nm isr_add ,
.Nm isr_add_autovect ,
.Nm isr_add_vectored ,
.Nm isr_add_custom
.Nd establish interrupt handler
.Sh SYNOPSIS
.Fd #include <machine/autoconf.h>
.Bd -literal
typedef int (*isr_func_t)(void *);
.Ed
.Ft void
.Fn isr_add_autovect "isr_func_t fun" "void *arg" "int level"
.Ft void
.Fn isr_add_vectored "isr_func_t fun" "void *arg" "int pri" "int vec"
.Ft void
.Fn isr_add_custom "int level" "void *fun"
.Sh DESCRIPTION
The
.Nm
functions establish interrupt handlers into the system interrupt dispatch table,
typically called during the autoconfiguration process for a device.
.Pp
There are two types of interrupts in the Motorola 68000 architecture,
which differ in the way that an interrupt request is mapped to a dispatch
function within the interrupt vector table.
.Pp
When the CPU detects an asserted signal on one of its interrupt request lines,
it stops normal instruction execution and begins an interrupt acknowledge
sequence on the system bus.
During this cycle the interrupting device directs how the CPU is to dispatch
the interrupt request.
.Pp
If the interrupting device is sophisticated enough,
it provides an 8-bit interrupt vector number to the CPU and a
.Dq vectored
interrupt occurs.
This vector number points to a vector entry within the interrupt
vector table to which instruction execution is immediately transfered.
.Pp
If the interrupting device cannot provide a vector number, it asserts a
specialized bus line and an
.Dq autovectored
interrupt occurs.
The vector number to use is determined by adding the interrupt priority (0-6)
to an autovector base (typically 0x18).
.Pp
.Bl -tag -width isr_add_autovec
.It Fn isr_add_autovect
Adds the function
.Fa fun
to the list of interrupt handlers to be called during an autovectored interrupt
of priority
.Fa level .
The pointer
.Fa arg
is passed to the function as its first argument.
.It Fn isr_add_vectored
Adds the function
.Fa fun
to the list of interrupt handlers to be called during a vectored interrupts of
priority
.Fa pri
at dispatch vector number
.Fa vec .
The pointer
.Fa arg
is passed to the function as its first argument.
.It Fn isr_add_custom
Establish function
.Fa fun
as the interrupt handler for vector
.Fa level .
The autovector base number is automatically added to
.Fa level .
.Pp
.Fa fun
is called directly as the dispatch handler and must handle all of the specifics
of saving the processor state and returning from a processor exception.
These requirements generally dictate that
.Fa fun
be written in assembler.
.El
.Sh "CODE REFERENCES"
.Fd src/sys/arch/sun3/sun3/isr.c
.Sh "REFERENCES"
MC68030 User's Manual, Third edition, MC68030UM/AD Rev 2, Motorola Inc.
.Sh "BUGS"
There is no way to remove a handler once it has been added.