# cd* SCSI compact discs
# ch* SCSI changers
# vnd* vnode pseudo-disks
+# rd* "ramdisk" pseudo-disks
# ccd* concatenated disk driver
#
# Terminal ports:
raminst)
sh MAKEDEV std
sh MAKEDEV sd0 sd1 sd2 sd3 st0 st1 cd0 cd1
- sh MAKEDEV grf0 grf1 ttye0
+ sh MAKEDEV rd0
sh MAKEDEV tty00 tty01 pty0
;;
umask 2 ; unit=`expr $i : '.*[^0-9]\([0-9]*\)'`
case $i in
sd*) name=sd; blk=4; chr=13;;
- vnd*) name=vnd; blk=8; chr=19;;
- ccd*) name=ccd; blk=9; chr=20;;
+ vnd*) name=vnd; blk=14; chr=19;;
+ ccd*) name=ccd; blk=16; chr=20;;
+ rd*) name=rd; blk=17; chr=17;;
esac
rm -f $name$unit? r$name$unit?
case $unit in
pseudo-device loop
pseudo-device pty 64
pseudo-device random 1
+pseudo-device rd
+pseudo-device vnd 1
#options DDB
#options KTRACE
-options SYSCALL_DEBUG
+#options SYSCALL_DEBUG
options TCP_COMPAT_42
options COMPAT_43
options COMPAT_09
options MAXUSERS=20
#options TARGET_ELF
-config bsd swap generic
+# needed for rd miniroot support
+options MINIROOTSIZE=4096
+options RAMDISK_HOOKS
+
+
+config bsd swap on ofdisk0 and ofdisk1 and ofdisk2 root rd0a
ofroot* at root
pseudo-device loop
pseudo-device pty 64
pseudo-device random 1
+pseudo-device rd
file arch/powerpc/powerpc/db_interface.c ddb
file arch/powerpc/powerpc/db_trace.c ddb
+pseudo-device rd
+file dev/ramdisk.c rd needs-flag
+file arch/powerpc/powerpc/rd_root.c ramdisk_hooks
+major {rd = 17}
+
# FirePower specific code
#device firepower: openfirm
#attach firepower at root
-/* $OpenBSD: conf.c,v 1.2 1996/12/28 06:21:41 rahnds Exp $ */
+/* $OpenBSD: conf.c,v 1.3 1997/02/06 04:36:41 rahnds Exp $ */
/* $NetBSD: conf.c,v 1.2 1996/10/16 17:26:19 ws Exp $ */
/*
bdev_decl(ofd);
bdev_decl(sw);
+#include "rd.h"
+bdev_decl(rd);
+
+#include "vnd.h"
+bdev_decl(vnd);
+#include "ccd.h"
+bdev_decl(ccd);
+
struct bdevsw bdevsw[] = {
bdev_notdef(), /* 0 */
bdev_swap_init(1,sw), /* 1: swap pseudo device */
bdev_notdef(), /* 2 SCSI tape */
bdev_notdef(), /* 3 SCSI CD-ROM */
bdev_disk_init(NOFDISK,ofd), /* 4: Openfirmware disk */
+ bdev_notdef(), /* 5 unknown*/
+ bdev_notdef(), /* 6 unknown*/
+ bdev_notdef(), /* 7 unknown*/
+ bdev_lkm_dummy(), /* 8 */
+ bdev_lkm_dummy(), /* 9 */
+ bdev_lkm_dummy(), /* 10 */
+ bdev_lkm_dummy(), /* 11 */
+ bdev_lkm_dummy(), /* 12 */
+ bdev_lkm_dummy(), /* 13 */
+ bdev_disk_init(NVND,vnd), /* 14 vnode disk driver*/
+ bdev_notdef(), /* 15 unknown*/
+ bdev_disk_init(NCCD,ccd), /* 16 concatenated disk driver*/
+ bdev_disk_init(NRD,rd), /* 17 ram disk driver*/
+ bdev_notdef(), /* 18 unknown*/
};
int nblkdev = sizeof bdevsw / sizeof bdevsw[0];
#include <sd.h>
#include <st.h>
#include <cd.h>
-#include <vnd.h>
cdev_decl(st);
cdev_decl(sd);
cdev_decl(cd);
cdev_decl(vnd);
cdev_decl(ccd);
+cdev_decl(rd);
dev_decl(filedesc,open);
cdev_notdef(), /* 14 */
cdev_notdef(), /* 15 */
cdev_notdef(), /* 16 */
- cdev_rtc_init(NOFRTC,ofrtc), /* 17: Openfirmware RTC */
- cdev_notdef(), /* 18 */
+ cdev_disk_init(NRD,rd), /* 17 ram disk driver*/
+ cdev_rtc_init(NOFRTC,ofrtc), /* 18: Openfirmware RTC */
cdev_disk_init(NVND,vnd), /* 19: vnode disk */
cdev_tape_init(NST,st), /* 20: SCSI tape */
cdev_fd_init(1,filedesc), /* 21: file descriptor pseudo-dev */
/* 14 */ NODEV,
/* 15 */ NODEV,
/* 16 */ NODEV,
- /* 10 */ NODEV,
- /* 10 */ NODEV,
- /* 10 */ NODEV,
- /* 10 */ NODEV,
- /* 10 */ NODEV,
+ /* 17 */ 17,
+ /* 18 */ NODEV,
+ /* 19 */ NODEV,
+ /* 20 */ NODEV,
+ /* 21 */ NODEV,
};
/*
--- /dev/null
+/* $NetBSD: rd_root.c,v 1.2 1996/03/27 16:38:33 perry Exp $ */
+
+/*
+ * Copyright (c) 1995 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.
+ */
+
+#include <sys/param.h>
+#include <sys/reboot.h>
+
+#include <dev/ramdisk.h>
+
+extern int boothowto;
+
+#ifndef MINIROOTSIZE
+#define MINIROOTSIZE 512
+#endif
+
+#define ROOTBYTES (MINIROOTSIZE << DEV_BSHIFT)
+
+/*
+ * This array will be patched to contain a file-system image.
+ * See the program: src/distrib/sun3/common/rdsetroot.c
+ */
+int rd_root_size = ROOTBYTES;
+char rd_root_image[ROOTBYTES] = "|This is the root ramdisk!\n";
+
+/*
+ * This is called during autoconfig.
+ */
+void
+rd_attach_hook(unit, rd)
+ int unit;
+ struct rd_conf *rd;
+{
+ if (unit == 0) {
+ /* Setup root ramdisk */
+ rd->rd_addr = (caddr_t) rd_root_image;
+ rd->rd_size = (size_t) rd_root_size;
+ rd->rd_type = RD_KMEM_FIXED;
+ printf(" fixed, %d blocks", MINIROOTSIZE);
+ }
+}
+
+/*
+ * This is called during open (i.e. mountroot)
+ */
+void
+rd_open_hook(unit, rd)
+ int unit;
+ struct rd_conf *rd;
+{
+ if (unit == 0) {
+ /* The root ramdisk only works single-user. */
+ boothowto |= RB_SINGLE;
+ }
+}