Subject: MEMORY_DISK_SERVER ?
To: None <port-arm32@netbsd.org>
From: David McConnell <davem@eastcoast.co.za>
List: port-arm32
Date: 12/14/1999 19:10:11
Hello There

How do configure a /dev/md1 as a memory disk server?

I have /dev/md0 set up as a Kernel memory disk, i.e. MEMORY_DISK_SIZE is
defined for the kernel build.

I want to set up /dev/md1 from user space at runtime. (I have two md's
defined in my kernel).

However, when I do a mdconfig on md1, I get a "Device not configured". Now
studying the source code mdconf.c and the md device driver (md.c md.h ) and
md_hooks.c I can see why it returns that, but not how to get it to do
differently??

Essentially it returns out of the "mdopen" call in md.c when it detects
sc->sc_type == MD_UNCONFIGURED

Now, unless we are dealing with device md0 (i.e. specifically 0) I can't see
how the sc->sc_type can ever get set?

There is code that sets it in md.c, "md_ioctl_server",

sc->sc_type = MD_UMEM_SERVER;

but I cant see how we ever get to enter that code if we get an error on
"mdopen" cos the device is not configured. Looks like a chicken/egg thing to
me, but maybe I'm missing something??

The MD_SETCONF ioctl call is in mdconfig.c, but is never reach cos the
"open" fails.

I could use mount_mfs I guess but then I'm forced to include the MFS
filesystem. Not necessarily a train smash but.....

I get the idea (from the comments in md.h and md.c) that part of the
intention of "md" was to get away from the "MFS hack".

Any comments ?

Thanks

David