Device rename: rd' => md'

This commit is contained in:
pk 1997-01-02 00:22:43 +00:00
parent a0f6df960f
commit fa84b16b10
3 changed files with 31 additions and 31 deletions

View File

@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.1.1.1 1995/10/08 22:40:41 gwr Exp $
# $NetBSD: Makefile,v 1.2 1997/01/02 00:22:43 pk Exp $
PROG= rdconfig
MAN= rdconfig.8
PROG= mdconfig
MAN= mdconfig.8
.include <bsd.prog.mk>

View File

@ -1,5 +1,5 @@
.\"
.\" $NetBSD: mdconfig.8,v 1.1.1.1 1995/10/08 22:40:41 gwr Exp $
.\" $NetBSD: mdconfig.8,v 1.2 1997/01/02 00:22:44 pk Exp $
.\"
.\" Copyright (c) 1995 Gordon W. Ross
.\" All rights reserved.
@ -27,48 +27,48 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 8, 1993
.Dt RDCONFIG 8
.Dt MDCONFIG 8
.Os BSD 4
.Sh NAME
.Nm rdconfig
.Nd configure RAM disks
.Nm mdconfig
.Nd configure MEMORY disks
.Sh SYNOPSIS
.Nm rdconfig Fl c
.Nm mdconfig Fl c
.Op Fl v
.Ar special_file
.Ar 512-byte-blocks
.Sh DESCRIPTION
The
.Nm rdconfig
command configures RAM disk devices.
.Nm mdconfig
command configures memory disk devices.
It will associate the special file
.Ar special_file
with a range of user-virtual memory allocated by the
.Nm rdconfig
.Nm mdconfig
process itself. The
.Nm rdconfig
.Nm mdconfig
command should be run in the background.
If successful, the command will not return.
Otherwise, an error message will be printed.
.Pp
To "unconfigure" the ramdisk, just kill the background
.Nm rdconfig
To "unconfigure" the memory disk, just kill the background
.Nm mdconfig
process started earlier.
.Sh FILES
.Bl -tag -width /etc/rrd?? -compact
.It Pa /dev/rrd??
.It Pa /dev/rd??
.Bl -tag -width /etc/rmd?? -compact
.It Pa /dev/rmd??
.It Pa /dev/md??
.El
.Sh EXAMPLES
.Pp
.Dl rdconfig /dev/rd0a 2048 &
.Dl mdconfig /dev/md0a 2048 &
.Pp
Configures the RAM disk
.Pa rd0a
Configures the memory disk
.Pa md0a
with one megabyte of user-space memory.
.Sh BUGS
The special device will become inoperative if the
.Nm rdconfig
.Nm mdconfig
process is killed while the special device is open.
.Sh SEE ALSO
.Xr swapon 8 ,

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdconfig.c,v 1.1.1.1 1995/10/08 22:40:41 gwr Exp $ */
/* $NetBSD: mdconfig.c,v 1.2 1997/01/02 00:22:45 pk Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@ -32,7 +32,7 @@
/*
* This program exists for the sole purpose of providing
* user-space memory for the new RAM-disk driver (rd).
* user-space memory for the new memory-disk driver (md).
* The job done by this is similar to mount_mfs.
* (But this design allows any filesystem format!)
*/
@ -42,17 +42,17 @@
#include <sys/mman.h>
#include <sys/param.h>
#include <dev/ramdisk.h>
#include <dev/md.h>
main(argc, argv)
int argc;
char **argv;
{
struct rd_conf rd;
struct md_conf md;
int nblks, fd, error;
if (argc <= 2) {
fprintf(stderr, "usage: rdconfig <device> <%d-byte-blocks>\n",
fprintf(stderr, "usage: mdconfig <device> <%d-byte-blocks>\n",
DEV_BSIZE);
exit(1);
}
@ -62,7 +62,7 @@ main(argc, argv)
fprintf(stderr, "invalid number of blocks\n");
exit(1);
}
rd.rd_size = nblks << DEV_BSHIFT;
md.md_size = nblks << DEV_BSHIFT;
fd = open(argv[1], O_RDWR, 0);
if (fd < 0) {
@ -70,18 +70,18 @@ main(argc, argv)
exit(1);
}
rd.rd_addr = mmap(NULL, rd.rd_size,
md.md_addr = mmap(NULL, md.md_size,
PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE,
-1, 0);
if (rd.rd_addr == (caddr_t)-1) {
if (md.md_addr == (caddr_t)-1) {
perror("mmap");
exit(1);
}
/* Become server! */
rd.rd_type = RD_UMEM_SERVER;
if (ioctl(fd, RD_SETCONF, &rd)) {
md.md_type = MD_UMEM_SERVER;
if (ioctl(fd, MD_SETCONF, &md)) {
perror("ioctl");
exit(1);
}