summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-01-01 23:08:26 +0000
committerphk <phk@FreeBSD.org>2001-01-01 23:08:26 +0000
commitcdf3df051bdd690363bbd469c621113c53396d8a (patch)
tree8664bc87f76fdabcb4453d6f3569a719c1a926c3 /sbin/mdconfig
parent20531f46519da11794ae59760200817181476bdf (diff)
downloadFreeBSD-src-cdf3df051bdd690363bbd469c621113c53396d8a.zip
FreeBSD-src-cdf3df051bdd690363bbd469c621113c53396d8a.tar.gz
Add padding space and a version number to the md_ioctl structre for future
extension. Add ability to create a preload disk giving an address and a length (suggested by imp) Fix bug relating to very small md(4) devices. Update md.c copyright to reflect the status of code copied from vn.c. (noticed by dillon)
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.819
-rw-r--r--sbin/mdconfig/mdconfig.c2
2 files changed, 18 insertions, 3 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8
index 824bacc..c7ccba9 100644
--- a/sbin/mdconfig/mdconfig.8
+++ b/sbin/mdconfig/mdconfig.8
@@ -52,6 +52,7 @@
.Fl a
.Fl t Ar type
.Op Fl o Ar [no]option
+.Op Fl b Ar baseaddress
.Op Fl s Ar size
.Op Fl f Ar file
.Op Fl u Ar unit
@@ -80,8 +81,8 @@ Storage for this type of memory disk is allocated with
.Xr malloc 9 .
This limits the size to the malloc bucket limit in the kernel.
.It Ar preload
-This type represents memory disks which were instantiated by objects loaded
-by the bootloader. They can not be created on the fly.
+This type represents memory disks which are backed by memory outside the kernels normal address space.
+These can be instantiated automatically by objects loaded by the bootloader or configured on the fly.
.It Ar vnode
A file specified with
.Fl f Ar file
@@ -89,6 +90,8 @@ becomes the backingstore for this memory disk.
.It Ar swap
swapspace is used to back this memory disk.
.El
+.It Fl b Ar baseaddress
+Starting address in kernel virtual space of the memory to be used for a ``preload'' type disk.
.It Fl f Ar file
Filename to use for the vnode type memory disk.
.It Fl s Ar size
@@ -108,7 +111,13 @@ Automatically allocate the next free unit number for this disk.
The basename of the disk is printed on stdout.
.It Ar [no]compress
Enable/Disable compression features to reduce memory usage.
+.It Ar [no]readonly
+Enable/Disable readonly mode.
.El
+.It Fl u Ar unit
+Force the
+.Xr md(4)
+device to use a specific unit number.
.El
.Sh EXAMPLES
.Pp
@@ -138,6 +147,12 @@ To create and mount a 128MByte swap backed filesystem on
.Dl newfs -f 4096 /dev/md10c
.Dl tunefs -n enable /dev/md10c
.Dl mount /dev/md10c /tmp
+.Pp
+It is practically impossible to give a universal example of the ``preload'' type of disk,
+it is mainly useful in the embedded systems market, but to give a feel for how it works:
+On most standard PC architecture machines this will create a disk backed by the BIOS ROM:
+.Pp
+.Dl mdconfig -a -t preload -s 128k -b 0xc00fe000
.Sh SEE ALSO
.Xr md 4 ,
.Xr disklabel 8 ,
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index dca1b40..9f43877 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -44,7 +44,7 @@ main(int argc, char **argv)
int cmdline = 0;
for (;;) {
- ch = getopt(argc, argv, "adf:o:s:t:u:");
+ ch = getopt(argc, argv, "ab:df:o:s:t:u:");
if (ch == -1)
break;
switch (ch) {
OpenPOWER on IntegriCloud