diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-11-09 05:40:01 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-11-09 05:40:01 +0000 |
commit | b601fad21c9eeff12b1fe0d8b944ca44669a90ef (patch) | |
tree | 14749ec63d05b59810744bb80e632f54e745310d | |
parent | 834199768fa954adf98c0fabed182e9dd40f7e86 (diff) |
Add ramdisk support for pmax; untested but compiles
-rw-r--r-- | etc/etc.pmax/MAKEDEV | 18 | ||||
-rw-r--r-- | etc/etc.pmax/disktab | 5 | ||||
-rw-r--r-- | sys/arch/pmax/conf/RAMDISK | 98 | ||||
-rw-r--r-- | sys/arch/pmax/conf/files.pmax | 6 | ||||
-rw-r--r-- | sys/arch/pmax/pmax/conf.c | 10 | ||||
-rw-r--r-- | sys/arch/pmax/pmax/rd_root.c | 77 |
6 files changed, 213 insertions, 1 deletions
diff --git a/etc/etc.pmax/MAKEDEV b/etc/etc.pmax/MAKEDEV index 9c4ad645e8e..25e8ac91da8 100644 --- a/etc/etc.pmax/MAKEDEV +++ b/etc/etc.pmax/MAKEDEV @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: MAKEDEV,v 1.26 1998/10/15 21:24:53 art Exp $ +# $OpenBSD: MAKEDEV,v 1.27 1998/11/09 05:39:59 millert Exp $ # @(#)MAKEDEV 8.1 (Berkeley) 6/9/93 # @@ -119,6 +119,11 @@ all) sh $this fb0 fb1 fb2 ;; +raminst) + sh $this std + sh $this rz0 rz1 rz2 rz3 rz4 tz0 tz1 rd0 pty0 + sh $this fb0 fb1 fb2 + std) mknod console c 0 0 mknod drum c 1 0 ; chmod 640 drum ; chown root.kmem drum @@ -291,6 +296,17 @@ vnd*) umask 77 ;; +rd*) + umask 2 ; unit=`expr $i : '.*d\(.*\)'` + mknod rd${unit}a b 25 `expr $unit '*' 16 + 0` + mknod rd${unit}c b 25 `expr $unit '*' 16 + 2` + mknod rrd${unit}a c 92 `expr $unit '*' 16 + 0` + mknod rrd${unit}c c 92 `expr $unit '*' 16 + 2` + chown root.operator rd${unit}[ac] rrd${unit}[ac] + chmod 640 rd${unit}[ac] rrd${unit}[ac] + umask 77 + ;; + dc*) unit=`expr $i : 'dc\(.*\)'` case $unit in diff --git a/etc/etc.pmax/disktab b/etc/etc.pmax/disktab index 4ea8bfc4b17..0ef1cb85ca0 100644 --- a/etc/etc.pmax/disktab +++ b/etc/etc.pmax/disktab @@ -37,6 +37,11 @@ # four times `a' while `c' is always the entire disk. The # sum of `d', `e', and `f' is equal to `g' which is everything else. +rdroot|ramdiskroot|RAM-disk root FS image:\ + :ty=simulated:se#512:nc#24:nt#2:ns#128:\ + :ta=4.2BSD:oa#0:pa#6144:fa#512:ba#4096\ + :ob#0:pb#0:oc#0:pc#6144: + simpleroot:\ :ty=winchester:\ :dt=SCSI:\ diff --git a/sys/arch/pmax/conf/RAMDISK b/sys/arch/pmax/conf/RAMDISK new file mode 100644 index 00000000000..b814e117215 --- /dev/null +++ b/sys/arch/pmax/conf/RAMDISK @@ -0,0 +1,98 @@ +# +# RAMDISK kernel for the distribition ramdisk +# + +machine pmax mips # machine type and subtype + +# generic mips support +option CPU_R3000 # R2000/R3000 support +option MIPS1 # R2000/R3000 support +# support for specific models of decstation +option DS3100 # PMAX (kn01) decstation 2100, 3100 +option DS5000_25 # MAXINE (kn02ca/xine) +option DS5000_100 # 3MIN (kn02ba/kmin) +option DS5000_200 # 3MAX (kn02) +option DS5000_240 # 3MAXPLUS (kn03) +# timezone stuff +option TIMEZONE=0 +option DST=0 # use daylight savings rules + +maxusers 4 + +# standard system options +option SWAPPAGER # swap pager (anonymous and swap space) +option VNODEPAGER # vnode pager (mapped files) +option DEVPAGER # device pager (mapped devices) +# the usual stuff +option NATIVE_ELF # elf is our native binary format +# the usual filesystems +option FFS # fast filesystem +option FIFO # posix fifo support +option CD9660 # iso9660 cdrom filesystem +option MSDOSFS # msdos filesystem +option KERNFS # kernel data-structure filesystem +# networking +option INET # the networking stuff +option NFSCLIENT # nfs client code + +option RAMDISK_HOOKS +option MINIROOTSIZE=6144 # 3meg ramdisk + +config bsd root on rd0a swap on rd0b + +mainbus0 at root +cpu* at mainbus0 +# turbochannel bus +tc* at mainbus0 # all but PMAXes have a turbochannel +cfb0 at tc? # framebuffer (color) +mfb0 at tc? # framebuffer (mono) +sfb0 at tc? +le0 at tc? # decstation 5000/200 baseboard +le* at tc? # other lance network interfaces +# ioasic standard baseboard options (5000/2x, 5000/1xx, 5000/2[46]0) +ioasic0 at tc? +clock0 at ioasic? offset? # rtc +asc0 at ioasic? offset? # system scsi subslot +scc0 at ioasic? offset? +le0 at ioasic? offset? # tc onboard lance +scc1 at ioasic? offset? # not present on maxine +# MAXINE-only ioasic baseboard devices and on-baseboard "options" +xcfb0 at tc? # tc framebuffer "option" +dtop0 at ioasic0 offset? # destop bus, lk501 kbd, mouse +# 5000/200-only (aka 3MAX aka KN02) baseboard devices (tc but no ioasic) +clock0 at mainbus0 # rtc +dc0 at mainbus0 +le0 at tc? # tc ether "option" on baseboard +asc0 at tc? # tc scsi "option" on baseboard +# for now, pretend this machine has an ioasic +dc0 at ioasic? offset? # dc7083 four-port dz device +# 2100/3100-only (aka PMAX aka KN01) baseboard devices. +clock0 at mainbus0 # rtc +pm0 at mainbus0 # 3100 onboard fb +dc0 at mainbus0 # dc7083 four-port dz device +le* at mainbus0 # 3100 onboard lance +sii0 at mainbus0 # onboard scsi +# the scsi busses +oldscsibus* at sii? +oldscsibus* at asc? +# scsi configuration for old 4.4bsd/pmax decstation scsi driver +rz0 at oldscsibus? target ? drive ? +rz1 at oldscsibus? target ? drive ? +rz2 at oldscsibus? target ? drive ? +rz3 at oldscsibus? target ? drive ? +rz4 at oldscsibus? target ? drive ? +rz5 at oldscsibus? target ? drive ? +rz6 at oldscsibus? target ? drive ? +tz0 at oldscsibus? target ? drive ? +tz1 at oldscsibus? target ? drive ? + +led0 at mainbus0 # [23]100 back panel leds + +pseudo-device loop 1 +#pseudo-device sl 1 # serial-line ip ports +#pseudo-device ppp 1 # point ot point ip ports +pseudo-device rasterconsole 1 # nb: raster console requires "fb" +pseudo-device fb 1 # up to 3 framebuffers +#pseudo-device bpfilter 16 # packet filter ports +#pseudo-device pty 64 # pseudo ptys +pseudo-device rd 1 # ramdisk diff --git a/sys/arch/pmax/conf/files.pmax b/sys/arch/pmax/conf/files.pmax index bca52fcc1f8..e424821c1c3 100644 --- a/sys/arch/pmax/conf/files.pmax +++ b/sys/arch/pmax/conf/files.pmax @@ -64,6 +64,12 @@ include "../../../scsi/files.scsi" major { tz = 10 } major { rz = 21 } +# RAM Disk for install floppy +pseudo-device rd +file dev/ramdisk.c rd needs-flag +file arch/pmax/pmax/rd_root.c ramdisk_hooks +major { rd = 25 } + # # Old 4.4bsd pmax-specific scsi driver (deprecated). # diff --git a/sys/arch/pmax/pmax/conf.c b/sys/arch/pmax/pmax/conf.c index 861d6a5a422..afe4143a7b5 100644 --- a/sys/arch/pmax/pmax/conf.c +++ b/sys/arch/pmax/pmax/conf.c @@ -57,6 +57,8 @@ bdev_decl(tz); #include "ss.h" #include "uk.h" #include "ccd.h" +#include "rd.h" +bdev_decl(rd); struct bdevsw bdevsw[] = { @@ -85,6 +87,7 @@ struct bdevsw bdevsw[] = bdev_disk_init(NRZ,rz), /* 22: ?? old SCSI disk */ /*XXX*/ bdev_notdef(), /* 23: mscp */ bdev_disk_init(NCCD,ccd), /* 24: concatenated disk driver */ + bdev_disk_init(NRD,rd), /* 25: ram disk driver */ }; int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]); @@ -127,6 +130,7 @@ cdev_decl(cfb); cdev_decl(xcfb); #include "mfb.h" cdev_decl(mfb); +cdev_decl(rd); dev_decl(filedesc,open); #ifdef XFS @@ -259,6 +263,7 @@ struct cdevsw cdevsw[] = cdev_uk_init(NUK,uk), /* 89: unknown SCSI */ cdev_ss_init(NSS,ss), /* 90: SCSI scanner */ cdev_gen_ipf(NIPF,ipl), /* 91: ip filtering */ + cdev_disk_init(NRD,rd), /* 92: ram disk driver */ }; int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]); @@ -385,6 +390,11 @@ static int chrtoblktbl[] = { /* 85 */ NODEV, /* 86 */ NODEV, /* 87 */ 24, + /* 88 */ NODEV, + /* 89 */ NODEV, + /* 90 */ NODEV, + /* 91 */ NODEV, + /* 92 */ 25, /* rd */ }; /* diff --git a/sys/arch/pmax/pmax/rd_root.c b/sys/arch/pmax/pmax/rd_root.c new file mode 100644 index 00000000000..9e306993701 --- /dev/null +++ b/sys/arch/pmax/pmax/rd_root.c @@ -0,0 +1,77 @@ +/* $OpenBSD: rd_root.c,v 1.1 1998/11/09 05:40:00 millert 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/systm.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/pmax/ecoffrdsetroot.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("rd%d: fixed, %d byte blocks, %dK total\n", + unit, MINIROOTSIZE, ROOTBYTES / 1024); + } +} + +/* + * This is called during open (i.e. mountroot) + */ +void +rd_open_hook(unit, rd) + int unit; + struct rd_conf *rd; +{ +} |